1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Remove PageSetTLI and rename pd_tli to pd_checksum

Remove use of PageSetTLI() from all page manipulation functions
and adjust README to indicate change in the way we make changes
to pages. Repurpose those bytes into the pd_checksum field and
explain how that works in comments about page header.

Refactoring ahead of actual feature patch which would make use
of the checksum field, arriving later.

Jeff Davis, with comments and doc changes by Simon Riggs
Direction suggested by Robert Haas; many others providing
review comments.
This commit is contained in:
Simon Riggs
2013-03-18 13:46:42 +00:00
parent 4c855750fc
commit bb7cc2623f
30 changed files with 30 additions and 181 deletions

View File

@@ -439,13 +439,14 @@ critical section.)
happen before the WAL record is inserted; see notes in SyncOneBuffer().)
5. If the relation requires WAL-logging, build a WAL log record and pass it
to XLogInsert(); then update the page's LSN and TLI using the returned XLOG
to XLogInsert(); then update the page's LSN using the returned XLOG
location. For instance,
recptr = XLogInsert(rmgr_id, info, rdata);
PageSetLSN(dp, recptr);
PageSetTLI(dp, ThisTimeLineID);
// Note that we no longer do PageSetTLI() from 9.3 onwards
// since that field on a page has now changed its meaning.
6. END_CRIT_SECTION()
@@ -489,7 +490,6 @@ standard replay-routine pattern for this case is
... initialize the page ...
PageSetLSN(page, lsn);
PageSetTLI(page, ThisTimeLineID);
MarkBufferDirty(buffer);
UnlockReleaseBuffer(buffer);
@@ -523,7 +523,6 @@ The standard replay-routine pattern for this case is
... apply the change ...
PageSetLSN(page, lsn);
PageSetTLI(page, ThisTimeLineID);
MarkBufferDirty(buffer);
UnlockReleaseBuffer(buffer);

View File

@@ -3188,7 +3188,6 @@ RestoreBackupBlock(XLogRecPtr lsn, XLogRecord *record, int block_index,
}
PageSetLSN(page, lsn);
PageSetTLI(page, ThisTimeLineID);
MarkBufferDirty(buffer);
if (!keep_buffer)