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

Let attachments to not block others when allocation table is read first time [CORE4432] #4752

Closed
firebird-issue-importer opened this issue May 16, 2014 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @hvlad

The issue:
- every new attachment need to read nbackup allocation table from disk (i.e. from a delta file)
- while reading, attachment holds SH lock on allocation table, so all readers share this lock and proceed in parallel
- when some other attachment need to allocate new page in delta file, it acquires EX lock on alloc table.
This lock request go to common queue AND blocks all next requests for the same lock despite of they level.
- when new attachments established very often, some of them will be put in queue after EX lock requests and
will wait until current SH owners finish they work (could be long enough if they are read whole allocation table)
and until blocked EX owner finish its work (write 2 or 3 pages in allocation table)

The improvement:
Start to read allocation table not acquiring alloc lock at all and acquire SH lock only when last page of allocation
table is read.
This is safe because allocation table is appended only and already full pages are never modified.
So, we can significantly reduce period of time when SH lock must be hold by new attachments.

Commits: 6a80667 87ee6b8 FirebirdSQL/fbt-repository@cff9a16 FirebirdSQL/fbt-repository@eefc95a

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 16, 2014

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 16, 2014

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 3, 2015

Modified by: @pavel-zotov

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

QA Status: Cannot be tested

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

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

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