mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Invent WAL timelines, as per recent discussion, to make point-in-time
recovery more manageable. Also, undo recent change to add FILE_HEADER and WASTED_SPACE records to XLOG; instead make the XLOG page header variable-size with extra fields in the first page of an XLOG file. This should fix the boundary-case bugs observed by Mark Kirkwood. initdb forced due to change of XLOG representation.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.112 2004/04/21 18:24:25 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.113 2004/07/21 22:31:19 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -621,11 +621,11 @@ _bt_insertonpg(Relation rel,
|
||||
if (BufferIsValid(metabuf))
|
||||
{
|
||||
PageSetLSN(metapg, recptr);
|
||||
PageSetSUI(metapg, ThisStartUpID);
|
||||
PageSetTLI(metapg, ThisTimeLineID);
|
||||
}
|
||||
|
||||
PageSetLSN(page, recptr);
|
||||
PageSetSUI(page, ThisStartUpID);
|
||||
PageSetTLI(page, ThisTimeLineID);
|
||||
}
|
||||
|
||||
END_CRIT_SECTION();
|
||||
@@ -903,13 +903,13 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
||||
recptr = XLogInsert(RM_BTREE_ID, xlinfo, rdata);
|
||||
|
||||
PageSetLSN(leftpage, recptr);
|
||||
PageSetSUI(leftpage, ThisStartUpID);
|
||||
PageSetTLI(leftpage, ThisTimeLineID);
|
||||
PageSetLSN(rightpage, recptr);
|
||||
PageSetSUI(rightpage, ThisStartUpID);
|
||||
PageSetTLI(rightpage, ThisTimeLineID);
|
||||
if (!P_RIGHTMOST(ropaque))
|
||||
{
|
||||
PageSetLSN(spage, recptr);
|
||||
PageSetSUI(spage, ThisStartUpID);
|
||||
PageSetTLI(spage, ThisTimeLineID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1494,13 +1494,13 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
|
||||
recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_NEWROOT, rdata);
|
||||
|
||||
PageSetLSN(rootpage, recptr);
|
||||
PageSetSUI(rootpage, ThisStartUpID);
|
||||
PageSetTLI(rootpage, ThisTimeLineID);
|
||||
PageSetLSN(metapg, recptr);
|
||||
PageSetSUI(metapg, ThisStartUpID);
|
||||
PageSetTLI(metapg, ThisTimeLineID);
|
||||
PageSetLSN(lpage, recptr);
|
||||
PageSetSUI(lpage, ThisStartUpID);
|
||||
PageSetTLI(lpage, ThisTimeLineID);
|
||||
PageSetLSN(rpage, recptr);
|
||||
PageSetSUI(rpage, ThisStartUpID);
|
||||
PageSetTLI(rpage, ThisTimeLineID);
|
||||
}
|
||||
|
||||
END_CRIT_SECTION();
|
||||
|
||||
Reference in New Issue
Block a user