aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2016-01-12 07:33:20 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2016-01-12 07:33:20 +0000
commit1e29e6324ca7d52eb751c8d63881d1f7c44e3921 (patch)
tree6c69d2f498200a39a60f3d117f8c683c8ee4f393
parent796d1e889f2b5f88b33a425fdfd08d7906cbd66a (diff)
downloadpostgresql-1e29e6324ca7d52eb751c8d63881d1f7c44e3921.tar.gz
postgresql-1e29e6324ca7d52eb751c8d63881d1f7c44e3921.zip
Maintain local LogwrtResult consistently
Teach GetFlushRecPtr() to update LogwrtResult cache as performed by all other functions in xlog.c
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index aa905039f70..7d5d493cdcd 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7862,13 +7862,11 @@ GetInsertRecPtr(void)
XLogRecPtr
GetFlushRecPtr(void)
{
- XLogRecPtr recptr;
-
SpinLockAcquire(&XLogCtl->info_lck);
- recptr = XLogCtl->LogwrtResult.Flush;
+ LogwrtResult = XLogCtl->LogwrtResult;
SpinLockRelease(&XLogCtl->info_lck);
- return recptr;
+ return LogwrtResult.Flush;
}
/*