Subject Re: [firebird-support] Fatal lock manager error: invalid lock id (31753528), errno: 2
Author Steve Wiser
We ran into a problem like this a few months ago on one of our servers
(CentOS 4, Firebird 1.5.3 CS, lots of RAM and HDD space). I think we
found the problem to be one of two things:

We had (1) old IBPerl code using Interbase libraries (this server used
to run Interbase 5.6 before we upgraded) connecting to the Firebird
databases and (2) they were connecting locally to the fdb files at the
same time that there were remote connections. We recompiled IBPerl to
use the Firebird libraries and changed all of the connection strings to
be remote and the problem gone away for now. I hope it doesn't come back...

Not sure if that helps

-steve

k_smith_000 wrote:
>
> Hello,
>
> Since few months I've got regular problems with my database.
> About once in a week, morning, users log into application and they
> run various functions and sometimes after execution of random
> function, server hangs.
>
> Firebird process (fb_inet_server) takes 100% of CPU usage.
> No other database attachment is possible. When I kill that process,
> another fb_inet_server is taking 100% of CPU usage. Anyway, I have to
> reboot whole machine and then users can normally execute application.
>
> When I check /opt/firebird/firebird.log file, I see:
> Fatal lock manager error: invalid lock id (31753528), errno: 2
>
> which gives me a hint... There's something wrong with Lock Manager,
> isn't it ?
>
> It's worth to notice, that when I execute fb_lock_print utility it hangs:
> [root@localhost ~]# fb_lock_print
> LOCK_HEADER BLOCK
> Version: 15, Active owner: -2, Length: 36536320, Used:
> 36536056
> Lock manager pid: 2391
> Semmask: 0x2C74, Flags: 0x0001
> Enqs: 345140030, Converts: 611934, Rejects: 178030, Blocks:
> 3138469
> Deadlock scans: 0, Deadlocks: 0, Scan interval: 10
> Acquires: 371519603, Acquire blocks: 6560083, Spin count: 0
> Mutex wait: 1.8%
> Hash slots: 101, Hash lengths (min/avg/max): 194/ 213/ 236
> Remove node: 0, Insert queue: 0, Insert prior: 0
> Owners (16): forward: 11704, backward: 6897108
> Free owners (13): forward: 5345264, backward: 8181388
> ***** here fb_lock_print hangs
>
> It is also impossible to connect to database in "local mode", using isql:
> isql database.gdb
>
> I thought it may be important to send strace log of isql command:
>
>
> kill(2391, SIG_0) = 0
> kill(19720, SIG_0) = -1 ESRCH (No such process)
>
> **here strace stops while isql hangs
> ---------
>
> I've check amount of free disk space and RAM. It all looks fine.
>
> It may be important that I've 3 database files on my server with the
> same database file name (3 database.gdb files in different
> directories). They are sometimes accessed concurently.
>
> I've made a copies of /opt/firebird/isc* files, so if they can help I
> can send them.
>
> Some technical information:
> *Database is running on Linux Fedora Core 6.
> *Database size is about 2.5GB. Server has 2 Xeon processors.
>
> *Firebird version:
> SQL> show version;
> ISQL Version: LI-V1.5.3.4870 Firebird 1.5
>
> I use standard firebird configuration. One excetpion is:
> DefaultDbCachePages = 6044
>
> I had to admit that we use Firebird for few years and our databases
> have up to 10 GB. As for know we haven't serious problems with
> database... that's why I'm in a deep concern about abovementioned issue...
>
> Because I had to take some actions, I have reinstalled Firebird on my
> server to the newest Firebird 1.5.4 version. As for now it's not
> impossible to install Firebird 2.0.3 one, while we're still testing it.
>
> Best regards,
> Kevin Smith
>
>