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

Avoid UPDATE of RDB$DATABASE by ALTER DATABASE statement when possible [CORE5704] #5970

Closed
firebird-issue-importer opened this issue Jan 9, 2018 · 4 comments

Comments

@firebird-issue-importer
Copy link

firebird-issue-importer commented Jan 9, 2018

Submitted by: @hvlad

Some clauses of ALTER DATABASE statement requires to update row in RDB$DATABASE:
SET DEFAULT CHARACTER SET, SET LINGER, DROP LINGER.

Other clauses doesn't requires to update RDB$DATABASE:
BEGIN|END BACKUP, ENCRYPT, DECRYPT, etc

Internally, engine runs such UPDATE despite the kind of clause specified by the user.
It is necessary to prevent concurrent run of ALTER DATABASE statements by parallel transactions.

Unfortunately, such dummy update blocks other transactions which reads RDB$DATABASE in READ COMMITTED NO RECORD VERSION mode.
Usually such blockage is very short, but in case of ALTER DATABASE END BACKUP it could be up to tens of minutes.

For example: user complains that isql can not connect with isql to the database while ALTER DATABASE END BACKUP is running.
Actually, isql connects successfully, but it reads RDB$DATABASE itself right after attachment (using READ COMMITTED NO RECORD
VERSION WAIT transaction) and waits until ALTER DATABASE END BACKUP commits.

The improvement is to avoid dummy update of RDB$DATABASE when possible and use implicit lock to prevent concurrent run
of ALTER DATABASE statement.

Commits: 62735f4 6988a98 73cdac3 c5667b3

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 9, 2018

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 9, 2018

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 3.0.3 [ 10810 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 16, 2018

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 16, 2018

Modified by: @pavel-zotov

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

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