Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a4d357b

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 45639a0 commit a4d357b

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
@@ -8687,6 +8687,8 @@ heap_xlog_lock(XLogReaderState *record)
86878687

86888688
htup = (HeapTupleHeader) PageGetItem(page, lp);
86898689

8690+
htup->t_infomask &= ~(HEAP_XMAX_BITS | HEAP_MOVED);
8691+
htup->t_infomask2 &= ~HEAP_KEYS_UPDATED;
86908692
fix_infomask_from_infobits(xlrec->infobits_set, &htup->t_infomask,
86918693
&htup->t_infomask2);
86928694

@@ -8737,6 +8739,8 @@ heap_xlog_lock_updated(XLogReaderState *record)
87378739

87388740
htup = (HeapTupleHeader) PageGetItem(page, lp);
87398741

8742+
htup->t_infomask &= ~(HEAP_XMAX_BITS | HEAP_MOVED);
8743+
htup->t_infomask2 &= ~HEAP_KEYS_UPDATED;
87408744
fix_infomask_from_infobits(xlrec->infobits_set, &htup->t_infomask,
87418745
&htup->t_infomask2);
87428746
HeapTupleHeaderSetXmax(htup, xlrec->xmax);

0 commit comments

Comments
 (0)