Skip to content

Add throttler subcommands to branch vtctld#1261

Merged
nickvanw merged 1 commit into
mainfrom
nick/throttler-vtctld-commands
Jun 1, 2026
Merged

Add throttler subcommands to branch vtctld#1261
nickvanw merged 1 commit into
mainfrom
nick/throttler-vtctld-commands

Conversation

@nickvanw
Copy link
Copy Markdown
Contributor

@nickvanw nickvanw commented Jun 1, 2026

Adds a throttler command group under pscale branch vtctld for inspecting and configuring the Vitess tablet throttler.

Commands

Command Scope Description
throttler status <db> <branch> --tablet-alias … tablet Read the live throttler status from a single tablet
throttler check <db> <branch> --tablet-alias … tablet Issue a throttler check against a single tablet
throttler update-config <db> <branch> --keyspace … --enabled keyspace Update the keyspace throttler configuration

status and check are tablet-scoped — tablet aliases are discoverable via pscale branch vtctld list-tablets. update-config is keyspace-scoped.

Behavior notes

  • update-config requires --enabled explicitly, since there is no "leave unchanged" state; passing it wrong way would otherwise silently disable the throttler.
  • Optional flags (--threshold, --app-name, --scope, --skip-request-heartbeats, --ok-if-not-exists) are only sent when provided, so the server applies its defaults otherwise.
  • All three pretty-print the JSON response, consistent with the existing list-keyspaces / list-workflows commands.

Bumps planetscale-go to v0.165.0 for the throttler client methods.

Testing

Added tests for each subcommand covering request mapping, required-flag enforcement, and omitted-optional behavior. go build, go vet, gofmt, and golangci-lint all pass.

Add a `throttler` command group under `pscale branch vtctld` for
inspecting and configuring the Vitess tablet throttler:

  pscale branch vtctld throttler status        <db> <branch> --tablet-alias ...
  pscale branch vtctld throttler check         <db> <branch> --tablet-alias ...
  pscale branch vtctld throttler update-config <db> <branch> --keyspace ... --enabled

status and check are tablet-scoped; aliases are discoverable via
`list-tablets`. update-config is keyspace-scoped and requires --enabled
explicitly (there is no "leave unchanged" state). Optional flags such as
--threshold and the check flags are only sent when provided, letting the
server apply its defaults.

Bumps planetscale-go to v0.165.0 for the throttler client methods.
@nickvanw nickvanw requested a review from a team as a code owner June 1, 2026 18:37
@nickvanw nickvanw enabled auto-merge June 1, 2026 18:38
@nickvanw nickvanw merged commit 0ea2138 into main Jun 1, 2026
4 checks passed
@nickvanw nickvanw deleted the nick/throttler-vtctld-commands branch June 1, 2026 18:40
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