Skip to content

Commit 24eca79

Browse files
committed
Assign InvalidXLogRecPtr instead of MemSet(0)
For consistency. Author: Andres Freund
1 parent eaa1f72 commit 24eca79

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6393,8 +6393,8 @@ CheckRecoveryConsistency(void)
63936393
if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr))
63946394
ControlFile->minRecoveryPoint = EndRecPtr;
63956395

6396-
MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
6397-
MemSet(&ControlFile->backupEndPoint, 0, sizeof(XLogRecPtr));
6396+
ControlFile->backupStartPoint = InvalidXLogRecPtr;
6397+
ControlFile->backupEndPoint = InvalidXLogRecPtr;
63986398
ControlFile->backupEndRequired = false;
63996399
UpdateControlFile();
64006400

@@ -7330,7 +7330,7 @@ CreateCheckPoint(int flags)
73307330
ControlFile->checkPointCopy = checkPoint;
73317331
ControlFile->time = (pg_time_t) time(NULL);
73327332
/* crash recovery should always recover to the end of WAL */
7333-
MemSet(&ControlFile->minRecoveryPoint, 0, sizeof(XLogRecPtr));
7333+
ControlFile->minRecoveryPoint = InvalidXLogRecPtr;
73347334
ControlFile->minRecoveryPointTLI = 0;
73357335
UpdateControlFile();
73367336
LWLockRelease(ControlFileLock);
@@ -8161,7 +8161,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
81618161
ControlFile->minRecoveryPoint = lsn;
81628162
ControlFile->minRecoveryPointTLI = ThisTimeLineID;
81638163
}
8164-
MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
8164+
ControlFile->backupStartPoint = InvalidXLogRecPtr;
81658165
ControlFile->backupEndRequired = false;
81668166
UpdateControlFile();
81678167

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ InitWalSenderSlot(void)
11151115
* Found a free slot. Reserve it for us.
11161116
*/
11171117
walsnd->pid = MyProcPid;
1118-
MemSet(&walsnd->sentPtr, 0, sizeof(XLogRecPtr));
1118+
walsnd->sentPtr = InvalidXLogRecPtr;
11191119
walsnd->state = WALSNDSTATE_STARTUP;
11201120
SpinLockRelease(&walsnd->mutex);
11211121
/* don't need the lock anymore */

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