Re: test_decoding assertion failure for the loss of top-sub transaction relationship
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
Date: 2022-09-02T05:29:56Z
Lists: pgsql-hackers
On Fri, Sep 2, 2022 at 6:38 AM kuroda.hayato@fujitsu.com
<kuroda.hayato@fujitsu.com> wrote:
>
> Hi Hackers,
>
> > Therefore, this leads to the failure for the assert that can check
> > the consistency that when one sub transaction modifies the catalog,
> > its top transaction should be marked so as well.
> >
> > I feel we need to remember the relationship between top transaction and sub
> > transaction
> > in the serialized snapshot even before changing catalog at decoding
> > RUNNING_XACT,
> > so that we can keep track of the association after the restart. What do you think ?
>
> PSA patch that fixes the failure.
> This adds pairs of sub-top transactions to the SnapBuild, and it will be serialized and restored.
> The pair will be checked when we mark the ReorderBufferTXN as RBTXN_HAS_CATALOG_CHANGES.
It seems that SnapBuildCommitTxn() is already taking care of adding
the top transaction to the committed transaction if any subtransaction
has the catalog changes, it has just missed setting the flag so I
think just setting the flag like this should be sufficient no?
diff --git a/src/backend/replication/logical/snapbuild.c
b/src/backend/replication/logical/snapbuild.c
index 1ff2c12..ee3f695 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1086,6 +1086,7 @@ SnapBuildCommitTxn(SnapBuild *builder,
XLogRecPtr lsn, TransactionId xid,
else if (sub_needs_timetravel)
{
/* track toplevel txn as well, subxact alone isn't meaningful */
+ needs_timetravel = true;
SnapBuildAddCommittedTxn(builder, xid);
}
else if (needs_timetravel)
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix executing invalidation messages generated by subtransactions during decoding.
- 343afa967106 15.1 landed
- 4fbe6096b954 14.6 landed
- 38dbaaf27387 13.9 landed
- 02600886c8a8 12.13 landed
- 216af69aec0d 11.18 landed
-
Fix assertion failures while processing NEW_CID record in logical decoding.
- 64ff0fe4e8c4 15.1 landed
- a592ed923e67 14.6 landed
- 25f7be1ca236 13.9 landed
- 1bf4d92060ee 12.13 landed
- 5f7076cb609e 11.18 landed
- 10ed7b9e4b19 10.23 landed
- 16b1fe0037dc 16.0 landed