Write-lock of database file is cleared ("W" disappears from output of lsof 
<db_name>) when remote machine obtains DB header running "fbsvcmgr 
<remote_host>/port:service_mgr action_db_stats <remote_dbname>"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-5056
                 URL: http://tracker.firebirdsql.org/browse/CORE-5056
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine, SVCMGR
            Reporter: Pavel Zotov


Environment:

1) database on LINUX server (host/port:database = 
192.168.0.220/3333:/var/db/fb30/oltp30.fdb );
2) FB binaries, including fbsvcmgr, present on Windows machine which serves now 
as client;
3) time values on both machines are very close.

Consider batch that is launched on Windows machine:
===
@echo off
setlocal enabledelayedexpansion enableextensions
echo !time! starting ISQL...
echo select count(*) from rdb$types; | isql 
192.168.0.220/3333:/var/db/fb30/oltp30.fdb -user sysdba -pas masterkey >nul
echo !time! return from ISQL, start small delay...
ping -n 3 127.0.0.1 >nul
echo !time! finish small delay, starting obtaining DB header info...
fbsvcmgr 192.168.0.220/3333:service_mgr -user SYSDBA -password masterkey 
action_db_stats sts_hdr_pages dbname /var/db/fb30/oltp30.fdb
echo !time! finish obtaining DB header info...
===

Before this batch will be run, start following .sh on Linux host:
===
log=./lsof_$(date +'%Y%m%d_%H%M%S').log
rm -f $log
while :
do
  supertee -tan $log lsof /var/db/fb30/oltp30.fdb
  sleep 0.5
done
===
-- and then run windows batch.

Log of .sh will be following:
===
[root@oel64 21:06:51 /var/db/fb30/logs]$ head -1 lsof_20151225_210630.log; grep 
-iv "COMMAND" lsof_20151225_210630.log
Fri Dec 25 21:06:35 2015: COMMAND    PID     USER   FD   TYPE DEVICE   SIZE/OFF 
   NODE NAME
Fri Dec 25 21:06:35 2015: firebird 15993 firebird    9u   REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
Fri Dec 25 21:06:35 2015: firebird 15993 firebird    9uW  REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
Fri Dec 25 21:06:36 2015: firebird 15993 firebird    9uW  REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
Fri Dec 25 21:06:36 2015: firebird 15993 firebird    9uW  REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
Fri Dec 25 21:06:37 2015: firebird 15993 firebird    9uW  REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
Fri Dec 25 21:06:37 2015: firebird 15993 firebird    9uW  REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb --------- [ 1 ]
Fri Dec 25 21:06:38 2015: firebird 15993 firebird    9u   REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb ----------- [ 2 ]
Fri Dec 25 21:06:39 2015: firebird 15993 firebird    9u   REG    8,4 3510632448 
6554793 /var/db/fb30/oltp30.fdb
===

Ouput of Windows batch will be:
===
21:06:33.71 starting ISQL...
21:06:34.85 return from ISQL, start small delay...
21:06:36.88 finish small delay, starting obtaining DB header info...
21:06:36.98 finish obtaining DB header info...
===

Between points [1] and [2] lock-state of database was changed from "9uW" to 
"9u". 
It is  "fbsvcmgr action_db_stats" command that was run on Windows host that 
lead to this change.

PS. LI-V3.0.0.32239

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to