Re: Logical Replication of sequences
Amit Kapila <amit.kapila16@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: Add documentation for sequence synchronization.
- 55cefadde874 19 (unreleased) landed
-
Remove unused assignment in CREATE PUBLICATION grammar.
- bfb7419b0bbe 19 (unreleased) landed
-
Add seq_sync_error_count to subscription statistics.
- f6a4c498dcf6 19 (unreleased) landed
-
Fix few issues in commit 5509055d69.
- 5a4eba558aa7 19 (unreleased) landed
-
Add sequence synchronization for logical replication.
- 5509055d6956 19 (unreleased) landed
-
Add worker type argument to logical replication worker functions.
- 3e8e05596a02 19 (unreleased) landed
-
Introduce "REFRESH SEQUENCES" for subscriptions.
- f0b3573c3aac 19 (unreleased) landed
-
Refactor logical worker synchronization code into a separate file.
- 41c674d2e31e 19 (unreleased) landed
-
Standardize use of REFRESH PUBLICATION in code and messages.
- 2436b8c047ff 19 (unreleased) landed
-
Add "ALL SEQUENCES" support to publications.
- 96b378497346 19 (unreleased) landed
-
Expose sequence page LSN via pg_get_sequence_data.
- b93172ca59f4 19 (unreleased) landed
-
Resume conflict-relevant data retention automatically.
- 0d48d393d465 19 (unreleased) cited
-
Post-commit review fixes for 228c370868.
- 1f7e9ba3ac4e 19 (unreleased) cited
-
Generate GUC tables from .dat file
- 63599896545c 19 (unreleased) cited
On Mon, Oct 27, 2025 at 5:10 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Mon, Oct 27, 2025 at 12:19 PM vignesh C <vignesh21@gmail.com> wrote: > > > > On Mon, 27 Oct 2025 at 10:04, Dilip Kumar <dilipbalaut@gmail.com> wrote: > > > > > > > > > One question, I am not sure if this has been discussed before, So while getting sequence information from remote we are also getting the page_lsn of the sequence and we are storing that in pg_subscription_rel. Is it just for the user to see and compare whether the sequence is synced to the latest lsn or is it used for anything else as well? In our patch sert, I don't see much usability information about this field. > > > > This is mainly intended for the following purposes: a) To determine > > whether the sequence requires resynchronization by comparing it with > > the latest LSN on the publisher b. ) To maintain consistency with > > table synchronization behavior. c) To inform users up to which LSN > > the sequence has been synchronized. > > Further details will be documented in an upcoming patch. > > > > Can we use it to build an auto-sequence-sync feature? One can imagine > that at some threshold interval apply_worker can check if any of the > replicated sequences are out-of-sync and if so, then sync those. We > can do this before the apply_worker waits for some activity or on a > clean shutdown. > We can even consider letting sequence sync worker do this by not exiting it after syncing all required sequences. Having said that, even if this is feasible, we should consider it as a top-up patch after the sequence sync worker patch is committed. -- With Regards, Amit Kapila.