From 24eca7977ed208de33791af8890975ffcf086598 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 27 Dec 2012 18:33:03 -0300 Subject: [PATCH] Assign InvalidXLogRecPtr instead of MemSet(0) For consistency. Author: Andres Freund --- src/backend/access/transam/xlog.c | 8 ++++---- src/backend/replication/walsender.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 54df3e6df9..0b1a9c21d5 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6393,8 +6393,8 @@ CheckRecoveryConsistency(void) if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr)) ControlFile->minRecoveryPoint = EndRecPtr; - MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr)); - MemSet(&ControlFile->backupEndPoint, 0, sizeof(XLogRecPtr)); + ControlFile->backupStartPoint = InvalidXLogRecPtr; + ControlFile->backupEndPoint = InvalidXLogRecPtr; ControlFile->backupEndRequired = false; UpdateControlFile(); @@ -7330,7 +7330,7 @@ CreateCheckPoint(int flags) ControlFile->checkPointCopy = checkPoint; ControlFile->time = (pg_time_t) time(NULL); /* crash recovery should always recover to the end of WAL */ - MemSet(&ControlFile->minRecoveryPoint, 0, sizeof(XLogRecPtr)); + ControlFile->minRecoveryPoint = InvalidXLogRecPtr; ControlFile->minRecoveryPointTLI = 0; UpdateControlFile(); LWLockRelease(ControlFileLock); @@ -8161,7 +8161,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record) ControlFile->minRecoveryPoint = lsn; ControlFile->minRecoveryPointTLI = ThisTimeLineID; } - MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr)); + ControlFile->backupStartPoint = InvalidXLogRecPtr; ControlFile->backupEndRequired = false; UpdateControlFile(); diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 74357ace29..df6ad6df7b 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -1115,7 +1115,7 @@ InitWalSenderSlot(void) * Found a free slot. Reserve it for us. */ walsnd->pid = MyProcPid; - MemSet(&walsnd->sentPtr, 0, sizeof(XLogRecPtr)); + walsnd->sentPtr = InvalidXLogRecPtr; walsnd->state = WALSNDSTATE_STARTUP; SpinLockRelease(&walsnd->mutex); /* don't need the lock anymore */