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

Commit 0adaea8

Browse files
author
Alexander Korotkov
committed
Detailed report on calculation error in heap_page_prepare_for_xid().
1 parent 49b1e98 commit 0adaea8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/backend/access/heap/heapam.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,21 @@ heap_page_prepare_for_xid(Relation relation, Buffer buffer,
29302930
{
29312931
int64 delta = - (freeDelta + requiredDelta) / 2;
29322932

2933+
if (xid < base + delta + FirstNormalTransactionId ||
2934+
xid > base + delta + MaxShortTransactionId)
2935+
{
2936+
elog(FATAL, "Fatal xid base calculation error: "
2937+
"xid = " XID_FMT ", "
2938+
"base = " XID_FMT ", "
2939+
"min = %u, "
2940+
"max = %u, "
2941+
"freeDelta = " INT64_FORMAT ", "
2942+
"requiredDelta = " INT64_FORMAT ", "
2943+
"delta = " INT64_FORMAT,
2944+
xid, base, min, max, freeDelta, requiredDelta, delta
2945+
);
2946+
}
2947+
29332948
Assert(xid >= base + delta + FirstNormalTransactionId);
29342949
Assert(xid <= base + delta + MaxShortTransactionId);
29352950

0 commit comments

Comments
 (0)