diff options
| author | Robert Haas <rhaas@postgresql.org> | 2012-04-26 20:00:21 -0400 |
|---|---|---|
| committer | Robert Haas <rhaas@postgresql.org> | 2012-04-26 20:00:21 -0400 |
| commit | 3424bff90f40532527b9cf4f2ad9eaff750682f7 (patch) | |
| tree | 028c10eea2a93f672d9462ebb4dcef7097d316ca /src/include | |
| parent | 92df2203437603d40417fe711c3cb7066ac4fdf5 (diff) | |
| download | postgresql-3424bff90f40532527b9cf4f2ad9eaff750682f7.tar.gz | |
Prevent index-only scans from returning wrong answers under Hot Standby.
The alternative of disallowing index-only scans in HS operation was
discussed, but the consensus was that it was better to treat marking
a page all-visible as a recovery conflict for snapshots that could still
fail to see XIDs on that page. We may in the future try to soften this,
so that we simply force index scans to do heap fetches in cases where
this may be an issue, rather than throwing a hard conflict.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/heapam.h | 2 | ||||
| -rw-r--r-- | src/include/access/htup.h | 3 | ||||
| -rw-r--r-- | src/include/access/visibilitymap.h | 2 | ||||
| -rw-r--r-- | src/include/access/xlog_internal.h | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 9d5da7fb3a..d554392e5a 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -141,7 +141,7 @@ extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer, TransactionId cutoff_xid, OffsetNumber *offsets, int offcnt); extern XLogRecPtr log_heap_visible(RelFileNode rnode, BlockNumber block, - Buffer vm_buffer); + Buffer vm_buffer, TransactionId cutoff_xid); extern XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum, BlockNumber blk, Page page); diff --git a/src/include/access/htup.h b/src/include/access/htup.h index 6a3778d650..8f65428ac4 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -788,9 +788,10 @@ typedef struct xl_heap_visible { RelFileNode node; BlockNumber block; + TransactionId cutoff_xid; } xl_heap_visible; -#define SizeOfHeapVisible (offsetof(xl_heap_visible, block) + sizeof(BlockNumber)) +#define SizeOfHeapVisible (offsetof(xl_heap_visible, cutoff_xid) + sizeof(TransactionId)) extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple, TransactionId *latestRemovedXid); diff --git a/src/include/access/visibilitymap.h b/src/include/access/visibilitymap.h index 218ccd6104..5774e92e15 100644 --- a/src/include/access/visibilitymap.h +++ b/src/include/access/visibilitymap.h @@ -25,7 +25,7 @@ extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk, Buffer *vmbuf); extern bool visibilitymap_pin_ok(BlockNumber heapBlk, Buffer vmbuf); extern void visibilitymap_set(Relation rel, BlockNumber heapBlk, - XLogRecPtr recptr, Buffer vmbuf); + XLogRecPtr recptr, Buffer vmbuf, TransactionId cutoff_xid); extern bool visibilitymap_test(Relation rel, BlockNumber heapBlk, Buffer *vmbuf); extern BlockNumber visibilitymap_count(Relation rel); extern void visibilitymap_truncate(Relation rel, BlockNumber nheapblocks); diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index c079a9aa8f..2020a3b41f 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -71,7 +71,7 @@ typedef struct XLogContRecord /* * Each page of XLOG file has a header like this: */ -#define XLOG_PAGE_MAGIC 0xD070 /* can be used as WAL version indicator */ +#define XLOG_PAGE_MAGIC 0xD071 /* can be used as WAL version indicator */ typedef struct XLogPageHeaderData { |
