From: | vignesh C <vignesh21(at)gmail(dot)com> |
---|---|
To: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
Cc: | Peter Smith <smithpb2250(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org> |
Subject: | Re: Logical Replication of sequences |
Date: | 2025-05-14 04:56:31 |
Message-ID: | CALDaNm3GXa-kKTe3oqmKA8oniHvZfgYUXG8mVczv4GJzFwG7bg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, 9 May 2025 at 14:28, shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Sat, May 3, 2025 at 7:27 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > >
> > > Thanks for the comments, the updated patch has the changes for the same.
> >
>
> Thanks for the patches. Please find few comments:
>
>
> 1)
> patch004 commit msg:
> - Drop published sequences are removed from pg_subscription_rel.
>
> Drop -->Dropped
Modified
> 2)
> copy_sequences:
>
> LOG: Executing query :SELECT s.schname, s.seqname, ps.*, seq.seqtypid,
> seq.seqstart, seq.seqincrement, seq.seqmin,
> seq.seqmax, seq.seqcycle
> FROM ( VALUES ('public', 'myseq1'), ('public', 'myseq3') ) AS s
> (schname, seqname)
> JOIN LATERAL pg_sequence_state(s.schname, s.seqname) ps ON true
> ....
>
> Do we really need to log this query? If so, shall it be DEBUG1/DEBUG2?
This is not required, removed it
> 3)
> In log, we get:
>
> ------------------
> LOG: logical replication synchronized 9 of 9 sequences for subscription "sub1"
> WARNING: parameters differ for the remote and local sequences
> ("public.myseq1", "public.myseq3") for subscription "sub1"
>
> LOG: logical replication synchronized 2 of 2 sequences for subscription "sub1"
> WARNING: parameters differ for the remote and local sequences
> ("public.myseq1", "public.myseq3") for subscription "sub1"
> ------------------
>
> This is confusing. I have 9 sequences, out of which 2 are mismatched.
> So on REFRESH I get the first message as 'synchronized 9 of 9' and
> later when it attempts to resynchronize pending ones automatically, it
> keeps on displaying 'synchronized 2 of 2'.
>
> Can we mention something like below:
> -----------------
> Unsynchronized sequences: 9, attempted in this batch: 9, succedded: 7,
> mismatched/failed:2
>
> So that if it is more than 100, say 120, it will say:
> Unsynchronized sequences: 120, attempted in this batch: 100,
> succedded: 98, mismatched/failed:2
> And in next batch:
> Unsynchronized sequences: 120, attempted in this batch: 20, succedded:
> 20, mismatched:0
>
> And while attempting to synchronize failed ones, it will say:
> Unsynchronized sequences: 2, attempted in this batch: 2, succedded: 0,
> mismatched:2
> -----------------
>
> Please feel free to change the words. The intent is to get a clear
> picture on what is happening.
Fixed this
> 4)
> Why in patch001, we have 'pg_sequence_state' with one argument while
> in 4ht patch it is changed to 2 args? Is it intentional to have it the
> current way in patch001?
This should have been in 001 itself, moved these changes to 001 patch
> 5)
> Section1:
> <para>
> A new <firstterm>sequence synchronization worker</firstterm> will be started
> after executing any of the above subscriber commands, and will exit once the
> sequences are synchronized.
> </para>
>
> Section2:
> <sect2 id="sequence-definition-mismatches">
> <title>Sequence Definition Mismatches</title>
> <warning>
> <para>
> During sequence synchronization, the sequence definitions of the publisher
> and the subscriber are compared. A WARNING is logged if any differences
> are detected.
> </para>
> </warning>
>
>
> None of the section mentions that the synchronization worker will keep
> on attempting to synchronize the failed/mismtached sequences until the
> differences are resolved (provided disable_on_error is not enabled).
> I think we can mention such a thing briefly in
> 'sequence-definition-mismatches' section.
Modified
The attached v20250514 version patch has the changes for the same.
Regards,
Vignesh
Attachment | Content-Type | Size |
---|---|---|
v20250514-0001-Introduce-pg_sequence_state-function-for-e.patch | application/octet-stream | 7.2 KB |
v20250514-0005-Documentation-for-sequence-synchronization.patch | application/octet-stream | 26.4 KB |
v20250514-0003-Reorganize-tablesync-Code-and-Introduce-sy.patch | application/octet-stream | 23.0 KB |
v20250514-0002-Introduce-ALL-SEQUENCES-support-for-Postgr.patch | application/octet-stream | 106.5 KB |
v20250514-0004-Enhance-sequence-synchronization-during-su.patch | application/octet-stream | 98.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | vignesh C | 2025-05-14 04:59:13 | Re: Logical Replication of sequences |
Previous Message | Nisha Moond | 2025-05-14 04:25:42 | Re: Logical Replication of sequences |