powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
8 сообщений из 8, страница 1 из 1
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556186
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
hi all

Дано:
1) база, нагруженная 350 коннектами от DML-молотилок
2) запущенный трейс с конфигом:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
database = 
{
  enabled = true
  log_sweep = true
  log_connections = true
  log_errors = true
  time_threshold = 0
}
3) .shell-скрипт, делающий в цикле
3.1) старт gfix -sweep в фоновом режиме (т.е. с добавлением '&' в хвост команды)
3.2) паузу в 20 сек (свип за это время никогда не соберёт мусор на этой базе и этой нагрузке)
3.3) после паузы - коннект через TCP с заданием грохнуть аттач от gfix'a (причём, именно от "живого" gfix'a, а не 'defunct'-мертвяков)
3.4) выводящий таймштамп времени *до* и *после* выполнения команды delete from mon$attachments
3.5) по завершении isql - делающий релакс на 90 сек (на всякий случай :)).
Вот этот скрипт:
sweep_killer.sh
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
fbhome=/opt/fb30trnk
delay=20
relax=90
sign=15
sql=killsweep_from_mon.tmp
err=killsweep_from_mon.err
rm -f $sql
echo set list on\;>>$sql
echo select current_timestamp dts_before_kill_sweep_thread from rdb\$database\;>>$sql
echo commit\; delete from mon\$attachments where mon\$remote_process containing \'gfix\'\;>>$sql
echo select current_timestamp dts_after_kill_sweep_thread from rdb\$database\;>>$sql

i=1
killall -9 gfix
while :
do
  echo . . . . . . . . . . .  iter N $i . . . . . . . . . . . . . .
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) sweep started
  set -x
  $fbhome/bin/gfix -sweep idx_test &
  set +x
   pid=$(ps aux|grep $fbhome/bin/gfix|grep -v "defunct\|grep"|awk '{print $2}') 
  echo sweep process: $pid
  ps aux|grep $fbhome/bin/gfix|grep -v "defunct\|grep"
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) now wait $delay seconds before killing it...
  sleep $delay
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) killing gfix process...
  rm -f $err
  set -x
  $fbhome/bin/ isql localhost/3333:idx_test -i $sql -m -o $err   # NB: коннект делаем по протоколу TCP! 
  set +x
  cat -n $err
  echo result of killing: check that there is NO alive gfix pid:
  ps aux|grep gfix|grep -v grep
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) relax $relax seconds...
  sleep $relax
  i=$((i+1))
done

В итоге, на каждой итерации этого скрипта, начиная со второй, вижу
Код: plaintext
1.
2.
3.
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable

Хотя если смотреть за списком pid для процессов с гремоп по 'gfix', то видно, что работавший gfix -sweep действительно исчезает (см под спойлером, выделено синим цветом):
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
 . . . . . . . . . . . iter N 1 . . . . . . . . . . . . . . 
2014-02-10 18:32:37.5476 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18339 
root     18339  1.0  0.0  88072  6356 pts/9    Sl+  18:32   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:32:37.5898 now wait 20 seconds before killing it...
2014-02-10 18:32:57.5935 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:32:57.9470
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:34:25.3940
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:34:25.7603 relax 90 seconds...
 . . . . . . . . . . . iter N 2 . . . . . . . . . . . . . . 
2014-02-10 18:35:55.7642 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18465 
root     18465  1.0  0.0  88072  6356 pts/9    Sl+  18:35   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:35:55.8082 now wait 20 seconds before killing it...
2014-02-10 18:36:15.8144 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:36:16.1540
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:37:03.1820
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:37:03.9244 relax 90 seconds...
 . . . . . . . . . . . iter N 3 . . . . . . . . . . . . . . 
2014-02-10 18:38:33.9286 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18599 
root     18599  2.0  0.0  88072  6356 pts/9    Sl+  18:38   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:38:33.9719 now wait 20 seconds before killing it...
2014-02-10 18:38:53.9758 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:38:54.3790
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:39:30.8620
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:39:31.9325 relax 90 seconds...
 . . . . . . . . . . . iter N 4 . . . . . . . . . . . . . . 
2014-02-10 18:41:01.9391 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18681 
root     18681  2.0  0.0  88072  6368 pts/9    Sl+  18:41   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:41:01.9862 now wait 20 seconds before killing it...
2014-02-10 18:41:21.9901 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:41:22.4670
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:41:56.0520
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:41:56.9813 relax 90 seconds...
 . . . . . . . . . . . iter N 5 . . . . . . . . . . . . . . 
2014-02-10 18:43:26.9855 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18756 
root     18756  1.0  0.0  88072  6360 pts/9    Sl+  18:43   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:43:27.0321 now wait 20 seconds before killing it...
2014-02-10 18:43:47.0361 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:43:47.4560
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:44:21.3260
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:44:22.3383 relax 90 seconds...
 . . . . . . . . . . . iter N 6 . . . . . . . . . . . . . . 
2014-02-10 18:45:52.3423 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep idx_test
sweep process:  18824 
root     18824  1.0  0.0  88072  6356 pts/9    Sl+  18:45   0:00 /opt/fb30trnk/bin/gfix -sweep idx_test
2014-02-10 18:45:52.3842 now wait 20 seconds before killing it...
2014-02-10 18:46:12.3879 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
I/O error during "lock" operation for file "idx_test"
-Error while trying to open file
-Resource temporarily unavailable
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 18:46:12.8000
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 18:46:45.7140
     7
     8
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
2014-02-10 18:46:46.5378 relax 90 seconds...

firebird.log:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
oel64   Mon Feb 10 18:34:25 2014
        Error during sweep:
        connection shutdown


oel64   Mon Feb 10 18:35:55 2014
        Sweep is started by SYSDBA
        Database "idx_test"
        OIT 2293386, OAT 2293387, OST 2293387, Next 2302568


oel64   Mon Feb 10 18:37:03 2014
        Error during sweep:
        connection shutdown


oel64   Mon Feb 10 18:38:34 2014
        Sweep is started by SYSDBA
        Database "idx_test"
        OIT 2316678, OAT 2316679, OST 2316679, Next 2324375


oel64   Mon Feb 10 18:39:30 2014
        Error during sweep:
        connection shutdown

. . .


Вопрос, соб-сно, простой: почему выдаётся сообщение "Resource temporarily unavailable" ?
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556266
Dimitry Sibiryakov
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Таблоидпочему выдаётся сообщение "Resource temporarily unavailable" ?
Возможно потому, что твоему линуксу кончился лимит открытых файлов.
Posted via ActualForum NNTP Server 1.5
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556267
hvlad
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Таблоид
Код: plaintext
$fbhome/bin/gfix -sweep idx_test &
localhost: добавь
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556288
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
hvladТаблоид
Код: plaintext
$fbhome/bin/gfix -sweep idx_test &
localhost: добавьДобавил. Теперь процесс gfix -sweep *не* (само)удаляется после отрубания его через delete from mon$att:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
. . . . . . . . . . . iter N 1 . . . . . . . . . . . . . .
2014-02-10 20:21:25.2224 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
sweep process:  22293 
root     22293  0.0  0.0  46936  2472 pts/9    Sl+  20:21   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
2014-02-10 20:21:25.2598 now wait 20 seconds before killing it...
2014-02-10 20:21:45.2634 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 20:21:46.1000
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 20:22:29.8810
     7
     8
result of killing:  check that there is NO alive gfix pid :
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
root     22223  1.4  0.0      0     0 pts/9    Z    20:20   0:02 [gfix] <defunct>
 root     22293  0.0  0.0  88072  6384 pts/9    Sl+  20:21   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test 
2014-02-10 20:22:30.8122 relax 90 seconds...
. . . . . . . . . . . iter N 2 . . . . . . . . . . . . . .
2014-02-10 20:24:00.8159 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
sweep process:  22293 22427 
 root     22293  0.0  0.0 135776  3420 pts/9    Sl+  20:21   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
root     22427  0.0  0.0  46936  2472 pts/9    Sl+  20:23   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test 
2014-02-10 20:24:00.8622 now wait 20 seconds before killing it...
^C
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556296
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ну-ка еще раз смотрим.
Вот временнЫе метки для первой итерации (см предыдущий пост):
Код: plaintext
1.
2.
3.
4.
5.
6.
2014-02-10 20:21:25.2224 sweep started
2014-02-10 20:21:25.2598 now wait 20 seconds before killing it...
2014-02-10 20:21:45.2634 killing gfix process...
...
DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10  20:22:29.8810 
...
2014-02-10 20:22:30.8122 relax 90 seconds...

И вот трейс для этой же первой итерации:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
2014-02-10T20:21:25.2670 (10381:0x7f4c2a8e1580) ATTACH_DATABASE
        idx_test (ATT_860, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/gfix:22293

2014-02-10T20:21:25.2710 (10381:0x7f4c2a8e1580) SWEEP_START
        idx_test (ATT_860, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/gfix:22293

Transaction counters:
        Oldest interesting    3139561
        Oldest active         3139562
        Oldest snapshot       3139562
        Next transaction      3151168

--

2014-02-10T 20:22:29.8740  (10381:0x7f4c2a8e1580) SWEEP_FAILED
        idx_test (ATT_860, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/gfix:22293
  64602 ms, 226 write(s), 2128643 fetch(es), 251363 mark(s)

2014-02-10T20:22:29.8820 (10381:0x7f4c2a8e1580) ERROR AT JProvider::attachDatabase
        idx_test (ATT_860, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/gfix:22293
335544856 : connection shutdown

2014-02-10T 20:22:29.8820  (10381:0x7f4c2a8e1580)  DETACH_DATABASE 
        idx_test (ATT_860, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/gfix:22293

2014-02-10T20:22:29.9260 (10381:0x7f4ce17f99a8) DETACH_DATABASE
        idx_test (ATT_861, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
        /opt/fb30trnk/bin/isql:22318
Процесс gfix -sweep остался живым, а трейс показал, что он отсоединился от базы. Это как так ?
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556304
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Воспроизвёл в третий раз: живучий этот gfix -sweep когда лезет через localhost :-)
Ещё и какое-то из ядер грузит на 99%
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
top - 20:51:40 up 5 days,  7:02,  9 users,  load average: 5.38, 5.51, 5.70
Tasks: 219 total,   2 running, 185 sleeping,  21 stopped,  11 zombie
Cpu0  : 61.9%us, 13.8%sy,  0.0%ni, 24.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  : 54.5%us, 13.6%sy,  0.0%ni, 31.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 48.6%us, 12.4%sy,  0.0%ni, 39.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  : 43.3%us, 13.5%sy,  0.0%ni, 43.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu4  : 41.4%us,  8.3%sy,  0.0%ni, 50.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu5  :  8.3%us, 91.7%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu6  : 50.0%us, 15.6%sy,  0.0%ni, 32.7%id,  0.0%wa,  0.0%hi,  1.7%si,  0.0%st
Cpu7  : 48.8%us,  8.1%sy,  0.0%ni, 43.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu8  : 34.9%us,  9.7%sy,  0.0%ni, 55.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu9  : 34.2%us,  6.8%sy,  0.0%ni, 58.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu10 : 27.8%us,  5.8%sy,  0.0%ni, 66.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu11 : 30.3%us,  4.8%sy,  0.0%ni, 65.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32988060k total, 32718192k used,   269868k free,   101008k buffers
Swap: 32767996k total,   104068k used, 32663928k free, 25953736k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
10381 firebird  20   0 20.0g 5.1g  13m R 588.0 16.2   2282:08 /opt/fb30trnk/bin/firebird
22835 root      20   0  111m 2740 2220 S  99.9   0.0   5:17.93 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_t
В аттаче - несколько бактрасс для него, с интервалом 10 сек.
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556310
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
В общем, он на самом деле... не удаляется командой DELETE!
Ибо вот, через 5 (10 ?) минут после того, как грохнул последний раз:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
$ /opt/fb30trnk/bin/isql /var/db/fb30/idx_under_load_trnk.fdb
Database:  /var/db/fb30/idx_under_load_trnk.fdb
SQL> set list on; commit; select * from mon$attachments where mon$remote_process containing 'gfix';

MON$ATTACHMENT_ID               920
MON$SERVER_PID                  10381
MON$STATE                       0
MON$ATTACHMENT_NAME             idx_test
MON$USER                        SYSDBA                                                                                      
MON$ROLE                        NONE                                                                                        
MON$REMOTE_PROTOCOL             TCPv4
MON$REMOTE_ADDRESS              127.0.0.1
 MON$REMOTE_PID                  22835 
MON$CHARACTER_SET_ID            0
MON$TIMESTAMP                   2014-02-10 20:46:14.8670
MON$GARBAGE_COLLECTION          1
MON$REMOTE_PROCESS              /opt/fb30trnk/bin/gfix
MON$STAT_ID                     6
MON$CLIENT_VERSION              LI-T3.0.0.30876 Firebird 3.0 Alpha 2
MON$REMOTE_VERSION              P13
MON$REMOTE_HOST                 oel64
MON$REMOTE_OS_USER              root
MON$AUTH_METHOD                 Legacy_Auth
MON$SYSTEM_FLAG                 0
...
Рейтинг: 0 / 0
isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
    #38556321
Таблоид
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Итого test case.
1) shell-скрипт:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
fbhome=/opt/fb30trnk
delay=20
relax=90
sign=15
sql=killsweep_from_mon.tmp
err=killsweep_from_mon.err
rm -f $sql
echo set list on\;>>$sql
echo select current_timestamp dts_before_kill_sweep_thread from rdb\$database\;>>$sql
echo commit\; delete from mon\$attachments where mon\$remote_process containing \'gfix\'\;>>$sql
echo select current_timestamp dts_after_kill_sweep_thread from rdb\$database\;>>$sql
echo commit\; select count\(mon\$remote_pid\) count_gfix_pid_after_deleting from mon\$attachments where mon\$remote_process containing \'gfix\'\;>>$sql
echo quit\;>>$sql
i=1
killall -9 gfix
while :
do
  echo . . . . . . . . . . .  iter N $i . . . . . . . . . . . . . .
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) sweep started
  set -x
  $fbhome/bin/ gfix -sweep localhost/3333:idx_test & 
  set +x
  #pid=$(ps aux|grep $fbhome/bin/gfix|grep -v "grep"|grep -v "defunc"|awk '{print $2}')
  pid=$(ps aux|grep $fbhome/bin/gfix|grep -v "defunct\|grep"|awk '{print $2}')
  echo sweep process: $pid
  ps aux|grep $fbhome/bin/gfix|grep -v "defunct\|grep"
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) now wait $delay seconds before killing it...
  sleep $delay
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) killing gfix process...
  rm -f $err
  set -x
  $fbhome/bin/ isql localhost/3333:idx_test -i $sql -m -o $err 
  set +x
  cat -n $err
  echo result of killing: check that there is NO alive gfix pid:
  ps aux|grep gfix|grep -v grep
  echo $(echo -n $(date +'%Y-%m-%d %H:%M:%S.%N')|cut -c1-24) relax $relax seconds...
  sleep $relax
  i=$((i+1))
done

2) .sql-скрипт (killsweep_from_mon.tmp), который будет выполняться для убиения gfix'a:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
set list on;
select current_timestamp dts_before_kill_sweep_thread from rdb$database;
commit; delete from mon$attachments where mon$remote_process containing 'gfix';
select current_timestamp dts_after_kill_sweep_thread from rdb$database;
 -- добавлено для контроля: 
 commit; select count(mon$remote_pid) count_gfix_pid_after_deleting from mon$attachments where mon$remote_process containing 'gfix'; 
quit;

3) Запускаю .sh, он выводит:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
. . . . . . . . . . . iter N 1 . . . . . . . . . . . . . .
2014-02-10 21:10:02.4487 sweep started
++ set +x
++ /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
sweep process: 23748
root     23748  0.0  0.0  46936  2456 pts/15   Sl+  21:10   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
2014-02-10 21:10:02.4895 now wait 20 seconds before killing it...
2014-02-10 21:10:22.4972 killing gfix process...
++ /opt/fb30trnk/bin/isql localhost/3333:idx_test -i killsweep_from_mon.tmp -m -o killsweep_from_mon.err
++ set +x
     1
     2  DTS_BEFORE_KILL_SWEEP_THREAD    2014-02-10 21:10:23.0920
     3
     4
     5
     6  DTS_AFTER_KILL_SWEEP_THREAD     2014-02-10 21:10:54.7550
     7
     8
     9
    10   COUNT_GFIX_PID_AFTER_DELETING   0   -- да, НЕТУ его, аттача этого! (якобы) 
    11
    12
result of killing: check that there is NO alive gfix pid:
root     11771  0.0  0.0      0     0 pts/7    Z    Feb09   0:00 [gfix] <defunct>
root     12816  0.0  0.0      0     0 pts/17   Z    15:51   0:00 [gfix] <defunct>
root     13698  0.0  0.0      0     0 pts/17   Z    16:09   0:00 [gfix] <defunct>
root     22223  0.0  0.0      0     0 pts/9    Z    20:20   0:02 [gfix] <defunct>
root      23748   0.0  0.0 114524  2728 pts/15   Sl+  21:10   0:00 /opt/fb30trnk/bin/gfix -sweep localhost/3333:idx_test
2014-02-10 21:11:34.9098 relax 90 seconds...

4) Вижу в top'e, что процесс gfix'a вскоре после первой паузы начал набирать обороты и грузщить ЦПУ, вплоть до 99%. Жамкаю Ctrl-C.
5) НЕторопять загружаю isql и ввожу:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
$ /opt/fb30trnk/bin/isql localhost/3333:idx_test
Database:  localhost/3333:idx_test
SQL> set list on; commit; select * from mon$attachments where mon$remote_process containing 'gfix';

MON$ATTACHMENT_ID               934
MON$SERVER_PID                  10381
MON$STATE                       0
MON$ATTACHMENT_NAME             idx_test
MON$USER                        SYSDBA                                                                                      
MON$ROLE                        NONE                                                                                        
MON$REMOTE_PROTOCOL             TCPv4
MON$REMOTE_ADDRESS              127.0.0.1
 MON$REMOTE_PID                  23748 
MON$CHARACTER_SET_ID            0
MON$TIMESTAMP                   2014-02-10 21:10:55.1670
MON$GARBAGE_COLLECTION          1
MON$REMOTE_PROCESS              /opt/fb30trnk/bin/gfix
MON$STAT_ID                     6
MON$CLIENT_VERSION              LI-T3.0.0.30876 Firebird 3.0 Alpha 2
MON$REMOTE_VERSION              P13
MON$REMOTE_HOST                 oel64
MON$REMOTE_OS_USER              root
MON$AUTH_METHOD                 Legacy_Auth
MON$SYSTEM_FLAG                 0

Чё за хрень ??
...
Рейтинг: 0 / 0
8 сообщений из 8, страница 1 из 1
Форумы / Firebird, InterBase [игнор отключен] [закрыт для гостей] / isql -i kill_gfix_sweep.sql, коннект по TCP: I/O error during lock op, temply unavailable
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]