Repository navigation
[release-23.0] VReplication: reload the schema at a DDL only once MySQL has committed it (#21887) - #22142
Conversation
|
Hello @mattlord, there are conflicts in this backport. Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually. Make sure you replace |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved merge conflicts, incompatible logging, and missing test helpers prevent compilation, while incorrect DDL GTID wiring leaves the schema-visibility race unfixed.
6 open issues
Use the release branch's logging API · New Resolve test imports and remove unused strconv · New Resolve merge conflicts blocking vttablet compilation · New Resolve historian test conflicts and duplicate declarations · New Remove startup tests that depend on unavailable APIs · New Pass the parsed event GTID to the DDL reload · New
What changed in this PR
Backports #21887 to release-23.0 to prevent VReplication and schema tracking from loading stale schemas before MySQL commits a DDL.
Changes:
- Adds shared, GTID-specific commit waits with timeout handling and
DDLCommitWaitmetrics. - Updates vstreamer DDL reload handling and adds unit and semi-sync regression tests.
- Expands timeout flag help and adds release-summary documentation.
| File | Description |
|---|---|
go/vt/vttablet/tabletserver/vstreamer/vstreamer.go |
Adapts DDL reload handling to wait for commit and propagate errors. |
go/vt/vttablet/tabletserver/vstreamer/vstreamer_test.go |
Adds a semi-sync regression test and historian tests/helpers. |
go/vt/vttablet/tabletserver/tabletenv/config.go |
Documents the timeout’s separate commit-wait bound. |
go/vt/vttablet/tabletserver/schema/engine.go |
Implements shared DDL commit waits, cancellation, logging, and metrics. |
go/vt/vttablet/tabletserver/schema/engine_test.go |
Covers wait sharing, failures, cancellation, and metrics. |
go/flags/endtoend/vttablet.txt |
Updates expected vttablet timeout help text. |
go/flags/endtoend/vtcombo.txt |
Updates expected vtcombo timeout help text. |
changelog/25.0/25.0.0/summary.md |
Adds the v25 release summary, including DDL-wait metrics. |
Review effort: Balanced
In vstreamer.go, release-23.0 keeps eventGTID as a replication.GTID, set and cleared at the same binlog events as main's new gtid field, so the gtid field and the setEventGTID change are dropped and the DDL handler passes vs.eventGTID to ReloadAtDDL. The reload at a DDL is best effort on release-23.0 (main's error check and rebuildPlans come from #19204), so the error is still not returned; it is logged unless the stream was cancelled. The call uses the stream's context rather than context.Background(), so that a stream cancel does not wait out the DDL commit wait. In engine.go, log.Warningf replaces the slog-style log.Warn, which release-23.0 does not have. In engine_test.go, the imports keep release-23.0's strings and add sync and sync/atomic. In vstreamer_test.go, only TestSchemaReloadWaitsForDDLCommit and the four helpers it uses are kept (createSchemaVersionTable as #21887 changed it, isolateSchemaVersionTable, insertSchemaVersionRow and makeHistorianMinimalTable). The historian startup tests and helpers from #19697, which is not on release-23.0, are dropped. The replication and schema imports are added, and one comment is reworded, since release-23.0's tracker streams from the current position. The 25.0.0 changelog summary is dropped, since release-23.0 does not have it. Signed-off-by: Matt Lord <mattalord@gmail.com>
|
Resolved the conflicts. Conflicts and how they were resolved
The flag help changes in Testing (Go 1.25.13, MySQL 8.0.46)
|


Description
This is a backport of #21887