Re: [PG19] Sequence sync stops when the subscription owner can't SET ROLE to a sequence owner

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Zhijie Hou <houzhijie22(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, vignesh C <vignesh21(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Subject: Re: [PG19] Sequence sync stops when the subscription owner can't SET ROLE to a sequence owner
Date: 2026-10-21 08:07:28
Message-ID: CAA4eK1+UDxoQXs33yu_VL4RGc1qwU+M1twZ5oNMsxZaZbp-PJQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 21, 2026 at 11:59 AM Zsolt Parragi
<zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> Sorry for not being active in the thread, I am at pgconf.eu this week
>
> +# cannot SET ROLE to. With run_as_owner = false (the default), synchronizing
> +# regress_s4 will fail when switching to its owner.
> ...
> + ALTER SEQUENCE regress_s1 OWNER TO regress_seq_sub_owner;
> + ALTER SEQUENCE regress_s3 OWNER TO regress_seq_sub_owner;
> + ALTER SEQUENCE "regress'quote" OWNER TO regress_seq_sub_owner;
> + ALTER SEQUENCE regress_s4 OWNER TO regress_seq_other;
> + ALTER SUBSCRIPTION regress_seq_sub OWNER TO regress_seq_sub_owner;
> + ALTER SUBSCRIPTION regress_seq_sub ENABLE;
>
> I see that the current consensus seems to be that we do not fix the
> stall, only improve the error reporting.
>
> Same thing in the commit message:
>
> > the error message does not
> > identify which sequence or subscription triggered the failure.
>
> We should at least mention that the stall is also there, and that it
> is intentionally not fixed.
>

This is the current behaviour of logical replication with or without
sequencesync. Any ERROR will lead to apply worker restarting till it
is manually resolved by the user. So, not sure a specific mention is
required but will try to adjust the commit message to reflect the same
before commit.

>
> Even in this case, I think it would be worth to keep the test similar
> to the original and:
> * give second or third sequence to someobody else, not the last
> * Assert that not even the first one gets ready if we have one stall,
> with a comment explaining the decision
>

I am not completely sure whether to have this test at the first place
but anyway it is just testing whether the new CONTEXT is added with
the ERROR generated during sequencesync, it is not specific to a
particular ERROR. So, I can't see how these additions in the test are
helpful.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-10-21 08:26:17 Re: [PG19] Sequence sync stops when the subscription owner can't SET ROLE to a sequence owner
Previous Message Sho Ito 2026-10-21 07:33:35 Re: [PATCH v1] Fix tab completion for DROP INDEX CONCURRENTLY