mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Make the comments more clear on the fact that UpdateFullPageWrites() is not
safe to call concurrently from multiple processes.
This commit is contained in:
@ -8442,6 +8442,9 @@ XLogReportParameters(void)
|
|||||||
/*
|
/*
|
||||||
* Update full_page_writes in shared memory, and write an
|
* Update full_page_writes in shared memory, and write an
|
||||||
* XLOG_FPW_CHANGE record if necessary.
|
* XLOG_FPW_CHANGE record if necessary.
|
||||||
|
*
|
||||||
|
* Note: this function assumes there is no other process running
|
||||||
|
* concurrently that could update it.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
UpdateFullPageWrites(void)
|
UpdateFullPageWrites(void)
|
||||||
@ -8452,8 +8455,8 @@ UpdateFullPageWrites(void)
|
|||||||
* Do nothing if full_page_writes has not been changed.
|
* Do nothing if full_page_writes has not been changed.
|
||||||
*
|
*
|
||||||
* It's safe to check the shared full_page_writes without the lock,
|
* It's safe to check the shared full_page_writes without the lock,
|
||||||
* because we can guarantee that there is no concurrently running
|
* because we assume that there is no concurrently running process
|
||||||
* process which can update it.
|
* which can update it.
|
||||||
*/
|
*/
|
||||||
if (fullPageWrites == Insert->fullPageWrites)
|
if (fullPageWrites == Insert->fullPageWrites)
|
||||||
return;
|
return;
|
||||||
@ -8490,7 +8493,6 @@ UpdateFullPageWrites(void)
|
|||||||
XLogInsert(RM_XLOG_ID, XLOG_FPW_CHANGE, &rdata);
|
XLogInsert(RM_XLOG_ID, XLOG_FPW_CHANGE, &rdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!fullPageWrites)
|
if (!fullPageWrites)
|
||||||
{
|
{
|
||||||
LWLockAcquire(WALInsertLock, LW_EXCLUSIVE);
|
LWLockAcquire(WALInsertLock, LW_EXCLUSIVE);
|
||||||
|
Reference in New Issue
Block a user