8000 Implement "live" streaming of changes from source to target. by dimitri · Pull Request #185 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement "live" streaming of changes from source to target. #185

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

Merged
merged 6 commits into from
Feb 9, 2023

Conversation

dimitri
Copy link
Owner
@dimitri dimitri commented Feb 6, 2023

This patch introduces support for Unix Pipes and an internal streaming API where changes flow through the system rather than being batched in files. The following command line can be used to replay changes in a "live" fashion from the source to the target database.

$ pgcopydb stream receive --to-stdout
  | pgcopydb stream transform - -
  | pgcopydb stream apply -

The command pgcopydb stream replay is scheduled to glue together those internal parts, and then the pgcopydb clone --follow will be extended to automatically switch from catchup mode to replay mode when suitable.

@dimitri dimitri added the enhancement New feature or request label Feb 6, 2023
@dimitri dimitri self-assigned this Feb 6, 2023
@dimitri dimitri force-pushed the feature/stream-replay branch from 8d7e10b to 6b8f353 Compare February 7, 2023 16:34
This patch introduces support for Unix Pipes and an internal streaming API
where changes flow through the system rather than being batched in files.
The following command line can be used to replay changes in a "live" fashion
from the source to the target database.

  $ pgcopydb stream receive --to-stdout
    | pgcopydb stream transform - -
    | pgcopydb stream apply -

The command `pgcopydb stream replay` is scheduled to glue together those
internal parts, and then the `pgcopydb clone --follow` will be extended to
automatically switch from catchup mode to replay mode when suitable.
Share the code that reads through a unix pipe (stream) line by line,
introducing a user callback facility with a (void *) context.
This avoids partial reads of a part of a line, now we read a line at a time,
unless it doesn't fit in our 128 MB read buffer, a case that is handled in
the code already (albeit quite poorly at the time being).

Also improve logging, install set -o pipefail in the test suite.
@dimitri dimitri force-pushed the feature/stream-replay branch from 74f1bb6 to f8a9348 Compare February 9, 2023 14:34
@dimitri dimitri merged commit 7e5fbb8 into main Feb 9, 2023
@dimitri dimitri deleted the feature/stream-replay branch February 9, 2023 16:46
arajkumar added a commit to arajkumar/pgcopydb that referenced this pull request Dec 10, 2024
24a7d6d  Fix incorrect table locking during copy (dimitri#184)
0b069e3 Validate wal2json plugin and enable numeric as string if
supported (dimitri#183)
aca861f Unique constraint is not a default replica identity (dimitri#182)

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0