1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +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:
Tom Lane
2004-07-21 22:31:26 +00:00
parent 8d3517dc1f
commit 2042b3428d
26 changed files with 1322 additions and 982 deletions

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.76 2004/06/02 17:28:17 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.77 2004/07/21 22:31:20 tgl Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
@@ -84,7 +84,7 @@ _bt_metapinit(Relation rel)
rdata);
PageSetLSN(pg, recptr);
PageSetSUI(pg, ThisStartUpID);
PageSetTLI(pg, ThisTimeLineID);
}
END_CRIT_SECTION();
@@ -249,9 +249,9 @@ _bt_getroot(Relation rel, int access)
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);
}
END_CRIT_SECTION();
@@ -686,7 +686,7 @@ _bt_delitems(Relation rel, Buffer buf,
recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_DELETE, rdata);
PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID);
PageSetTLI(page, ThisTimeLineID);
}
END_CRIT_SECTION();
@@ -1080,22 +1080,22 @@ _bt_pagedel(Relation rel, Buffer buf, bool vacuum_full)
if (BufferIsValid(metabuf))
{
PageSetLSN(metapg, recptr);
PageSetSUI(metapg, ThisStartUpID);
PageSetTLI(metapg, ThisTimeLineID);
}
page = BufferGetPage(pbuf);
PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID);
PageSetTLI(page, ThisTimeLineID);
page = BufferGetPage(rbuf);
PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID);
PageSetTLI(page, ThisTimeLineID);
page = BufferGetPage(buf);
PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID);
PageSetTLI(page, ThisTimeLineID);
if (BufferIsValid(lbuf))
{
page = BufferGetPage(lbuf);
PageSetLSN(page, recptr);
PageSetSUI(page, ThisStartUpID);
PageSetTLI(page, ThisTimeLineID);
}
}