Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS
Date
Msg-id 3392911.1621395985@sss.pgh.pa.us
Whole thread Raw
In response to Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Tue, May 18, 2021 at 07:42:08PM -0400, Tom Lane wrote:
>> This might go away if worker.c weren't so creatively different
>> from the other code paths concerned with executor shutdown.

> The tuple routing has made the whole worker logic messier by a larger
> degree compared to when this stuff was only able to apply DMLs changes
> on the partition leaves.  I know that it is not that great to be more
> creative here, but we need to make sure that AfterTriggerEndQuery() is
> moved before ExecCleanupTupleRouting().  We could either keep the
> ExecCleanupTupleRouting() calls as they are now, and call
> AfterTriggerEndQuery() in more code paths.  Or we could have one
> PartitionTupleRouting and one ModifyTableState created beforehand
> in create_estate_for_relation() if applying the change on a
> partitioned table but that means manipulating more structures across 
> more layers of this code.  Something like the attached fixes the
> problem for me, but honestly it does not help in clarifying this code
> more.

I was wondering if we could move the ExecCleanupTupleRouting call
into finish_estate.  copyfrom.c, for example, does that during
its shutdown function.  Compare also the worker.c changes proposed
in

https://www.postgresql.org/message-id/3362608.1621367104%40sss.pgh.pa.us

which are because I discovered it's unsafe to pop the snapshot
before running AfterTriggerEndQuery.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS
Next
From: Michael Paquier
Date:
Subject: Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS