public inbox for [email protected]  
help / color / mirror / Atom feed
pgsql: Fix wrong logic in TransactionIdInRecentPast()
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-08 11:14 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-08 11:14 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/165d921c9a883814a35e8161fc692793e9c945a4

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-09 10:37 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-09 10:37 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e3e05addee42c643867557a3065debb085f1d169

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-09 10:38 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-09 10:38 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/503299b7f728409874adc2f5df9d42857700b046

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-09 10:40 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-09 10:40 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/18388291aab8038b6abb6a9109ab6763e7a5b630

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-09 10:40 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-09 10:40 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4efaf4b09e8f9a9c8b04a6c82454c248de042119

Modified Files
--------------
src/backend/utils/adt/xid8funcs.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix wrong logic in TransactionIdInRecentPast()
@ 2024-02-09 10:55 Alexander Korotkov <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Alexander Korotkov @ 2024-02-09 10:55 UTC (permalink / raw)
  To: [email protected]

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d44060cfcc49d512da1ae9b1b846385748e46d04

Modified Files
--------------
src/backend/utils/adt/txid.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2024-02-09 10:55 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 11:14 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>
2024-02-09 10:37 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>
2024-02-09 10:38 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>
2024-02-09 10:40 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>
2024-02-09 10:40 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>
2024-02-09 10:55 pgsql: Fix wrong logic in TransactionIdInRecentPast() Alexander Korotkov <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox