Make write threads for applier configurable#549
Merged
morgo merged 6 commits intoblock:mainfrom Jan 5, 2026
Merged
Conversation
nonbb
reviewed
Jan 5, 2026
| TargetDSN string `name:"target-dsn" help:"Where to copy the tables to." default:"spirit:spirit@tcp(127.0.0.1:3306)/dest"` | ||
| TargetChunkTime time.Duration `name:"target-chunk-time" help:"How long each chunk should take to copy" default:"5s"` | ||
| Threads int `name:"threads" help:"How many chunks to copy in parallel" default:"2"` | ||
| WriteThreads int `name:"write-threads" help:"How many concurrent write threads to use per target" default:"2"` |
Collaborator
There was a problem hiding this comment.
would it be apparent when errors pop up that we'd need to tweak the default threads up here?
Collaborator
Author
There was a problem hiding this comment.
It's was not obvious why the tests were failing, but I reduced the concurrency and it worked.
This is similar to scenarios like OOM and CPU load. Programs start performing unreliably.
I tried to consider that it might be something like a race, and thus there's a bug that is fixable. But I don't think that's the case.
nonbb
approved these changes
Jan 5, 2026
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.
Previously we used 40 write threads regardless. This is going to be a problem when running concurrent tests in CI (the appliers are still experimental, so there aren't that many tests for them yet).
I've changed it to be configurable. This changes the signature of
NewSingleTargetAppliersuch that it can return errors. This is the same asNewShardedApplier.