diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-03-06 10:44:51 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-03-06 10:45:58 +0200 |
commit | e587e2e3e39ec54772905b8e0ac7155a03253934 (patch) | |
tree | 101919c03dd68add4879f762cb33a990f2c54288 /src | |
parent | 7714c6382941383514c0f1954ca831686ac4fcd2 (diff) | |
download | postgresql-e587e2e3e39ec54772905b8e0ac7155a03253934.tar.gz postgresql-e587e2e3e39ec54772905b8e0ac7155a03253934.zip |
Make the comments more clear on the fact that UpdateFullPageWrites() is not
safe to call concurrently from multiple processes.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlog.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 49d4b366526..c23cf635395 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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); |