Skip to content

keyspace create: add --max-rollout flag - #1533

Open
darwich6 wants to merge 3 commits into
mainfrom
cursor/keyspace-create-max-rollout-f93f
Open

darwich6 wants to merge 3 commits into
mainfrom
cursor/keyspace-create-max-rollout-f93f

Conversation

@darwich6

@darwich6 darwich6 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Do not merge until the API accepts max_rollout on keyspace create and that change is deployed. Today the create endpoint silently drops unknown params, so this flag would be accepted by the CLI and then do nothing.

Adds --max-rollout (1–32, optional) to pscale keyspace create, matching keyspace update-settings --max-rollout (#1404).

  • Omitted: max_rollout is not sent (omitempty pointer), so the API picks a default based on the shard count.
  • Set: validated 1–32 before any API call, then sent as max_rollout.
  • If the created keyspace comes back without the requested value (for example, an API that ignores it), a warning goes to stderr with the update-settings command to apply it. JSON stdout is unchanged.
  • The range check is shared with update-settings. Both flags now default to 0, so --help no longer shows a misleading "(default 1)".

Tests:

  • TestKeyspace_CreateCmd passes --max-rollout 8, asserts it on the request, and asserts no warning when the response carries it; TestKeyspace_CreateCmdOnlyClusterSize asserts it is nil when omitted.
  • TestKeyspace_CreateCmdRejectsOutOfRangeMaxRollout (0 and 33 rejected; no API call).
  • TestKeyspace_CreateCmdWarnsWhenMaxRolloutNotApplied: the response lacks the value, so stderr has the warning.
  • TestKeyspaces_Create asserts the exact request body, so the field is not serialized when unset.

make test and make lint pass. Live-tested on a dev cluster on 2026-11-19: create with --max-rollout, the not-applied warning when the server ignores it, update-settings, and local rejection of 0 and 33.

Open in Web Open in Cursor 

@darwich6
darwich6 marked this pull request as ready for review November 20, 2026 02:30
@darwich6
darwich6 requested a review from a team as a code owner November 20, 2026 02:30

This branch has not been deployed

No deployments
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