Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
dfcd9cb3
Commit
dfcd9cb3
authored
Jan 01, 2016
by
Noah Misch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover heap_page_prune_opt()'s cleanup lock tactic in README.
Jeff Janes, reviewed by Jim Nasby.
parent
c7e27bec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
src/backend/storage/buffer/README
src/backend/storage/buffer/README
+14
-12
No files found.
src/backend/storage/buffer/README
View file @
dfcd9cb3
...
...
@@ -81,18 +81,20 @@ it won't be able to actually examine the page until it acquires shared
or exclusive content lock.
Rule #5 only affects VACUUM operations. Obtaining the
necessary lock is done by the bufmgr routine LockBufferForCleanup().
It first gets an exclusive lock and then checks to see if the shared pin
count is currently 1. If not, it releases the exclusive lock (but not the
caller's pin) and waits until signaled by another backend, whereupon it
tries again. The signal will occur when UnpinBuffer decrements the shared
pin count to 1. As indicated above, this operation might have to wait a
good while before it acquires lock, but that shouldn't matter much for
concurrent VACUUM. The current implementation only supports a single
waiter for pin-count-1 on any particular shared buffer. This is enough
for VACUUM's use, since we don't allow multiple VACUUMs concurrently on a
single relation anyway.
Obtaining the lock needed under rule #5 is done by the bufmgr routines
LockBufferForCleanup() or ConditionalLockBufferForCleanup(). They first get
an exclusive lock and then check to see if the shared pin count is currently
1. If not, ConditionalLockBufferForCleanup() releases the exclusive lock and
then returns false, while LockBufferForCleanup() releases the exclusive lock
(but not the caller's pin) and waits until signaled by another backend,
whereupon it tries again. The signal will occur when UnpinBuffer decrements
the shared pin count to 1. As indicated above, this operation might have to
wait a good while before it acquires lock, but that shouldn't matter much for
concurrent VACUUM. The current implementation only supports a single waiter
for pin-count-1 on any particular shared buffer. This is enough for VACUUM's
use, since we don't allow multiple VACUUMs concurrently on a single relation
anyway. Anyone wishing to obtain a cleanup lock outside of recovery or a
VACUUM must use the conditional variant of the function.
Buffer Manager's Internal Locking
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment