Issue Details (XML | Word | Printable)

Key: CORE-5704
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Avoid UPDATE of RDB$DATABASE by ALTER DATABASE statement when possible

Created: 09/Jan/18 11:20 AM   Updated: 16/Jan/18 01:39 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 3.0.3, 4.0 Beta 1

QA Status: Done successfully


 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.