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

From Amit Langote
Subject Re: Subscription tests fail under CLOBBER_CACHE_ALWAYS
Date
Msg-id CA+HiwqEW7kVF+VKdHT7TnzQGab9-dP9tLyedVvs5nQ7yJ_BP6g@mail.gmail.com
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
On Wed, May 19, 2021 at 2:05 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, May 19, 2021 at 10:26:28AM +0530, Amit Kapila wrote:
> > How about moving AfterTriggerEndQuery() to apply_handle_*_internal
> > calls? That way, we might not even need to change Push/Pop calls.
>
> Isn't that going to be a problem when a tuple is moved to a new
> partition in the tuple routing?  This does a DELETE followed by an
> INSERT, but the operation is an UPDATE.

That indeed doesn't work.  Once AfterTriggerEndQuery() would get
called for DELETE from apply_handle_delete_internal(), after triggers
of the subsequent INSERT can't be processed, instead causing:

ERROR:  AfterTriggerSaveEvent() called outside of query

IOW, the patch you posted earlier seems like the way to go.

-- 
Amit Langote
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.
Next
From: vignesh C
Date:
Subject: Re: subscriptioncheck failure