-
Notifications
You must be signed in to change notification settings - Fork 52
[WIP] Physical to logical replica support #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rasifr
wants to merge
14
commits into
main
Choose a base branch
from
task/SPOC-601/physical-to-logical-replica
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
86ef5e7
Add spock_create_subscriber — bootstrap a subscriber from a physical …
rasifr bc9ae7b
spock_create_subscriber: drop legacy paths and extension usage
rasifr 20a14ef
Added usage document for spock_create_subscriber
rasifr 0517945
spock_create_subscriber address review feedback
rasifr 361ee4d
spock_create_subscriber: add bidirectional join plumbing
rasifr 3c0c6b5
spock_create_subscriber: add TAP test for --bidirectional plumbing
rasifr ee93acf
spock_create_subscriber: physical backup, catalog strip, repset restore
rasifr 35dabb6
spock_create_subscriber: add --postgresql-auto-conf override
rasifr 813330a
spock_create_subscriber: trace every query and step at -v -v
rasifr 4f32cee
spock_create_subscriber: catchup subscription phase
rasifr 7536c18
spock_create_subscriber: bring n3 live with bidirectional replication
rasifr cb8923a
spock_create_subscriber: unify peer/source loops in the reverse-sub p…
rasifr c43949f
spock_create_subscriber: simplify and strengthen option parsing
rasifr 51c047d
spock_create_subscriber: break main() into lifecycle phases
rasifr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ## Creating a Subscriber Node with pg_basebackup | ||
|
|
||
| Spock supports creating a subscriber node by cloning the provider with [`pg_basebackup`](https://www.postgresql.org/docs/current/app-pgbasebackup.html) and starting it as a Spock subscriber. Use the `spock_create_subscriber` utility (located in the `bin` directory of your pgEdge platform installation) to register the node. | ||
|
|
||
| ### Synopsis: | ||
|
|
||
| `spock_create_subscriber [OPTION]...` | ||
|
|
||
| **Options** | ||
|
|
||
| Specify the following options as needed. | ||
|
|
||
| | Option | Description | ||
| |----------|------------- | ||
| | `-D`, `--pgdata=DIRECTORY` | The `data` directory to be used for new node. This can be either an empty/non-existing directory, or a directory populated using the `pg_basebackup -X stream` command. | ||
| | `--databases` | An optional list of databases to replicate. | ||
| | `-n`, `--subscriber-name=NAME` | The name of the newly created subscriber. | ||
| | `--subscriber-dsn=CONNSTR` | A connection string to the newly created subscriber. | ||
| | `--provider-dsn=CONNSTR` | A connection string to the provider. | ||
| | `--replication-sets=SETS` | A comma-separated list of replication set names. | ||
| | `--apply-delay=DELAY` | The apply delay in seconds (by default 0). | ||
| | `--drop-slot-if-exists` | Drop replication slot of conflicting name. | ||
| | `-s`, `--stop` | Stop the server once the initialization is done. | ||
| | `-v` | Increase logging verbosity. | ||
| | `--extra-basebackup-args` | Additional arguments to pass to `pg_basebackup`. Safe options are: `-T`, `-c`, `--xlogdir`/`--waldir` | ||
| | `--text-types` | Transfer all column values as text rather than binary during initial sync. Use this when provider and subscriber differ in endianness or type representation. | ||
|
|
||
| **Configuration files overrides** | ||
|
|
||
| You can use the following options to override the location of the configuration files. | ||
|
|
||
| | Option | Description | ||
| |----------|------------- | ||
| |`--hba-conf` | path to the new `pg_hba.conf` | ||
| | `--postgresql-conf` | path to the new `postgresql.conf` | ||
| | `--recovery-conf` | path to the template recovery configuration | ||
|
|
||
| Unlike `spock.sub_create`'s other data sync options, this method of cloning ignores replication sets and copies all tables on all databases. However, it's often much faster, especially over high-bandwidth connections. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the
--text-typesoption.The
--text-typesCLI option (line 211 inspock_create_subscriber.c, which setsforce_text_transfer) is neither listed in this options table nor in theusage()output (lines 578–603). Users have no way to discover it.Add a row to the options table and a corresponding
printfinusage().📝 Proposed additions
| `--extra-basebackup-args` | Additional arguments to pass to `pg_basebackup`. Safe options are: `-T`, `-c`, `--xlogdir`/`--waldir` +| `--text-types` | Force text transfer for all columns.printf(_(" --extra-basebackup-args additional arguments to pass to pg_basebackup.\n")); printf(_(" Safe options: -T, -c, --xlogdir/--waldir\n")); +printf(_(" --text-types force text transfer for all columns\n"));🧰 Tools
🪛 LanguageTool
[grammar] ~20-~20: Use a hyphen to join words.
Context: ...r. |
--replication-sets=SETS| A comma separated list of replication set names....(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents