diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2010-03-28 09:27:02 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2010-03-28 09:27:02 +0000 |
commit | a760893dbda9934e287789d54bbd3c4ca3914ce0 (patch) | |
tree | dc27a0fd902264a9d9a6f882edca421df9ef255f /src/backend/access/nbtree/nbtree.c | |
parent | 59292f28cace8c0d4b038cadbb127b440e3a7815 (diff) | |
download | postgresql-a760893dbda9934e287789d54bbd3c4ca3914ce0.tar.gz postgresql-a760893dbda9934e287789d54bbd3c4ca3914ce0.zip |
Derive latestRemovedXid for btree deletes by reading heap pages. The
WAL record for btree delete contains a list of tids, even when backup
blocks are present. We follow the tids to their heap tuples, taking
care to follow LP_REDIRECT tuples. We ignore LP_DEAD tuples on the
understanding that they will always have xmin/xmax earlier than any
LP_NORMAL tuples referred to by killed index tuples. Iff all tuples
are LP_DEAD we return InvalidTransactionId. The heap relfilenode is
added to the WAL record, requiring API changes to pass down the heap
Relation. XLOG_PAGE_MAGIC updated.
Diffstat (limited to 'src/backend/access/nbtree/nbtree.c')
-rw-r--r-- | src/backend/access/nbtree/nbtree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 01899cfc166..0fcde95ccde 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -12,7 +12,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.176 2010/02/26 02:00:34 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.177 2010/03/28 09:27:01 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -708,7 +708,7 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, buf = ReadBufferExtended(rel, MAIN_FORKNUM, num_pages - 1, RBM_NORMAL, info->strategy); LockBufferForCleanup(buf); - _bt_delitems(rel, buf, NULL, 0, true, vstate.lastBlockVacuumed); + _bt_delitems_vacuum(rel, buf, NULL, 0, vstate.lastBlockVacuumed); _bt_relbuf(rel, buf); } @@ -889,7 +889,7 @@ restart: { BlockNumber lastBlockVacuumed = BufferGetBlockNumber(buf); - _bt_delitems(rel, buf, deletable, ndeletable, true, vstate->lastBlockVacuumed); + _bt_delitems_vacuum(rel, buf, deletable, ndeletable, vstate->lastBlockVacuumed); /* * Keep track of the block number of the lastBlockVacuumed, so we |