mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Assign InvalidXLogRecPtr instead of MemSet(0)
For consistency. Author: Andres Freund
This commit is contained in:
parent
eaa1f7220a
commit
24eca7977e
@ -6393,8 +6393,8 @@ CheckRecoveryConsistency(void)
|
|||||||
if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr))
|
if (XLByteLT(ControlFile->minRecoveryPoint, EndRecPtr))
|
||||||
ControlFile->minRecoveryPoint = EndRecPtr;
|
ControlFile->minRecoveryPoint = EndRecPtr;
|
||||||
|
|
||||||
MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
|
ControlFile->backupStartPoint = InvalidXLogRecPtr;
|
||||||
MemSet(&ControlFile->backupEndPoint, 0, sizeof(XLogRecPtr));
|
ControlFile->backupEndPoint = InvalidXLogRecPtr;
|
||||||
ControlFile->backupEndRequired = false;
|
ControlFile->backupEndRequired = false;
|
||||||
UpdateControlFile();
|
UpdateControlFile();
|
||||||
|
|
||||||
@ -7330,7 +7330,7 @@ CreateCheckPoint(int flags)
|
|||||||
ControlFile->checkPointCopy = checkPoint;
|
ControlFile->checkPointCopy = checkPoint;
|
||||||
ControlFile->time = (pg_time_t) time(NULL);
|
ControlFile->time = (pg_time_t) time(NULL);
|
||||||
/* crash recovery should always recover to the end of WAL */
|
/* crash recovery should always recover to the end of WAL */
|
||||||
MemSet(&ControlFile->minRecoveryPoint, 0, sizeof(XLogRecPtr));
|
ControlFile->minRecoveryPoint = InvalidXLogRecPtr;
|
||||||
ControlFile->minRecoveryPointTLI = 0;
|
ControlFile->minRecoveryPointTLI = 0;
|
||||||
UpdateControlFile();
|
UpdateControlFile();
|
||||||
LWLockRelease(ControlFileLock);
|
LWLockRelease(ControlFileLock);
|
||||||
@ -8161,7 +8161,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
|
|||||||
ControlFile->minRecoveryPoint = lsn;
|
ControlFile->minRecoveryPoint = lsn;
|
||||||
ControlFile->minRecoveryPointTLI = ThisTimeLineID;
|
ControlFile->minRecoveryPointTLI = ThisTimeLineID;
|
||||||
}
|
}
|
||||||
MemSet(&ControlFile->backupStartPoint, 0, sizeof(XLogRecPtr));
|
ControlFile->backupStartPoint = InvalidXLogRecPtr;
|
||||||
ControlFile->backupEndRequired = false;
|
ControlFile->backupEndRequired = false;
|
||||||
UpdateControlFile();
|
UpdateControlFile();
|
||||||
|
|
||||||
|
@ -1115,7 +1115,7 @@ InitWalSenderSlot(void)
|
|||||||
* Found a free slot. Reserve it for us.
|
* Found a free slot. Reserve it for us.
|
||||||
*/
|
*/
|
||||||
walsnd->pid = MyProcPid;
|
walsnd->pid = MyProcPid;
|
||||||
MemSet(&walsnd->sentPtr, 0, sizeof(XLogRecPtr));
|
walsnd->sentPtr = InvalidXLogRecPtr;
|
||||||
walsnd->state = WALSNDSTATE_STARTUP;
|
walsnd->state = WALSNDSTATE_STARTUP;
|
||||||
SpinLockRelease(&walsnd->mutex);
|
SpinLockRelease(&walsnd->mutex);
|
||||||
/* don't need the lock anymore */
|
/* don't need the lock anymore */
|
||||||
|
Loading…
Reference in New Issue
Block a user