Skip to content

Commit e587e2e

Browse files
committed
Make the comments more clear on the fact that UpdateFullPageWrites() is not
safe to call concurrently from multiple processes.
1 parent 7714c63 commit e587e2e

File tree

1 file changed

+5
-3
lines changed
  • src/backend/access/transam

1 file changed

+5
-3
lines changed

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8442,6 +8442,9 @@ XLogReportParameters(void)
84428442
/*
84438443
* Update full_page_writes in shared memory, and write an
84448444
* XLOG_FPW_CHANGE record if necessary.
8445+
*
8446+
* Note: this function assumes there is no other process running
8447+
* concurrently that could update it.
84458448
*/
84468449
void
84478450
UpdateFullPageWrites(void)
@@ -8452,8 +8455,8 @@ UpdateFullPageWrites(void)
84528455
* Do nothing if full_page_writes has not been changed.
84538456
*
84548457
* It's safe to check the shared full_page_writes without the lock,
8455-
* because we can guarantee that there is no concurrently running
8456-
* process which can update it.
8458+
* because we assume that there is no concurrently running process
8459+
* which can update it.
84578460
*/
84588461
if (fullPageWrites == Insert->fullPageWrites)
84598462
return;
@@ -8490,7 +8493,6 @@ UpdateFullPageWrites(void)
84908493
XLogInsert(RM_XLOG_ID, XLOG_FPW_CHANGE, &rdata);
84918494
}
84928495

8493-
84948496
if (!fullPageWrites)
84958497
{
84968498
LWLockAcquire(WALInsertLock, LW_EXCLUSIVE);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy