diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-02-06 10:27:55 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-02-06 10:27:55 +0900 |
commit | f7400823c3bd6ce03c2fe1bec5b7066bad146809 (patch) | |
tree | e7e3aadd7dec1064ae6463b333b789c5c51a268c /src/backend/access/transam/xlog.c | |
parent | 418611c84d004f45d92bcaa3f8e100385d96cd41 (diff) | |
download | postgresql-f7400823c3bd6ce03c2fe1bec5b7066bad146809.tar.gz postgresql-f7400823c3bd6ce03c2fe1bec5b7066bad146809.zip |
Clarify some comments around SharedRecoveryState in xlog.c
SharedRecoveryState has been switched from a boolean to an enum as of
commit 4e87c48, but some comments still referred to it as a boolean.
Author: Amul Sul
Reviewed-by: Dilip Kumar, Kyotaro Horiguchi
Discussion: https://postgr.es/m/CAAJ_b97Hf+1SXnm8jySpO+Fhm+-VKFAAce1T_cupUYtnE3Nxig
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index f03bd473e2b..8e3b5df7dcb 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7998,17 +7998,16 @@ StartupXLOG(void) * All done with end-of-recovery actions. * * Now allow backends to write WAL and update the control file status in - * consequence. The boolean flag allowing backends to write WAL is - * updated while holding ControlFileLock to prevent other backends to look - * at an inconsistent state of the control file in shared memory. There - * is still a small window during which backends can write WAL and the - * control file is still referring to a system not in DB_IN_PRODUCTION + * consequence. SharedRecoveryState, that controls if backends can write + * WAL, is updated while holding ControlFileLock to prevent other backends + * to look at an inconsistent state of the control file in shared memory. + * There is still a small window during which backends can write WAL and + * the control file is still referring to a system not in DB_IN_PRODUCTION * state while looking at the on-disk control file. * - * Also, although the boolean flag to allow WAL is probably atomic in - * itself, we use the info_lck here to ensure that there are no race - * conditions concerning visibility of other recent updates to shared - * memory. + * Also, we use info_lck to update SharedRecoveryState to ensure that + * there are no race conditions concerning visibility of other recent + * updates to shared memory. */ LWLockAcquire(ControlFileLock, LW_EXCLUSIVE); ControlFile->state = DB_IN_PRODUCTION; |