-=| Dmitry Yemanov, 14.11.2011 23:42:53 +0400 |=-
> 14.11.2011 23:15, Damyan Ivanov wrote:
> 
> > # session 1
> > $ FIREBIRD=. FIREBIRD_LOCK=. isql-fb dbd-firebird-test.fdb
> > Database:  dbd-firebird-test.fdb
> > SQL>
> >
> > # session 2, from another terminal, running in the same working
> > # directory
> > FIREBIRD=. FIREBIRD_LOCK=. isql-fb dbd-firebird-test.fdb
> > # hangs
> 
> Do both terminals run with the same Linux user credentials?

Yes. The same setup works on several other architectures.

> Is there anything interesting in firebird.log?

There is no firebird.log file in the current directory. Perhaps 
I missed an additional environment variable that needs to be set for 
embedded (the system-wide firebird log directory is not writable by 
the user).

> > Attaching gdb to the second session's isql and requesting a backtrace
> > gives the following:
> 
> The second connection waits for the first one to downgrade its database 
> lock, but its request gets ignored.
> 
> A lock print output (with the -a switch) could be useful here.

Here it is. This is after (1) creating the database in the first 
session and (2) attempting to attach to the freshly created database 
in another session (same user, hanging).

$ FIREBIRD=. FIREBIRD_LOCK=. /usr/sbin/fb_lock_print -d test.fdb
LOCK_HEADER BLOCK
        Version: 17, Active owner:      0, Length: 1048576, Used:  23896
        Flags: 0x0001
        Enqs:     79, Converts:     13, Rejects:     56, Blocks:      0
        Deadlock scans:      0, Deadlocks:      0, Scan interval:  10
        Acquires:    237, Acquire blocks:      0, Spin count:   0
        Mutex wait: 0.0%
        Hash slots: 1009, Hash lengths (min/avg/max):    0/   0/   3
        Remove node:      0, Insert queue:      0, Insert prior:      0
        Owners (2):     forward:  20872, backward:  23672
        Free owners: *empty*
        Free locks: *empty*
        Free requests: *empty*
        Lock Ordering: Enabled

OWNER BLOCK  20872
        Owner id: 73448235728900, type: 1, pending:      0
        Process id:  17101 (Alive), thread id: 1073877248
        Flags: 0x10                           sgnl
        Requests (21):  forward:  21040, backward:  23440
        Blocks (1):     forward:  21040, backward:  21040

OWNER BLOCK  23672
        Owner id: 73761768341505, type: 1, pending:  23840
        Process id:  17174 (Alive), thread id: 1073877248
        Flags: 0x24                 wait tout     
        Requests (1):   forward:  23840, backward:  23840
        Blocks: *empty*

Event log:
------------- end of output ---------------

If at this point the first isql is exited, it hangs and the lock table 
dump is:

LOCK_HEADER BLOCK
        Version: 17, Active owner:      0, Length: 1048576, Used:  27144
        Flags: 0x0001
        Enqs:    531, Converts:     16, Rejects:    450, Blocks:      0
        Deadlock scans:      0, Deadlocks:      0, Scan interval:  10
        Acquires:   1521, Acquire blocks:      1, Spin count:   0
        Mutex wait: 0.1%
        Hash slots: 1009, Hash lengths (min/avg/max):    0/   0/   3
        Remove node:      0, Insert queue:      0, Insert prior:      0
        Owners (1):     forward:  23672, backward:  23672
        Free owners (1):        forward:  20872, backward:  20872
        Free locks (2): forward:  21224, backward:  26840
        Free requests (1):      forward:  26784, backward:  26784
        Lock Ordering: Enabled

OWNER BLOCK  23672
        Owner id: 73761768341505, type: 1, pending:      0
        Process id:  17174 (Alive), thread id: 1073877248
        Flags: 0x08       wake                    
        Requests (47):  forward:  23840, backward:  27024
        Blocks: *empty*

Event log:
    DEL_OWNER:  owner =  20872, lock =  20872, request =      0
------------- end of output ---------------

Hopefully this gives some clues.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to