Re: Logical Replication of sequences - Mailing list pgsql-hackers

From vignesh C
Subject Re: Logical Replication of sequences
Date
Msg-id CALDaNm2Q6xK1Sbu0O=iKakGFv=hCQ4nh0BkGnhNUoLKcPdr2Rw@mail.gmail.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Logical Replication of sequences
List pgsql-hackers
On Mon, 12 Aug 2024 at 10:40, Peter Smith <smithpb2250@gmail.com> wrote:
>
> Hi Vignesh,
>
> I found that when 2 subscriptions are both subscribing to a
> publication publishing sequences, an ERROR occurs on refresh.
>
> ======
>
> Publisher:
> ----------
>
> test_pub=# create publication pub1 for all sequences;
>
> Subscriber:
> -----------
>
> test_sub=# create subscription sub1 connection 'dbname=test_pub'
> publication pub1;
>
> test_sub=# create subscription sub2 connection 'dbname=test_pub'
> publication pub1;
>
> test_sub=# alter subscription sub1 refresh publication sequences;
> 2024-08-12 15:04:04.947 AEST [7306] LOG:  sequence "public.seq1" of
> subscription "sub1" set to INIT state
> 2024-08-12 15:04:04.947 AEST [7306] STATEMENT:  alter subscription
> sub1 refresh publication sequences;
> 2024-08-12 15:04:04.947 AEST [7306] LOG:  sequence "public.seq1" of
> subscription "sub1" set to INIT state
> 2024-08-12 15:04:04.947 AEST [7306] STATEMENT:  alter subscription
> sub1 refresh publication sequences;
> 2024-08-12 15:04:04.947 AEST [7306] ERROR:  tuple already updated by self
> 2024-08-12 15:04:04.947 AEST [7306] STATEMENT:  alter subscription
> sub1 refresh publication sequences;
> ERROR:  tuple already updated by self
>
> test_sub=# alter subscription sub2 refresh publication sequences;
> 2024-08-12 15:04:30.427 AEST [7306] LOG:  sequence "public.seq1" of
> subscription "sub2" set to INIT state
> 2024-08-12 15:04:30.427 AEST [7306] STATEMENT:  alter subscription
> sub2 refresh publication sequences;
> 2024-08-12 15:04:30.427 AEST [7306] LOG:  sequence "public.seq1" of
> subscription "sub2" set to INIT state
> 2024-08-12 15:04:30.427 AEST [7306] STATEMENT:  alter subscription
> sub2 refresh publication sequences;
> 2024-08-12 15:04:30.427 AEST [7306] ERROR:  tuple already updated by self
> 2024-08-12 15:04:30.427 AEST [7306] STATEMENT:  alter subscription
> sub2 refresh publication sequences;
> ERROR:  tuple already updated by self

This issue is fixed in the v20240812 version attached at [1].
[1] - https://www.postgresql.org/message-id/CALDaNm3hS58W0RTbgsMTk-YvXwt956uabA%3DkYfLGUs3uRNC2Qg%40mail.gmail.com

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences