Repository navigation
SS-489 - test: cover MySQL exports progressing during a held snapshot - #40208
Merged
martykulma merged 1 commit intoNov 5, 2026
Merged
Conversation
This was referenced Oct 27, 2026
martykulma
marked this pull request as ready for review
October 30, 2026 13:27
def-
approved these changes
Oct 30, 2026
def-
left a comment
Contributor
There was a problem hiding this comment.
Happy to see more tests here!
patrickwwbutler
approved these changes
Nov 4, 2026
martykulma
force-pushed
the
maz-mysql-snapshot-freshness-tests
branch
4 times, most recently
from
November 5, 2026 18:21
fe7ade6 to
4da8093
Compare
Co-Authored-By: Claude <[email protected]>
martykulma
force-pushed
the
maz-mysql-snapshot-freshness-tests
branch
from
November 5, 2026 21:56
4da8093 to
73d91d3
Compare
martykulma
added a commit
that referenced
this pull request
Nov 5, 2026
…#40206) ### Motivation Today a MySQL source snapshots all of its tables before it reads any of the binlog. This PR lets the replication operator read the binlog while the snapshot runs, as #39419 did for PostgreSQL. #40207 then lets each export's frontier advance on its own. NOTE: this needs an exception added for the 2s increase in snapshot performance, but I can't add it until I have a merge hash from main. Will do in a follow up PR. Closes: [SS-488](https://linear.app/materializeinc/issue/SS-488) ### Description All new behavior is keyed off `storage_persist_sink_description_lookahead` being nonzero. This is the same switch PostgreSQL uses. With a nonzero lookahead, the snapshot operator emits its rewind requests as soon as the snapshot GTID frontier is known. That happens before any table is read. The replication operator then reads the binlog while the tables are read. Every export still advances together. Replication data is staged in the dataflow until the snapshot completes. With the lookahead at zero, rewinds are emitted after the snapshot completes, as before. The snapshot operator reads the setting once at render time. That matches the value the persist sink reads in the same dataflow build. MySQL sources now count as OLTP sources in `render.rs`. A snapshotting MySQL export therefore gets the persist sink's snapshot ceiling and lookahead grouping, like a PostgreSQL export. The mzcompose default sets the lookahead to 2s. The MySQL initial load feature benchmarks should see their first rows about that much later, as the PgCdc benchmarks did after #39602. #39419 also added a leader check that the replication slot exists before the snapshot starts. MySQL needs no counterpart. The replication operator already checks `@@gtid_purged` against the resume upper before it waits for rewind requests. ### Verification The mzcompose default sets the lookahead, so the existing mzcompose-based MySQL source tests exercise the early rewind path. #40208 adds targeted coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]>
martykulma
added a commit
that referenced
this pull request
Nov 5, 2026
…napshot (#40207) ### Motivation Every export's frontier stays at the minimum until the last table's snapshot read finishes. Adding one large table to a MySQL source therefore still stalls ingestion for every table already hydrated in that source. #39479 fixed the same problem for PostgreSQL. ### Description With `storage_persist_sink_description_lookahead` nonzero, each export's port holds the minimum capability only while that export still has snapshot data to emit or a pending rewind. - Exports that are not being snapshotted drop their snapshot capabilities up front. They advance with the binlog. - After a worker plans its reads, it drops the ports of exports it reads no part of. This also covers exports that failed schema verification. - A snapshotted export releases its snapshot capability on each worker as soon as that worker finishes reading its table. - The replication operator downgrades every port without a pending rewind at each yield point. With the lookahead at zero, all ports advance together. Behavior then matches #40206. The replication operator now reads the setting at render time as well. Both operators read it in the same dataflow build and agree with the persist sink. ### Verification The mzcompose default sets the lookahead, so the existing mzcompose-based MySQL source tests exercise per-export progress. #40208 adds targeted coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
Contributor
Author
|
thanks for the reviews! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Adds targeted coverage for concurrent replication in the MySQL source, mirroring #39420 for PostgreSQL.
NOTE: this needs an exception added for the 2s increase in snapshot performance, but I can't add it until I have a merge hash from main. Will do in a follow up PR.
Closes: SS-489
Description
Adds a
mysql_snapshot_pausefailpoint to the MySQL snapshot operator.return(<table>)holds that table's read until the failpoint is deactivated.return(<table>:<millis>)holds it for a fixed time. The snapshot then completes in the same dataflow incarnation. Each worker reads its tables in order of their qualified names. Tables ordered before the held one finish their snapshots even when the same worker reads them.Two new
test/clusterworkflows share setup and add-tables phases intest/cluster/mysql-snapshot-freshness/.mysql-snapshot-freshnessholdst_pausedindefinitely. It checks that an already hydrated table keeps ingesting CDC. It checks thatt_alongside, added in the same transaction, completes its own snapshot. It also checks that CDC for the held table is staged without committing. It then restartsclusterdwithout the failpoint and checks that every table converges. The row inserted during the hold appears exactly once.mysql-snapshot-freshness-releaseholdst_pausedfor 30 seconds while CDC for it arrives across several timestamps. When the hold lifts, it checks that the snapshot and all staged CDC commit exactly once without a restart. It also checks that later CDC lands as for any hydrated table.The
clustercomposition now includes a MySQL service. Thecluster-testsandslow-clusterCI steps gain themysqltopic accordingly.Verification
Both workflows are new in this PR. They rely on the mzcompose default that sets
storage_persist_sink_description_lookahead, which turns concurrent replication on. With the lookahead set to zero,mysql-snapshot-freshnessfails waiting fort_alongside.🤖 Generated with Claude Code