BUG #18118: bug report for COMMIT AND CHAIN feature
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: evan.lx@alibaba-inc.com
Date: 2023-09-20T09:31:41Z
Lists: pgsql-bugs
The following bug has been logged on the website: Bug reference: 18118 Logged by: Liu Xiang Email address: evan.lx@alibaba-inc.com PostgreSQL version: 14.9 Operating system: centos7 Description: COMMIT(280a408b48d5ee42969f981bceb9e9426c3a344c) provides a way to support chained commits. During recent development, I found that it left a flaw. The defect can be reproduced as follows: START TRANSACTION ISOLATION LEVEL SERIALIZABLE; COMMIT; START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; savepoint s\; COMMIT AND CHAIN; SHOW transaction_isolation; -- transaction is active at this point COMMIT; will get: postgres=*# SHOW transaction_isolation; -- transaction is active at this point transaction_isolation ----------------------- serializable (1 row) The reason for this bug is that in the case of CommitTransactionCommand->TBLOCK_SUBCOMMIT, if there is a sub-transaction, only RestoreTransactionCharacteristics will be performed instead of SaveTransactionCharacteristics; this results in a global variable save_XactIsoLevel remaining from the previous transaction being restored in the transaction. Thank you to the community for your continued help
Commits
-
Fix COMMIT/ROLLBACK AND CHAIN in the presence of subtransactions.
- 7cabb20a95ae 12.17 landed
- 77dc81602789 15.5 landed
- 555a8d9d37a2 13.13 landed
- 10323f140fef 14.10 landed
- 48e2b234f822 17.0 landed
- 227c7cf15602 16.1 landed
-
Don't use static storage for SaveTransactionCharacteristics().
- 12d768e70497 15.0 cited
-
Transaction chaining
- 280a408b48d5 12.0 cited