Commit 1b9dea04 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Remove useless 'needlock' argument from GetXLogInsertRecPtr. It was always

passed as 'true'.
parent 9c808f89
...@@ -9411,15 +9411,13 @@ GetStandbyFlushRecPtr(void) ...@@ -9411,15 +9411,13 @@ GetStandbyFlushRecPtr(void)
* Get latest WAL insert pointer * Get latest WAL insert pointer
*/ */
XLogRecPtr XLogRecPtr
GetXLogInsertRecPtr(bool needlock) GetXLogInsertRecPtr(void)
{ {
XLogCtlInsert *Insert = &XLogCtl->Insert; XLogCtlInsert *Insert = &XLogCtl->Insert;
XLogRecPtr current_recptr; XLogRecPtr current_recptr;
if (needlock)
LWLockAcquire(WALInsertLock, LW_SHARED); LWLockAcquire(WALInsertLock, LW_SHARED);
INSERT_RECPTR(current_recptr, Insert, Insert->curridx); INSERT_RECPTR(current_recptr, Insert, Insert->curridx);
if (needlock)
LWLockRelease(WALInsertLock); LWLockRelease(WALInsertLock);
return current_recptr; return current_recptr;
......
...@@ -200,7 +200,7 @@ pg_current_xlog_insert_location(PG_FUNCTION_ARGS) ...@@ -200,7 +200,7 @@ pg_current_xlog_insert_location(PG_FUNCTION_ARGS)
errmsg("recovery is in progress"), errmsg("recovery is in progress"),
errhint("WAL control functions cannot be executed during recovery."))); errhint("WAL control functions cannot be executed during recovery.")));
current_recptr = GetXLogInsertRecPtr(true); current_recptr = GetXLogInsertRecPtr();
snprintf(location, sizeof(location), "%X/%X", snprintf(location, sizeof(location), "%X/%X",
current_recptr.xlogid, current_recptr.xrecoff); current_recptr.xlogid, current_recptr.xrecoff);
......
...@@ -288,7 +288,7 @@ extern bool XLogInsertAllowed(void); ...@@ -288,7 +288,7 @@ extern bool XLogInsertAllowed(void);
extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream); extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream);
extern XLogRecPtr GetXLogReplayRecPtr(XLogRecPtr *restoreLastRecPtr); extern XLogRecPtr GetXLogReplayRecPtr(XLogRecPtr *restoreLastRecPtr);
extern XLogRecPtr GetStandbyFlushRecPtr(void); extern XLogRecPtr GetStandbyFlushRecPtr(void);
extern XLogRecPtr GetXLogInsertRecPtr(bool needlock); extern XLogRecPtr GetXLogInsertRecPtr(void);
extern XLogRecPtr GetXLogWriteRecPtr(void); extern XLogRecPtr GetXLogWriteRecPtr(void);
extern bool RecoveryIsPaused(void); extern bool RecoveryIsPaused(void);
extern void SetRecoveryPause(bool recoveryPause); extern void SetRecoveryPause(bool recoveryPause);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment