Re: Logical Replication of sequences
Peter Smith <smithpb2250@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
Attachments
- PS_NITPICKS_20240815_SEQ_0004.txt (text/plain)
Hi Vignesh, I have reviewed your latest patchset: v20240814-0001. No comments v20240814-0002. No comments v20240814-0003. No comments v20240814-0004. See below v20240814-0005. No comments ////// v20240814-0004. ====== src/backend/commands/subscriptioncmds.c CreateSubscription: nit - XXX comments AlterSubscription_refresh: nit - unnecessary parens in ereport AlterSubscription: nit - unnecessary parens in ereport fetch_sequence_list: nit - unnecessary parens in ereport ====== .../replication/logical/sequencesync.c 1. fetch_remote_sequence_data + * Returns: + * - TRUE if there are discrepancies between the sequence parameters in + * the publisher and subscriber. + * - FALSE if the parameters match. + */ +static bool +fetch_remote_sequence_data(WalReceiverConn *conn, Oid relid, Oid remoteid, + char *nspname, char *relname, int64 *log_cnt, + bool *is_called, XLogRecPtr *page_lsn, + int64 *last_value) IMO it is more natural to return TRUE for good results and FALSE for bad ones. (FYI, I have implemented this reversal in the nitpicks attachment). ~ nit - swapped columns seqmin and seqmax in the SQL to fetch them in the natural order nit - unnecessary parens in ereport ~~~ copy_sequence: nit - update function comment to document the output parameter nit - Assert that *sequence_mismatch is false on entry to this function nit - tweak wrapping and add \n in the SQL nit - unnecessary parens in ereport report_sequence_mismatch: nit - modify function comment nit - function name changed /report_sequence_mismatch/report_mismatched_sequences/ (now plural (and more like the other one) append_mismatched_sequences: nit - param name /rel/seqrel/ ~~~ 2. LogicalRepSyncSequences: + Relation sequence_rel; + XLogRecPtr sequence_lsn; + bool sequence_mismatch; The 'sequence_mismatch' variable must be initialized false, otherwise we cannot trust it gets assigned. ~ LogicalRepSyncSequences: nit - unnecessary parens in ereport nit - move the for-loop variable declaration nit - remove a blank line process_syncing_sequences_for_apply: nit - variable declaration indent ====== Kind Regards, Peter Smith. Fujitsu Australia