Skip to content

Commit 1b9dea0

Browse files
committed
Remove useless 'needlock' argument from GetXLogInsertRecPtr. It was always
passed as 'true'.
1 parent 9c808f8 commit 1b9dea0

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9411,16 +9411,14 @@ GetStandbyFlushRecPtr(void)
94119411
* Get latest WAL insert pointer
94129412
*/
94139413
XLogRecPtr
9414-
GetXLogInsertRecPtr(bool needlock)
9414+
GetXLogInsertRecPtr(void)
94159415
{
94169416
XLogCtlInsert *Insert = &XLogCtl->Insert;
94179417
XLogRecPtr current_recptr;
94189418

9419-
if (needlock)
9420-
LWLockAcquire(WALInsertLock, LW_SHARED);
9419+
LWLockAcquire(WALInsertLock, LW_SHARED);
94219420
INSERT_RECPTR(current_recptr, Insert, Insert->curridx);
9422-
if (needlock)
9423-
LWLockRelease(WALInsertLock);
9421+
LWLockRelease(WALInsertLock);
94249422

94259423
return current_recptr;
94269424
}

src/backend/access/transam/xlogfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pg_current_xlog_insert_location(PG_FUNCTION_ARGS)
200200
errmsg("recovery is in progress"),
201201
errhint("WAL control functions cannot be executed during recovery.")));
202202

203-
current_recptr = GetXLogInsertRecPtr(true);
203+
current_recptr = GetXLogInsertRecPtr();
204204

205205
snprintf(location, sizeof(location), "%X/%X",
206206
current_recptr.xlogid, current_recptr.xrecoff);

src/include/access/xlog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ extern bool XLogInsertAllowed(void);
288288
extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream);
289289
extern XLogRecPtr GetXLogReplayRecPtr(XLogRecPtr *restoreLastRecPtr);
290290
extern XLogRecPtr GetStandbyFlushRecPtr(void);
291-
extern XLogRecPtr GetXLogInsertRecPtr(bool needlock);
291+
extern XLogRecPtr GetXLogInsertRecPtr(void);
292292
extern XLogRecPtr GetXLogWriteRecPtr(void);
293293
extern bool RecoveryIsPaused(void);
294294
extern void SetRecoveryPause(bool recoveryPause);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy