diff options
author | Michael Paquier | 2022-08-17 06:28:45 +0000 |
---|---|---|
committer | Michael Paquier | 2022-08-17 06:28:45 +0000 |
commit | d265cd202961c240a2875826ca47822b54f74db5 (patch) | |
tree | 937b9ebbe75479a71e2d49eff33702ab72e14f8f /src | |
parent | 93f2349c36a7555a81d5e26edf9a0213fb3d323a (diff) |
Use SetInstallXLogFileSegmentActive() in more places in xlog.c
This reduces the code paths where XLogCtl->InstallXLogFileSegmentActive
is directly touched, and this wrapper function does the same thing as
the original code replaced by the function call.
Author: Bharath Rupireddy
Reviewed-by: Nathan Bossart
Discussion: https://postgr.es/m/CALj2ACVhkf-bC5CX-=6iBUfkO5GqmBntQH+m=HpY0iQ=-g1pRg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlog.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 9cedd6876f6..87b243e0d4b 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4501,9 +4501,7 @@ BootStrapXLOG(void) pg_crc32c crc; /* allow ordinary WAL segment creation, like StartupXLOG() would */ - LWLockAcquire(ControlFileLock, LW_EXCLUSIVE); - XLogCtl->InstallXLogFileSegmentActive = true; - LWLockRelease(ControlFileLock); + SetInstallXLogFileSegmentActive(); /* * Select a hopefully-unique system identifier code for this installation. @@ -5368,9 +5366,7 @@ StartupXLOG(void) * Allow ordinary WAL segment creation before possibly switching to a new * timeline, which creates a new segment, and after the last ReadRecord(). */ - LWLockAcquire(ControlFileLock, LW_EXCLUSIVE); - XLogCtl->InstallXLogFileSegmentActive = true; - LWLockRelease(ControlFileLock); + SetInstallXLogFileSegmentActive(); /* * Consider whether we need to assign a new timeline ID. |