Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e29e63

Browse files
Maintain local LogwrtResult consistently
Teach GetFlushRecPtr() to update LogwrtResult cache as performed by all other functions in xlog.c
1 parent 796d1e8 commit 1e29e63

File tree

1 file changed

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

1 file changed

+2
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7862,13 +7862,11 @@ GetInsertRecPtr(void)
78627862
XLogRecPtr
78637863
GetFlushRecPtr(void)
78647864
{
7865-
XLogRecPtr recptr;
7866-
78677865
SpinLockAcquire(&XLogCtl->info_lck);
7868-
recptr = XLogCtl->LogwrtResult.Flush;
7866+
LogwrtResult = XLogCtl->LogwrtResult;
78697867
SpinLockRelease(&XLogCtl->info_lck);
78707868

7871-
return recptr;
7869+
return LogwrtResult.Flush;
78727870
}
78737871

78747872
/*

0 commit comments

Comments
 (0)