Make the comments more clear on the fact that UpdateFullPageWrites() is not
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 6 Mar 2012 08:44:51 +0000 (10:44 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 6 Mar 2012 08:45:58 +0000 (10:45 +0200)
safe to call concurrently from multiple processes.

src/backend/access/transam/xlog.c

index 49d4b36652653badad0b428474128b9bce250d64..c23cf635395ee9100c9c9f9766e3b49851cd459e 100644 (file)
@@ -8442,6 +8442,9 @@ XLogReportParameters(void)
 /*
  * Update full_page_writes in shared memory, and write an
  * XLOG_FPW_CHANGE record if necessary.
+ *
+ * Note: this function assumes there is no other process running
+ * concurrently that could update it.
  */
 void
 UpdateFullPageWrites(void)
@@ -8452,8 +8455,8 @@ UpdateFullPageWrites(void)
     * Do nothing if full_page_writes has not been changed.
     *
     * It's safe to check the shared full_page_writes without the lock,
-    * because we can guarantee that there is no concurrently running
-    * process which can update it.
+    * because we assume that there is no concurrently running process
+    * which can update it.
     */
    if (fullPageWrites == Insert->fullPageWrites)
        return;
@@ -8490,7 +8493,6 @@ UpdateFullPageWrites(void)
        XLogInsert(RM_XLOG_ID, XLOG_FPW_CHANGE, &rdata);
    }
 
-
    if (!fullPageWrites)
    {
        LWLockAcquire(WALInsertLock, LW_EXCLUSIVE);