RE: Logical Replication of sequences

Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>

From: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, vignesh C <vignesh21@gmail.com>, Peter Smith <smithpb2250@gmail.com>, shveta malik <shveta.malik@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, Chao Li <li.evan.chao@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Nisha Moond <nisha.moond412@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Euler Taveira <euler@eulerto.com>, Michael Paquier <michael@paquier.xyz>, "Jonathan S. Katz" <jkatz@postgresql.org>
Date: 2025-10-20T09:31:06Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Doc: Add documentation for sequence synchronization.

  2. Remove unused assignment in CREATE PUBLICATION grammar.

  3. Add seq_sync_error_count to subscription statistics.

  4. Fix few issues in commit 5509055d69.

  5. Add sequence synchronization for logical replication.

  6. Add worker type argument to logical replication worker functions.

  7. Introduce "REFRESH SEQUENCES" for subscriptions.

  8. Refactor logical worker synchronization code into a separate file.

  9. Standardize use of REFRESH PUBLICATION in code and messages.

  10. Add "ALL SEQUENCES" support to publications.

  11. Expose sequence page LSN via pg_get_sequence_data.

  12. Resume conflict-relevant data retention automatically.

  13. Post-commit review fixes for 228c370868.

  14. Generate GUC tables from .dat file

Attachments

On Friday, October 17, 2025 4:50 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> 
> On Thu, Oct 16, 2025 at 4:53 PM Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
> wrote:
> >
> > Thanks! Here is the remaining patches, which addressed all pending
> comments.
> >
> 
> Few comments on 0001/0003:

Thanks for the comments.

> ========================
> 1.
> @@ -480,7 +480,9 @@ RemoveSubscriptionRel(Oid subid, Oid relid)
>   * leave tablesync slots or origins in the system when the
>   * corresponding table is dropped.
>   */
> - if (!OidIsValid(subid) && subrel->srsubstate != SUBREL_STATE_READY)
> + if (!OidIsValid(subid) &&
> + get_rel_relkind(subrel->srrelid) != RELKIND_SEQUENCE &&
> + subrel->srsubstate != SUBREL_STATE_READY)
>   {
> 
> Here, why don't we allow sequence rel to be removed? Please add some
> comments.

I think the intention is to allow removing sequence because we do not
create slot/origin when syncing sequence. I added some comments
for the same.

Other comments have been addressed in latest version.

Here is the latest patch set which addressed Shveta[1], Amit[2], Chao[3][4],
Dilip[5], Sawada-San's[6] comments.

Some of the code refactoring comments in [4] will be considered in
next versions.

[1] https://www.postgresql.org/message-id/CAJpy0uC898ga%2BQo3X%3Dk_MaRUL7EnmXt%2BppDJo-nroQZifrk5Hw%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CAA4eK1K6Aofz_f6afuL%2Br2M3GfHBEYQ6-5JO93ph9xZAmYugSA%40mail.gmail.com
[3] https://www.postgresql.org/message-id/B0F583F9-6D4D-4C0F-9F35-64D5AB2F1643%40gmail.com
[4] https://www.postgresql.org/message-id/598FC353-8E9A-4857-A125-740BE24DCBEB%40gmail.com
[5] https://www.postgresql.org/message-id/CAFiTN-sC4yE_u7fa%2BUQS38JvhxN_VYSWTq2O_2bTRxxq%3DeW8FQ%40mail.gmail.com
[6] https://www.postgresql.org/message-id/CAD21AoBYP1a4%2B%2BALRPG%3DSmCoyGeGCcqhFxWSXYhy1cvmN0i3CA%40mail.gmail.com

Best Regards,
Hou zj