Skip to content

Rename the shrink disk scaling strategy to fixed - #1551

Draft
maxenglander wants to merge 1 commit into
mainfrom
maxeng/keyspace-fixed-disk-scaling
Draft

maxenglander wants to merge 1 commit into
mainfrom
maxeng/keyspace-fixed-disk-scaling

Conversation

@maxenglander

Copy link
Copy Markdown
Contributor

Problem:

pscale keyspace update-settings --disk-scaling-strategy shrink sets dedicated disks to --storage in either direction and turns off automatic growth. A target larger than the current disks grows them, so "shrink" is the wrong name.

There is also no way to set a minimum disk size under grow: --storage is only accepted with shrink.

Solution:

  1. Rename the strategy to fixed. --disk-scaling-strategy shrink still works: it prints a deprecation warning and sends fixed.
  2. Document --storage with grow as the minimum disk size. Smaller disks grow to it, and larger disks are left as they are.

Requires the API to accept fixed and storage_bytes with grow. Release after that is deployed.


Security impact:

None.


Testing:

  • Unit
  • Against a local API with the matching change
$ pscale keyspace update-settings db main ks --disk-scaling-strategy grow --storage 20GiB --format json | jq .storage
{ "storage_bytes": 21474836480, "max_storage_bytes": 4398046511104, "max_storage_bytes_managed_by_staff": false, "disk_scaling_strategy": "grow" }

$ pscale keyspace update-settings db main ks --disk-scaling-strategy fixed --storage 16GiB --format json | jq .storage
{ "storage_bytes": 17179869184, "max_storage_bytes": 4398046511104, "max_storage_bytes_managed_by_staff": false, "disk_scaling_strategy": "fixed" }

$ pscale keyspace update-settings db main ks --disk-scaling-strategy shrink --storage 16GiB
Warning: --disk-scaling-strategy shrink is deprecated, use fixed instead.
...  DISK SCALING STRATEGY   STORAGE   MAX STORAGE
...  fixed                   16 GiB    4.0 TiB

$ pscale keyspace update-settings db main ks --disk-scaling-strategy sideways
Error: invalid --disk-scaling-strategy "sideways", must be one of: grow, disable, fixed

`--disk-scaling-strategy fixed` sets dedicated disks to `--storage` in either
direction and turns off automatic growth. `shrink` is still accepted as a
deprecated alias and is sent as `fixed`.

`--storage` is now also accepted with `grow`, where it sets the minimum disk
size.

Signed-off-by: Max Englander <max@planetscale.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

1 participant