Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8ff80c1

Browse files
committed
Remove obsolete comment about VACUUM FULL: it takes buffer content locks
now, and must do so to ensure bgwriter doesn't write a page that is in process of being compacted.
1 parent 1758b3e commit 8ff80c1

File tree

1 file changed

+8
-6
lines changed
  • src/backend/storage/buffer

1 file changed

+8
-6
lines changed

src/backend/storage/buffer/README

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$PostgreSQL: pgsql/src/backend/storage/buffer/README,v 1.9 2006/03/31 23:32:06 tgl Exp $
1+
$PostgreSQL: pgsql/src/backend/storage/buffer/README,v 1.10 2006/06/08 14:58:33 tgl Exp $
22

33
Notes about shared buffer access rules
44
--------------------------------------
@@ -78,11 +78,7 @@ it won't be able to actually examine the page until it acquires shared
7878
or exclusive content lock.
7979

8080

81-
VACUUM FULL ignores rule #5, because it instead acquires exclusive lock at
82-
the relation level, which ensures indirectly that no one else is accessing
83-
pages of the relation at all.
84-
85-
Plain (concurrent) VACUUM must respect rule #5 fully. Obtaining the
81+
Rule #5 only affects VACUUM operations. Obtaining the
8682
necessary lock is done by the bufmgr routine LockBufferForCleanup().
8783
It first gets an exclusive lock and then checks to see if the shared pin
8884
count is currently 1. If not, it releases the exclusive lock (but not the
@@ -235,3 +231,9 @@ During a checkpoint, the writer's strategy must be to write every dirty
235231
buffer (pinned or not!). We may as well make it start this scan from
236232
NextVictimBuffer, however, so that the first-to-be-written pages are the
237233
ones that backends might otherwise have to write for themselves soon.
234+
235+
The background writer takes shared content lock on a buffer while writing it
236+
out (and anyone else who flushes buffer contents to disk must do so too).
237+
This ensures that the page image transferred to disk is reasonably consistent.
238+
We might miss a hint-bit update or two but that isn't a problem, for the same
239+
reasons mentioned under buffer access rules.

0 commit comments

Comments
 (0)