Re: Logical Replication of sequences

From: vignesh C <vignesh21(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Smith <smithpb2250(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-09-26 07:25:27
Message-ID: CALDaNm1c7TuwHA0ruuBHWJBBCAB=KVhH1LkPu6jBuBDV96=7xQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 25 Sept 2025 at 12:23, shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> sequencesync_list_invalidate_cb():
> 5)
>
> + /* invalidate all entries */
> + hash_seq_init(&status, sequences_to_copy);
> + while ((entry = (LogicalRepSequenceInfo *) hash_seq_search(&status)) != NULL)
> + entry->entry_valid = false;
>
> Can you please elaborate when this case can be hit? I see such logic
> in all such invalidation functions registered with
> CacheRegisterRelcacheCallback(), but could not find any relevant
> comment.

I noticed this could happen in cases like:
create publication for all tables;
alter publication on many relations;

but there might be more apart from this

Rest of the comments were addressed.
The attached patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v20250926-0001-Enhance-pg_get_sequence_data-function.patch text/x-patch 8.3 KB
v20250926-0004-Update-ALTER-SUBSCRIPTION-REFRESH-to-ALTER.patch text/x-patch 8.9 KB
v20250926-0002-Introduce-ALL-SEQUENCES-support-for-Postgr.patch text/x-patch 111.2 KB
v20250926-0003-Reorganize-tablesync-Code-and-Introduce-sy.patch text/x-patch 26.5 KB
v20250926-0005-Introduce-REFRESH-PUBLICATION-SEQUENCES-fo.patch text/x-patch 40.6 KB
v20250926-0006-New-worker-for-sequence-synchronization-du.patch text/x-patch 89.3 KB
v20250926-0007-Documentation-for-sequence-synchronization.patch text/x-patch 39.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2025-09-26 07:28:15 Re: [BUG] temporary file usage report with extended protocol and unnamed portals
Previous Message Peter Eisentraut 2025-09-26 07:02:08 Re: [PATCH] GROUP BY ALL