Skip to content

feat: replay DDL on destination shards from logical messages - #1815

Open
jkaczman wants to merge 2 commits into
jk-replay-ddl-2-triggersfrom
jk-replay-ddl-3-replay
Open

jkaczman wants to merge 2 commits into
jk-replay-ddl-2-triggersfrom
jk-replay-ddl-3-replay

Conversation

@jkaczman

Copy link
Copy Markdown
Contributor

The 1st PR (#1788) introduced support for parsing logical decoding messages from the XLogData payload. The 2nd PR (#1797) added the event triggers that write each DDL statement to the source's WAL as one of those messages.

This 3rd PR extends on that by now actually replaying them. When resharding_replay_ddl = true (off by default), we ask the source for logical messages (by adding "messages" 'true' in START_REPLICATION), and for each one we get from our event trigger, we run the DDL on every destination shard at the same point in the stream inside the transaction being replicated.

Follow up PRs will cover these:

  • column added with a default like now() or random() gets different values on the destination
  • multi-shard source

@jkaczman
jkaczman added this pull request to stack #1789 October 14, 2026 17:06
@jkaczman
jkaczman force-pushed the jk-replay-ddl-3-replay branch 2 times, most recently from 4163620 to 1be41a2 Compare October 14, 2026 17:08
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.90863% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../src/backend/replication/logical/subscriber/ddl.rs 93.22% 8 Missing ⚠️
...c/backend/replication/logical/subscriber/stream.rs 90.24% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jkaczman
jkaczman force-pushed the jk-replay-ddl-3-replay branch from bebe232 to a3ef9fc Compare October 16, 2026 12:33
@jkaczman
jkaczman force-pushed the jk-replay-ddl-3-replay branch from a3ef9fc to e3a99fc Compare October 16, 2026 12:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant