Subject Decodeing GDS Lock Print
Author Patrick J. P. Griffin
I'm confused. I thought I understood gds_lock_print output - until today.

(I run Firebird AIX Classic 6.0.9.1)

Today I encountered a large number of users that appear to be waiting on
just one lock.

I started with:

LOCK BLOCK 31216
Series: 3, Parent: 14760, State: 3, size: 4 length: 4 data: 0
Key: 009294, Flags: 0x00, Pending request count: 16
Hash que (11): forward: 1194376, backward: 2172
Requests (16): forward: 607596, backward: 1667408
Request 607596, Owner: 901460, State: 0 (6), Flags: 0x82
Request 1185088, Owner: 1083572, State: 0 (3), Flags: 0x02
Request 1400316, Owner: 405448, State: 0 (3), Flags: 0x02
Request 1711920, Owner: 1166816, State: 0 (3), Flags: 0x02
Request 1489908, Owner: 1213756, State: 0 (3), Flags: 0x02
Request 593600, Owner: 330128, State: 0 (3), Flags: 0x02
Request 185740, Owner: 734556, State: 0 (3), Flags: 0x02
Request 629548, Owner: 497384, State: 0 (3), Flags: 0x02
Request 125812, Owner: 620516, State: 0 (3), Flags: 0x02
Request 1701860, Owner: 1316988, State: 0 (3), Flags: 0x02
Request 472716, Owner: 14636, State: 0 (3), Flags: 0x02
Request 1544416, Owner: 575276, State: 0 (3), Flags: 0x02
Request 808704, Owner: 153208, State: 0 (3), Flags: 0x02
Request 682684, Owner: 396828, State: 0 (3), Flags: 0x02
Request 1230752, Owner: 198832, State: 0 (3), Flags: 0x02
Request 1667408, Owner: 1195636, State: 0 (3), Flags: 0x82


And can't understand why none of these requests get satisfied?

Lock block 14760 is a series 1 database lock.

I looked into GDS$PAGES in the appropriate database, but I guess page number
9294 isn't interesting enough to warrant an entry. I'm guessing that this
page belongs to relation #128, but examining that lock block doesn't show
anything immediately interesting.

The lock header did not show any deadlocks, but since they were the subjects
of a deadlock scan, I examined:

OWNER BLOCK 901460
Owner id: 86546, type: 3, flags: 0x02, pending: 607596, semid: 156
Process id: 86546, UID: 0xC8 Alive
Flags: 0x02 scan
Requests (85): forward: 1465280, backward: 607596
Blocks: *empty*

With

REQUEST BLOCK 607596
Owner: 901460, Lock: 31216, State: 0, Mode: 6, Flags: 0x82
AST: 0xF0241F44, argument: 0x2014B180
lrq_own_requests: forward: 901468, backward: 1706132
lrq_lbl_requests: forward: 1185088, backward: 31196
lrq_own_blocks : *empty*



And

OWNER BLOCK 1195636
Owner id: 113940, type: 3, flags: 0x02, pending: 1667408, semid: 53
Process id: 113940, UID: 0x343 Alive
Flags: 0x02 scan
Requests (79): forward: 91708, backward: 1667408
Blocks: *empty*


with

REQUEST BLOCK 1667408
Owner: 1195636, Lock: 31216, State: 0, Mode: 3, Flags: 0x82
AST: 0xF0241F44, argument: 0x2014F624
lrq_own_requests: forward: 1195644, backward: 1445028
lrq_lbl_requests: forward: 31196, backward: 1230752
lrq_own_blocks : *empty*


And couldn't find any evidence that these tasks were not responding.

In the end, I killed task 86549 (from the first OWNER block listed above)
and all other tasks completed normally. There were no further lock incidents
today. But, since this system is new to this version of Interbase, I want
to pursue this it incase there are important lessons to learn.

Anyone have any suggestions where I should look? (I've saved copies of the
output from gds_lock_print, semdisp, ps -ef, and ps aux so that I can
continue to hunt.)

Thanks!

...pat