Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d265cd2

Browse files
committed
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
1 parent 93f2349 commit d265cd2

File tree

1 file changed

+2
-6
lines changed
  • src/backend/access/transam

1 file changed

+2
-6
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,9 +4501,7 @@ BootStrapXLOG(void)
45014501
pg_crc32c crc;
45024502

45034503
/* allow ordinary WAL segment creation, like StartupXLOG() would */
4504-
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
4505-
XLogCtl->InstallXLogFileSegmentActive = true;
4506-
LWLockRelease(ControlFileLock);
4504+
SetInstallXLogFileSegmentActive();
45074505

45084506
/*
45094507
* Select a hopefully-unique system identifier code for this installation.
@@ -5368,9 +5366,7 @@ StartupXLOG(void)
53685366
* Allow ordinary WAL segment creation before possibly switching to a new
53695367
* timeline, which creates a new segment, and after the last ReadRecord().
53705368
*/
5371-
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
5372-
XLogCtl->InstallXLogFileSegmentActive = true;
5373-
LWLockRelease(ControlFileLock);
5369+
SetInstallXLogFileSegmentActive();
53745370

53755371
/*
53765372
* Consider whether we need to assign a new timeline ID.

0 commit comments

Comments
 (0)