Skip to content

Conversation

@morgo
Copy link
Collaborator

@morgo morgo commented Jan 12, 2026

A Pull Request should be associated with an Issue.

We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
and potentially we'll be able to point development in a particular direction.
Further notes in https://github.com/block/spirit/blob/main/.github/CONTRIBUTING.md

Part of making #451 stable (does not fix)

This also has a better fix for #556 (which just merged):

  • It looks like the fix was incomplete, and there are cases where just after creating a syncer it fails. If it is still on the initial file, it is unrecoverable.
  • The workaround in this PR is to flush binary logs before the subscription starts, so all the changes in the binary log are idempotent.

@morgo morgo force-pushed the mtocker-add-buffered-tests branch from e80d243 to bcec09e Compare January 17, 2026 16:52
@morgo morgo marked this pull request as draft January 17, 2026 17:57
morgo added 4 commits January 18, 2026 10:44
…mmediately

The force-kill timer in ForceExec was being stopped in a defer, which meant
it could still fire even after the DDL completed. This caused a race condition
where:

1. ForceExec starts a 27-second timer to kill locking transactions
2. When INSTANT DDL fails, it returns an error but timer keeps running
3. Migration falls through to full copy path with checksum
4. 27 seconds later, timer fires and kills checksum queries on the same table
5. Test fails with 'invalid connection' or 'context canceled'

The fix moves timer.Stop() to execute immediately after the DDL completes,
before returning from the function. This ensures the timer is stopped before
it can interfere with subsequent operations in the same migration.

Fixes intermittent test failures in TestSecondaryEngineAttribute.
Resolved conflicts by preferring changes from mtocker-fix-races:
- compose/compose.yml: Added -parallel=4 flag to test command
- pkg/dbconn/dbconn.go: Simplified timer.Stop() comment
- pkg/migration/runner_resume_test.go: Took entire file from mtocker-fix-races
- pkg/repl/client.go: Used safer recreateStreamer logic that checks for binlog rotation

Additional changes from mtocker-fix-races:
- compose/replication-tls/replication-ci.yml: Updated configuration
- pkg/migration/migration.go: Race fixes
- pkg/migration/runner.go: Race fixes
- pkg/repl/client_test.go: Test improvements
- pkg/throttler/test.go: New test throttler utility
@morgo morgo force-pushed the mtocker-add-buffered-tests branch 2 times, most recently from 0c16baf to 670c159 Compare January 19, 2026 00:15
@morgo morgo force-pushed the mtocker-add-buffered-tests branch from 670c159 to ee09698 Compare January 19, 2026 00:27
@morgo morgo force-pushed the mtocker-add-buffered-tests branch from 0591ad5 to 358298f Compare January 19, 2026 20:08
@morgo morgo force-pushed the mtocker-add-buffered-tests branch from 358298f to 3d3440d Compare January 19, 2026 20:39
@morgo morgo marked this pull request as ready for review January 19, 2026 21:14
@morgo morgo merged commit 1c28dd6 into block:main Jan 19, 2026
7 checks passed
@morgo morgo deleted the mtocker-add-buffered-tests branch January 19, 2026 22:58
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.

2 participants