1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-28 11:55:03 +03:00

Fix incorrect comment about the timing of AbsorbFsyncRequests() during

checkpoint.  The comment claimed that we could do this anytime after
setting the checkpoint REDO point, but actually BufferSync is relying
on the assumption that buffers dumped by other backends will be fsync'd
too.  So we really could not do it any sooner than we are doing it.
This commit is contained in:
Tom Lane
2007-07-03 14:51:24 +00:00
parent a55898131e
commit 83aaebba63
2 changed files with 11 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.128 2007/04/12 17:10:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.129 2007/07/03 14:51:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -880,9 +880,12 @@ mdsync(void)
/*
* If we are in the bgwriter, the sync had better include all fsync
* requests that were queued by backends before the checkpoint REDO
* point was determined. We go that a little better by accepting all
* requests queued up to the point where we start fsync'ing.
* requests that were queued by backends up to this point. The tightest
* race condition that could occur is that a buffer that must be written
* and fsync'd for the checkpoint could have been dumped by a backend
* just before it was visited by BufferSync(). We know the backend will
* have queued an fsync request before clearing the buffer's dirtybit,
* so we are safe as long as we do an Absorb after completing BufferSync().
*/
AbsorbFsyncRequests();