mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Clean up representation of SLRU page state. This is the cleaner fix
for the SLRU race condition that I posted a few days ago, but we decided not to use in 8.1 and older branches.
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.33 2005/10/15 02:49:09 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.34 2005/11/05 21:19:47 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -107,7 +107,7 @@ TransactionIdSetStatus(TransactionId xid, XidStatus status)
|
||||
byteval |= (status << bshift);
|
||||
*byteptr = byteval;
|
||||
|
||||
ClogCtl->shared->page_status[slotno] = SLRU_PAGE_DIRTY;
|
||||
ClogCtl->shared->page_dirty[slotno] = true;
|
||||
|
||||
LWLockRelease(CLogControlLock);
|
||||
}
|
||||
@ -175,7 +175,7 @@ BootStrapCLOG(void)
|
||||
|
||||
/* Make sure it's written out */
|
||||
SimpleLruWritePage(ClogCtl, slotno, NULL);
|
||||
Assert(ClogCtl->shared->page_status[slotno] == SLRU_PAGE_CLEAN);
|
||||
Assert(!ClogCtl->shared->page_dirty[slotno]);
|
||||
|
||||
LWLockRelease(CLogControlLock);
|
||||
}
|
||||
@ -246,7 +246,7 @@ StartupCLOG(void)
|
||||
/* Zero the rest of the page */
|
||||
MemSet(byteptr + 1, 0, BLCKSZ - byteno - 1);
|
||||
|
||||
ClogCtl->shared->page_status[slotno] = SLRU_PAGE_DIRTY;
|
||||
ClogCtl->shared->page_dirty[slotno] = true;
|
||||
}
|
||||
|
||||
LWLockRelease(CLogControlLock);
|
||||
@ -404,7 +404,7 @@ clog_redo(XLogRecPtr lsn, XLogRecord *record)
|
||||
|
||||
slotno = ZeroCLOGPage(pageno, false);
|
||||
SimpleLruWritePage(ClogCtl, slotno, NULL);
|
||||
Assert(ClogCtl->shared->page_status[slotno] == SLRU_PAGE_CLEAN);
|
||||
Assert(!ClogCtl->shared->page_dirty[slotno]);
|
||||
|
||||
LWLockRelease(CLogControlLock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user