Fix wrong logic in TransactionIdInRecentPast()
Alexander Korotkov <akorotkov@postgresql.org>
Fix wrong logic in TransactionIdInRecentPast() The TransactionIdInRecentPast() should return false for all the transactions older than TransamVariables->oldestClogXid. However, the function contains a bug in comparison FullTransactionId to TransactionID allowing full transactions between nextXid - 2^32 and oldestClogXid - 2^31. This commit fixes TransactionIdInRecentPast() by turning the oldestClogXid into FullTransactionId first, then performing the comparison. Backpatch to all supported versions. Reported-by: Egor Chindyaskin Bug: 18212 Discussion: https://postgr.es/m/18212-547307f8adf57262%40postgresql.org Author: Karina Litskevich Reviewed-by: Kyotaro Horiguchi Backpatch-through: 12
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/xid8funcs.c | modified | +19 −11 |
Discussion
- BUG #18212: Functions txid_status() and pg_xact_status() return invalid status of the specified transaction 10 messages · 2023-11-24 → 2024-03-07