pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0dbe240dc0e14448fe82f6b356947d4b5c93f89f

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3ec393a9b8ac9cedff74339d1cff936d20c79381

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

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

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5be5a76cca6a3d8179236b9600aa037ac842459e

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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

* pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A
@ 2026-11-12 22:55 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-12 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix some edge cases with characteristics after COMMIT/ROLLBACK AND CHAIN

Certain combinations of transaction sequences with AND CHAIN failed to
preserve the top-transaction characteristics, in some cases:
* When a transaction block failed, the chained transaction used the
default characteristics, not the characteristics of the transaction
chaining from.
* When COMMIT AND CHAIN was issued in a subtransaction that had the idea
to switch read_only, the chained transaction inherited the read-only
state of the subtransaction, not of the top transaction.  The state is
reset when the subtransaction ends, like RELEASE.  The characteristics
are now saved once all the subtransactions are committed.

Narek has reported the first problem.  I have discovered the second
pattern while digging through this area of the code.  Tests are added
for all the patterns spotted.

Author: Narek Galstyan <narek.galstyan@enterprisedb.com>
Author: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAHsn6_z-ewqXWe2h--SK93AdnPSOvjvF9KLodWckFZKAjxcONw@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/78d0dd090ae6e944a569b79afb27971b49406eb3

Modified Files
--------------
src/backend/access/transam/xact.c          | 18 +++++++
src/test/regress/expected/transactions.out | 76 ++++++++++++++++++++++++++++++
src/test/regress/sql/transactions.sql      | 34 +++++++++++++
3 files changed, 128 insertions(+)



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


end of thread, other threads:[~2026-11-12 22:55 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>
2026-11-12 22:55 pgsql: Fix some edge cases with characteristics after COMMIT/ROLLBACK A Michael Paquier <michael@paquier.xyz>

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