Skip to content

Sync upstream 2026-03-31#28

Open
grodowski wants to merge 8 commits intomasterfrom
sync-upstream-2026-03-31
Open

Sync upstream 2026-03-31#28
grodowski wants to merge 8 commits intomasterfrom
sync-upstream-2026-03-31

Conversation

@grodowski
Copy link
Copy Markdown
Member

No description provided.

ggilder and others added 6 commits March 12, 2026 09:26
* Replace log.Fatale with context-based error propagation

This patch modifies gh-ost to use a cancellable context instead of
log.Fatale() in listenOnPanicAbort. When using gh-ost as a library, this
allows the calling application to recover from aborts (e.g. log the
failure reason) instead of having the entire process terminate via
os.Exit(). Now we store the error and cancel a context to signal all
goroutines to stop gracefully.

* Fix shadowing

* Simplify non-blocking poll

* Simplify non-blocking poll in migrator.go

* Fix error return

* Fix hang on blocking channel send

* Add defensive fix for other potential blocking channel send deadlocks

* Add SendWithContext helper to avoid deadlocks

* Fix deadlock on PanicAbort sends

* Use checkAbort

* Fix migration abort race condition

* Remove buffer on PanicAbort channel
* Improve tests for various error scenarios

- Regex meta characters in index names should not break warning
  detection (required code fix)
- Improve tests that only checked number of rows (need to validate data
  as well)
- Test positive case allowing ignored duplicates on migration key
- Test behavior with PanicOnWarnings disabled

* Address Copilot feedback

* Add test for warnings on composite unique keys

* Add test for updating pk with duplicate

* Improve replica test debugging

- Print log excerpt on failure
- Upload full log artifacts on failure

* Reduce flakiness in update-pk test

* Revise test

* More robust test fix

* Make MySQL wait strategy less flaky

Removed the `wait.ForExposedPort()` override from test files. The tests
will now use the MySQL module's default wait strategy
(`wait.ForLog("port: 3306  MySQL Community Server")`), which properly
waits for MySQL to be ready to accept connections. Otherwise the port
may be exposed, but MySQL is still initializing and not ready to accept
connections.

* Customize update-pk integration test

Add support for test-specific execution so that we can guarantee that
we're specifically testing the DML apply phase

* Fix regression in integration test harness

* Add test timeouts and fix error propagation

Prevent indefinite test hangs by adding 120-second timeout and
duration reporting. Fix silent error drops by propagating errors from
background write goroutines to PanicAbort channel. Check for abort in
sleepWhileTrue loop and handle its error in cutOver.
* Add retry logic for instant DDL on lock wait timeout
When attempting instant DDL, a lock wait timeout (errno 1205) may occur
if a long-running transaction holds a metadata lock. Rather than failing
immediately, retry the operation up to 5 times with linear backoff.
Non-timeout errors (e.g. ALGORITHM=INSTANT not supported) still return
immediately without retrying.

* Fix int-to-Duration type mismatch in retry backoff

---------

Co-authored-by: ybs-me <yosef.bensimchon@melio.com>
* Handle warnings in middle of DML batch

* Add integration test for batch warnings

* Update expected failure message for update-pk test

---------

Co-authored-by: meiji163 <meiji163@github.com>
@grodowski grodowski force-pushed the sync-upstream-2026-03-31 branch from 4edbdb6 to 2982cfe Compare March 31, 2026 16:05
ggilder and others added 2 commits April 2, 2026 12:22
* Add failing test for retry + abort issue

* Fix retry after abort issue

* Skip retries for warning errors

Warning errors indicate data consistency issues that won't resolve on retry, so
attempting to retry them is futile and causes unnecessary delays. This change
detects warning errors early and aborts immediately instead of retrying.

* Fix test expectation
@grodowski
Copy link
Copy Markdown
Member Author

@forge33 did one more sync now to include 8bc63f0 👀

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.

4 participants