8000 Make HEAP_LOCK/HEAP2_LOCK_UPDATED replay reset HEAP_XMAX_INVALID. · rtpg/postgres@f66828b · GitHub
[go: up one dir, main page]

Skip to content

Commit f66828b

Browse files
committed
Make HEAP_LOCK/HEAP2_LOCK_UPDATED replay reset HEAP_XMAX_INVALID.
0ac5ad5 started to compress infomask bits in WAL records. Unfortunately the replay routines for XLOG_HEAP_LOCK/XLOG_HEAP2_LOCK_UPDATED forgot to reset the HEAP_XMAX_INVALID (and some other) hint bits. Luckily that's not problematic in the majority of cases, because after a crash/on a standby row locks aren't meaningful. Unfortunately that does not hold true in the presence of prepared transactions. This means that after a crash, or after promotion, row level locks held by a prepared, but not yet committed, prepared transaction might not be enforced. Discussion: 20160715192319.ubfuzim4zv3rqnxv@alap3.anarazel.de Backpatch: 9.3, the oldest branch on which 0ac5ad5 is present.
1 parent 166873d commit f66828b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8381,6 +8381,8 @@ heap_xlog_lock(XLogRecPtr lsn, XLogRecord *record)
83818381

83828382
htup = (HeapTupleHeader) PageGetItem(page, lp);
83838383

8384+
htup->t_infomask &= ~(HEAP_XMAX_BITS | HEAP_MOVED);
8385+
htup->t_infomask2 &= ~HEAP_KEYS_UPDATED;
83848386
fix_infomask_from_infobits(xlrec->infobits_set, &htup->t_infomask,
83858387
&htup->t_infomask2);
83868388

@@ -8441,6 +8443,8 @@ heap_xlog_lock_updated(XLogRecPtr lsn, XLogRecord *record)
84418443

84428444
htup = (HeapTupleHeader) PageGetItem(page, lp);
84438445

8446+
htup->t_infomask &= ~(HEAP_XMAX_BITS | HEAP_MOVED);
8447+
htup->t_infomask2 &= ~HEAP_KEYS_UPDATED;
84448448
fix_infomask_from_infobits(xlrec->infobits_set, &htup->t_infomask,
84458449
&htup->t_infomask2);
84468450
HeapTupleHeaderSetXmax(htup, xlrec->xmax);

0 commit comments

Comments
 (0)
0