Commit 1632724
committed
amcheck: Fix ordering bug in update_cached_xid_range()
The initialization order in update_cached_xid_range() was wrong, calling
FullTransactionIdFromXidAndCtx() before setting
->next_xid. FullTransactionIdFromXidAndCtx() uses ->next_xid.
In most situations this will not cause visible issues, because the next call
to update_cached_xid_range() will use a less wrong ->next_xid. It's rare that
xids advance fast enough for this to be a problem.
Found while adding more asserts to the 64bit xid infrastructure.
Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://postgr.es/m/20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de
Backpatch: 14-, where heapam verification was introduced1 parent 4e63301 commit 1632724
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
1579 | 1582 | | |
1580 | 1583 | | |
1581 | 1584 | | |
| |||
1597 | 1600 | | |
1598 | 1601 | | |
1599 | 1602 | | |
1600 | | - | |
1601 | 1603 | | |
| 1604 | + | |
1602 | 1605 | | |
1603 | 1606 | | |
1604 | 1607 | | |
| |||
0 commit comments