Repository navigation
Add IOPS and throughput settings to keyspace update-settings - #1524
inelpandzic wants to merge 7 commits into
Conversation
The API ignores storage iops and throughput_mibs for organizations without configurable disk I/O, and API versions without the feature drop the unknown keys. Both still answer with success, so the command exited 0 although nothing changed. Check the returned keyspace and return an error when a requested value is missing or differs.
The API returns iops_configurable, min_iops, max_iops and min_throughput_mibs next to the IOPS and throughput values. The CLI dropped them, so --format json had no way to pick a valid value. Keep the fields, and mark storage class defaults that cannot be changed in the settings table. Add wire tests for the IOPS request and response.
The API clears an IOPS or throughput override when the value is null, so the storage class default applies again. The CLI could only send positive values, so an override could not be removed. Setting the default value explicitly is not the same: it keeps the override and diverges when the storage class default differs. Encode a reset as an explicit null, reject combining a value and a reset for the same setting, and check that the API applied the reset.
The help said IOPS go up to 80000, but the API caps them at 10000 unless larger cluster sizes are enabled for the organization. It also did not say that the flags only work on AWS gp3 disks with configurable disk I/O enabled. Point to the reported min_iops and max_iops.
The interactive form returns before the other flags are read, so a command like `update-settings -i --storage-iops 6000` silently dropped the IOPS change. Mark --interactive mutually exclusive with every other flag.
Test zero, negative and out of range values for both flags, and that a single flag leaves the other value out of the request so the API keeps it. Rename the happy path test, which covers throughput too.
maxenglander
left a comment
There was a problem hiding this comment.
Reviewed for correctness, safety and backwards compatibility. Two compatibility notes below.
|
|
||
| // The interactive form only covers some settings and returns before the | ||
| // other flags are read, so they would be silently ignored. | ||
| cmd.Flags().VisitAll(func(f *pflag.Flag) { |
There was a problem hiding this comment.
This makes --interactive mutually exclusive with every other local flag, which breaks existing usage. pscale keyspace update-settings db br ks -i --max-rollout 2 used to work (the extra flag was ignored) and now fails with cobra's if any flags in the group [interactive max-rollout] are set none of the others can be. Could this be limited to the new IOPS/throughput flags, or warn instead of error?
| DiskScalingStrategy string `header:"disk scaling strategy" json:"disk_scaling_strategy"` | ||
| StorageBytes string `header:"storage" json:"storage_bytes"` | ||
| MaxStorageBytes string `header:"max storage" json:"max_storage_bytes"` | ||
| IOPS string `header:"iops" json:"iops"` |
There was a problem hiding this comment.
The table/CSV output of keyspace settings / update-settings now always gets iops and throughput columns. That shifts the layout for CSV consumers reading columns by position. Orgs without the flag also see not set, which reads as "no provisioned IOPS" even though the disks have the class's IOPS. Maybe omit the columns when the API doesn't return the fields, or show the class default?
This adds
--storage-iopsand--storage-throughputtopscale keyspace update-settings, so the provisioned IOPS and throughput of a keyspace's AWS gp3 disks can be changed in place, without replacing disks.--reset-storage-iopsand--reset-storage-throughputclear an override so the storage class default applies again.pscale keyspace settingsshows the current values, and--format jsonalso includes the configurable range (min_iops,max_iops,min_throughput_mibs) andiops_configurable.The API ignores these settings when configurable disk I/O isn't enabled for the organization. The command checks the returned keyspace and fails if a requested value wasn't applied, instead of reporting success.
--interactivecan no longer be combined with other setting flags, which it silently ignored.The API changes need to be live before this is released.