mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Fix timing of Startup CLOG and MultiXact during Hot Standby
Patch by me, bug report by Chris Redekop, analysis by Florian Pflug
This commit is contained in:
@ -489,6 +489,25 @@ StartupCLOG(void)
|
||||
*/
|
||||
ClogCtl->shared->latest_page_number = pageno;
|
||||
|
||||
LWLockRelease(CLogControlLock);
|
||||
}
|
||||
|
||||
/*
|
||||
* This must be called ONCE at the end of startup/recovery.
|
||||
*/
|
||||
void
|
||||
TrimCLOG(void)
|
||||
{
|
||||
TransactionId xid = ShmemVariableCache->nextXid;
|
||||
int pageno = TransactionIdToPage(xid);
|
||||
|
||||
LWLockAcquire(CLogControlLock, LW_EXCLUSIVE);
|
||||
|
||||
/*
|
||||
* Re-Initialize our idea of the latest page number.
|
||||
*/
|
||||
ClogCtl->shared->latest_page_number = pageno;
|
||||
|
||||
/*
|
||||
* Zero out the remainder of the current clog page. Under normal
|
||||
* circumstances it should be zeroes already, but it seems at least
|
||||
|
Reference in New Issue
Block a user