Merged
Conversation
addbd77 to
f67d8f0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a concurrent test for cutover atomicity to verify that the migration system correctly maintains consistency between the old and new tables during the cutover process. The test uses an intentionally partial cutover that only renames the original table to _old (skipping the rename of _new to original), creating a failure scenario that allows verification of data consistency under concurrent write load.
- Adds a test-only cutover mechanism (
useTestCutover) that performs a partial rename for failure injection testing - Implements
TestCutoverAtomicityWithConcurrentWritesto verify consistency between_oldand_newtables with concurrent writes - Refactors cutover logic to extract
executeRenameUnderLockas a shared implementation for both normal and test cutovers
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/migration/migration.go | Adds private useTestCutover field to control test-only cutover behavior |
| pkg/migration/runner.go | Passes useTestCutover flag from Migration to cutover configuration |
| pkg/migration/cutover.go | Adds partialRenameForTest method and refactors rename logic into shared executeRenameUnderLock function |
| pkg/migration/cutover_test.go | Adds comprehensive concurrent test with helper functions to simulate write load during migration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nonbb
approved these changes
Jan 9, 2026
00c6cab to
8d2e327
Compare
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.
A Pull Request should be associated with an Issue.
This is a pretty isolated/easy way to test the cutover better. It is inspired by one of the tests added to MoveTables.
Also fixes #548 again, since there was a second issue here. It ensures that the buffered position is always going forward. There is a case where
FormatDescriptionEventevents could prevent BlockWait from completing.