summaryrefslogtreecommitdiff
path: root/src/include/access/heapam_xlog.h
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-11-17 14:55:08 -0800
committerPeter Geoghegan <pg@bowt.ie>2022-11-17 14:55:08 -0800
commit1489b1ce728248e04da72aa32f87e9a634ebf9b8 (patch)
tree4a95eb7c2ffc0424f8805056c36b3493019313be /src/include/access/heapam_xlog.h
parent6ff5aa129933fbde034c0d21c28cf05e052511f9 (diff)
Standardize rmgrdesc recovery conflict XID output.
Standardize on the name snapshotConflictHorizon for all XID fields from WAL records that generate recovery conflicts when in hot standby mode. This supersedes the previous latestRemovedXid naming convention. The new naming convention places emphasis on how the values are actually used by REDO routines. How the values are generated during original execution (details of which vary by record type) is deemphasized. Users of tools like pg_waldump can now grep for snapshotConflictHorizon to see all potential sources of recovery conflicts in a standardized way, without necessarily having to consider which specific record types might be involved. Also bring a couple of WAL record types that didn't follow any kind of naming convention into line. These are heapam's VISIBLE record type and SP-GiST's VACUUM_REDIRECT record type. Now every WAL record whose REDO routine calls ResolveRecoveryConflictWithSnapshot() passes through the snapshotConflictHorizon field from its WAL record. This is follow-up work to the refactoring from commit 9e540599 that made FREEZE_PAGE WAL records use a standard snapshotConflictHorizon style XID cutoff. No bump in XLOG_PAGE_MAGIC, since the underlying format of affected WAL records doesn't change. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAH2-Wzm2CQUmViUq7Opgk=McVREHSOorYaAjR1ZpLYkRN7_dPw@mail.gmail.com
Diffstat (limited to 'src/include/access/heapam_xlog.h')
-rw-r--r--src/include/access/heapam_xlog.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h
index bbf164719e1..5c77290eecf 100644
--- a/src/include/access/heapam_xlog.h
+++ b/src/include/access/heapam_xlog.h
@@ -242,7 +242,7 @@ typedef struct xl_heap_update
*/
typedef struct xl_heap_prune
{
- TransactionId latestRemovedXid;
+ TransactionId snapshotConflictHorizon;
uint16 nredirected;
uint16 ndead;
/* OFFSET NUMBERS are in the block reference 0 */
@@ -342,7 +342,7 @@ typedef struct xl_heap_freeze_plan
*/
typedef struct xl_heap_freeze_page
{
- TransactionId latestRemovedXid;
+ TransactionId snapshotConflictHorizon;
uint16 nplans;
/* FREEZE PLANS FOLLOW */
@@ -359,7 +359,7 @@ typedef struct xl_heap_freeze_page
*/
typedef struct xl_heap_visible
{
- TransactionId cutoff_xid;
+ TransactionId snapshotConflictHorizon;
uint8 flags;
} xl_heap_visible;
@@ -396,8 +396,8 @@ typedef struct xl_heap_rewrite_mapping
XLogRecPtr start_lsn; /* Insert LSN at begin of rewrite */
} xl_heap_rewrite_mapping;
-extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
- TransactionId *latestRemovedXid);
+extern void HeapTupleHeaderAdvanceConflictHorizon(HeapTupleHeader tuple,
+ TransactionId *snapshotConflictHorizon);
extern void heap_redo(XLogReaderState *record);
extern void heap_desc(StringInfo buf, XLogReaderState *record);
@@ -409,6 +409,8 @@ extern const char *heap2_identify(uint8 info);
extern void heap_xlog_logical_rewrite(XLogReaderState *r);
extern XLogRecPtr log_heap_visible(RelFileLocator rlocator, Buffer heap_buffer,
- Buffer vm_buffer, TransactionId cutoff_xid, uint8 vmflags);
+ Buffer vm_buffer,
+ TransactionId snapshotConflictHorizon,
+ uint8 vmflags);
#endif /* HEAPAM_XLOG_H */