Skip to content

Cleanup and document throttlers#576

Merged
morgo merged 1 commit intoblock:mainfrom
morgo:refine-throttlers
Jan 26, 2026
Merged

Cleanup and document throttlers#576
morgo merged 1 commit intoblock:mainfrom
morgo:refine-throttlers

Conversation

@morgo
Copy link
Collaborator

@morgo morgo commented Jan 25, 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

This is a small code cleanup:

  • Rename test throttler to mock throttler.
  • Simplify code now that we have long supported only mysql 8.0.
  • Add documentation on throttlers.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up and documents the throttler package by renaming the test throttler to "Mock", simplifying code to support only MySQL 8.0+, and adding comprehensive documentation.

Changes:

  • Renamed Test throttler to Mock throttler for clearer semantics
  • Consolidated MySQL80Replica into Replica and removed the Repl base struct, simplifying the code now that only MySQL 8.0+ is supported
  • Added comprehensive README documentation for the throttler package with usage examples and extension guidelines

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/throttler/mock.go Renamed Test struct to Mock and updated all method receivers
pkg/throttler/throttler_test.go Added comprehensive tests for the Mock throttler including context cancellation
pkg/throttler/throttler.go Updated NewReplicationThrottler to directly return Replica instead of MySQL80Replica, simplified documentation
pkg/throttler/replica.go Consolidated code from deleted repl.go, renamed MySQL80Replica to Replica, and moved fields directly into the struct
pkg/throttler/repl.go File deleted - functionality merged into replica.go
pkg/throttler/README.md New comprehensive documentation covering design philosophy, implementations, usage, and extension guidelines
pkg/migration/runner.go Updated reference from throttler.Test{} to throttler.Mock{}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@morgo morgo force-pushed the refine-throttlers branch from cc09f17 to 613c7ee Compare January 25, 2026 18:15
@morgo morgo merged commit 01b734a into block:main Jan 26, 2026
7 checks passed
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.

3 participants