Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
dfcd9cb3
Commit
dfcd9cb3
authored
9 years ago
by
Noah Misch
Browse files
Options
Downloads
Patches
Plain Diff
Cover heap_page_prune_opt()'s cleanup lock tactic in README.
Jeff Janes, reviewed by Jim Nasby.
parent
c7e27bec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/storage/buffer/README
+14
-12
14 additions, 12 deletions
src/backend/storage/buffer/README
with
14 additions
and
12 deletions
src/backend/storage/buffer/README
+
14
−
12
View file @
dfcd9cb3
...
@@ -81,18 +81,20 @@ it won't be able to actually examine the page until it acquires shared
...
@@ -81,18 +81,20 @@ it won't be able to actually examine the page until it acquires shared
or exclusive content lock.
or exclusive content lock.
Rule #5 only affects VACUUM operations. Obtaining the
Obtaining the lock needed under rule #5 is done by the bufmgr routines
necessary lock is done by the bufmgr routine LockBufferForCleanup().
LockBufferForCleanup() or ConditionalLockBufferForCleanup(). They first get
It first gets an exclusive lock and then checks to see if the shared pin
an exclusive lock and then check to see if the shared pin count is currently
count is currently 1. If not, it releases the exclusive lock (but not the
1. If not, ConditionalLockBufferForCleanup() releases the exclusive lock and
caller's pin) and waits until signaled by another backend, whereupon it
then returns false, while LockBufferForCleanup() releases the exclusive lock
tries again. The signal will occur when UnpinBuffer decrements the shared
(but not the caller's pin) and waits until signaled by another backend,
pin count to 1. As indicated above, this operation might have to wait a
whereupon it tries again. The signal will occur when UnpinBuffer decrements
good while before it acquires lock, but that shouldn't matter much for
the shared pin count to 1. As indicated above, this operation might have to
concurrent VACUUM. The current implementation only supports a single
wait a good while before it acquires lock, but that shouldn't matter much for
waiter for pin-count-1 on any particular shared buffer. This is enough
concurrent VACUUM. The current implementation only supports a single waiter
for VACUUM's use, since we don't allow multiple VACUUMs concurrently on a
for pin-count-1 on any particular shared buffer. This is enough for VACUUM's
single relation anyway.
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
Buffer Manager's Internal Locking
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment