* Retrieve queued fsync requests and pass them to local smgr.
*
* This is exported because it must be called during CreateCheckPoint;
- * we have to be sure we have accepted all pending requests *after* we
- * establish the checkpoint REDO pointer. Since CreateCheckPoint
- * sometimes runs in non-bgwriter processes, do nothing if not bgwriter.
+ * we have to be sure we have accepted all pending requests just before
+ * we start fsync'ing. Since CreateCheckPoint sometimes runs in
+ * non-bgwriter processes, do nothing if not bgwriter.
*/
void
AbsorbFsyncRequests(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();