pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix race condition in committing a serializable transaction 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1a43de5e0a591b66ef3d92f3fac5aefcc2dc02fe Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/234f6d09e531b3b5b021ce9574737219a6ac844b Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/22665f2106248793cfd8dd0a49fe3c5f7a4bfdfe Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d97419b851f87c318c2e188afa9c669b5538010e Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/520ec2474b392805ca4d7f29205e245ac70ea0e1 Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8e607a5a4be54f2d2bdfb7a53584d4b7ca1d2be3 Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix race condition in committing a serializable transaction @ 2024-10-21 08:01 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2024-10-21 08:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin advances. But if another backend calls SummarizeOldestCommittedSxact() in that window, it will call SerialAdd() on an XID that's older than the global xmin, or if there are no more transactions running, when global xmin is invalid. That trips the assertion in SerialAdd(). Fixes bug #18658 reported by Andrew Bille. Thanks to Alexander Lakhin for analysis. Backpatch to all versions. Discussion: https://www.postgresql.org/message-id/18658-7dab125ec688c70b%40postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e2ec3afebc238e281df7f3f435c243d9c300046d Modified Files -------------- src/backend/storage/lmgr/predicate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2024-10-21 08:01 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi> 2024-10-21 08:01 pgsql: Fix race condition in committing a serializable transaction Heikki Linnakangas <heikki.linnakangas@iki.fi>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox