BUG #18118: bug report for COMMIT AND CHAIN feature

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: evan(dot)lx(at)alibaba-inc(dot)com
Subject: BUG #18118: bug report for COMMIT AND CHAIN feature
Date: 2023-09-20 09:31:41
Message-ID: 18118-4b72fcbb903aace6@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18118
Logged by: Liu Xiang
Email address: evan(dot)lx(at)alibaba-inc(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-09-20 13:12:52 BUG #18119: Failed assert while recoverying from pg_basebackup
Previous Message PG Bug reporting form 2023-09-20 09:08:31 BUG #18117: View definitions were changed in version 16 (missing column qualifiers)