Derive latestRemovedXid for btree deletes by reading heap pages. The
Simon Riggs <simon@2ndQuadrant.com>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/nbtree/nbtinsert.c | modified | +10 −8 |
| src/backend/access/nbtree/nbtpage.c | modified | +85 −37 |
| src/backend/access/nbtree/nbtree.c | modified | +3 −3 |
| src/backend/access/nbtree/nbtxlog.c | modified | +141 −9 |
| src/include/access/nbtree.h | modified | +13 −12 |
| src/include/access/xlog_internal.h | modified | +2 −2 |