aurora: throttle on threads#880
Draft
morgo wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Aurora-specific throttling capabilities by introducing dedicated throttlers for Aurora commit latency and Aurora “active CPU threads”, plus shared setup wiring that opens a small separate monitoring connection pool to avoid interference with the main migration workload.
Changes:
- Introduce
throttler.AuroraSetupto probe for Aurora and assemble Aurora throttlers using a lazily-opened monitor*sql.DB. - Add two new Aurora throttlers: commit-latency (from
performance_schema.global_status) and active-threads (fromperformance_schema.threads+events_waits_current), each with background polling. - Update migration runner throttler setup to use the shared Aurora setup and to manage a dedicated
monitorDBlifecycle.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/throttler/aurora.go | Adds shared Aurora detection + throttler construction helper that returns throttlers + a dedicated monitor pool. |
| pkg/throttler/aurora_test.go | Tests AuroraSetup “no-op” behavior when disabled, non-Aurora, or probe fails. |
| pkg/throttler/aurora_commitlatency.go | Implements commit-latency throttler based on Aurora global status counters with delta-based averaging. |
| pkg/throttler/aurora_commitlatency_test.go | Unit tests for commit-latency sampling, throttling transitions, and BlockWait behavior. |
| pkg/throttler/aurora_activethreads.go | Implements active-threads throttler using perf-schema thread/wait data and vCPU threshold. |
| pkg/throttler/aurora_activethreads_test.go | Unit tests for active-threads sampling logic, BlockWait behavior, and probe. |
| pkg/migration/runner.go | Wires Aurora throttlers via AuroraSetup, adds monitorDB pool, and ensures it’s closed appropriately. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.