Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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>" [CORE5056] #5343

Closed
firebird-automations opened this issue Dec 25, 2015 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @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

Commits: f4defcd 7b5b0ca FirebirdSQL/fbt-repository@5b5380b FirebirdSQL/fbt-repository@86f24cf

====== Test Details ======

Can be reproduced only on POSIX with scenario that is similar to:

@echo off
setlocal enabledelayedexpansion enableextensions
echo !time! starting ISQL...
echo select count(*) from rdb$types; | isql /3333:oltp30 -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 /3333:service_mgr -user SYSDBA -password masterkey
action_db_stats sts_hdr_pages dbname oltp30
echo !time! finish obtaining DB header info...
nbackup -L oltp30
echo !time! get lock
nbackup -N oltp30
echo !time! free lock

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Also made diagnostics better

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC2 [ 10048 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Deferred

Test Details: Can be reproduced only on POSIX with scenario that is similar to:

@echo off
setlocal enabledelayedexpansion enableextensions
echo !time! starting ISQL...
echo select count(*) from rdb$types; | isql /3333:oltp30 -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 /3333:service_mgr -user SYSDBA -password masterkey
action_db_stats sts_hdr_pages dbname oltp30
echo !time! finish obtaining DB header info...
nbackup -L oltp30
echo !time! get lock
nbackup -N oltp30
echo !time! free lock

Test Specifics: [Platform (Windows/Linux) specific]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants