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

Commit e8f87a9

Browse files
author
Alexander Korotkov
committed
Fix bug in 64bit xids.
Change of page epoch was unlogged when no items on the page.
1 parent 81efcfa commit e8f87a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/backend/access/heap/heapam.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,10 +2869,15 @@ heap_page_prepare_for_xid(Relation relation, Buffer buffer,
28692869
/* No items on the page? */
28702870
if (!found)
28712871
{
2872+
int64 delta;
2873+
28722874
if (!multi)
2873-
pageHdr->pd_xid_epoch = xid - FirstNormalTransactionId;
2875+
delta = (xid - FirstNormalTransactionId) - pageHdr->pd_xid_epoch;
28742876
else
2875-
pageHdr->pd_multi_epoch = xid - FirstNormalTransactionId;
2877+
delta = (xid - FirstNormalTransactionId) - pageHdr->pd_multi_epoch;
2878+
2879+
heap_page_shift_epoch(RelationNeedsWAL(relation) ? buffer : InvalidBuffer,
2880+
page, multi, delta);
28762881
MarkBufferDirty(buffer);
28772882
return false;
28782883
}

0 commit comments

Comments
 (0)