Re: Logical Replication of sequences
Chao Li <li.evan.chao@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 Oct 27, 2025, at 17:11, Chao Li <li.evan.chao@gmail.com> wrote:
>
> The changes in 0001 are straightforward, looks good. I haven’t reviewed 0004 yet.
Comments for 0004:
1 - config.sgml
```
- In logical replication, this parameter also limits how often a failing
- replication apply worker or table synchronization worker will be
- respawned.
+ In logical replication, this parameter also limits how quickly a
+ failing replication apply worker, table synchronization worker, or
+ sequence synchronization worker will be respawned.
```
* “a failing replication apply worker” sounds a bit redundant, maybe change to “a failed apply worker”
* “will be respawned” works, but in formal documentation, I think “is respawned” is better
2 - logic-replication.sgml
```
- or <literal>FOR ALL SEQUENCES</literal>.
+ or <literal>FOR ALL SEQUENCES</literal>. Unlike tables, the current state of
+ sequences may be synchronized at any time. For more information, refer to
+ <xref linkend="logical-replication-sequences"/>.
```
* “may be” better to be “can be”
* I think the first sentence can be slightly enhanced as "Unlike tables, the state of a sequence can be synchronized at any time.”
* “refer to” should be “see” in PG docs. You can see right the next paragraph just uses “see”:
```
<command>TRUNCATE</command>. See <xref linkend="logical-replication-row-filter"/>).
```
3 - logic-replication.sgml
```
+ To synchronize sequences from a publisher to a subscriber, first publish
+ them using <link linkend="sql-createpublication-params-for-all-sequences">
+ <command>CREATE PUBLICATION ... FOR ALL SEQUENCES</command></link> and then
+ at the subscriber side:
```
“At the subscriber side” is better to be “on the subscriber”. Actually, you also use “on the subscriber” in the following paragraphs.
4 - logic-replication.sgml
```
During sequence synchronization, the sequence definitions of the publisher
and the subscriber are compared. An ERROR is logged listing all differing
sequences before the process exits. The apply worker detects this failure
and repeatedly respawns the sequence synchronization worker to continue
the synchronization process until all differences are resolved. See also
```
* “An ERROR” => “An error”. If you search for the current doc, “error” are all in lower case.
* " the sequence synchronization worker to continue the synchronization process”, the second “synchronization” sounds redundant, maybe enhance to "the sequence synchronization worker to retry"
5 - logic-replication.sgml
```
During sequence synchronization, if a sequence is dropped on the
publisher, the sequence synchronization worker will identify this and
remove it from sequence synchronization on the subscriber.
```
“Will identify this” => “detects the change”, I think PG docs usually prefer more direct phrasing.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/