Repository navigation
Conversation
QA LLM Review1. MEDIUM -- Two ALTER CLUSTER paths never authorize HYDRATION SIZE, so the size allow-list is now bypassable
Dropping the controller's allow-list check assumes that DDL has already authorized every size the controller realizes. That is false for the graceful reshape path and for the unmanaged-to-managed conversion, which both commit an Details
Repro, with CREATE CLUSTER c (SIZE 'scale=1,workers=1');
-- SIZE change routes to reshape; the strategy is committed unchecked
ALTER CLUSTER c SET (SIZE 'scale=1,workers=2', AUTO SCALING STRATEGY = (ON HYDRATION (HYDRATION SIZE = 'scale=2,workers=2')));
CREATE CLUSTER u REPLICAS (r1 (SIZE 'scale=1,workers=1'));
ALTER CLUSTER u SET (MANAGED, AUTO SCALING STRATEGY = (ON HYDRATION (HYDRATION SIZE = 'scale=2,workers=2')));When a burst arms on either cluster, A fix is to authorize these sizes in the two DDL paths before relying on DDL-only authorization. Check |
The cluster controller realizes configurations accepted by DDL. Checking the owner's current size allow-list again can strand refresh schedules and hydration bursts, and block allowed resizes in the same decision batch. Concretize controller replicas without a size allow-list. Keep allocation lookup, disabled-size checks, availability-zone configuration, and transactional resource limits unchanged. DDL remains responsible for authorizing requested sizes. Extend cluster-controller testdrive coverage for refresh wake-up and hydration bursts after the allow-list shrinks, including DDL rejection and an allowed resize while the retained burst is active. Fixes SQL-564. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ab00-89fa-7525-ad7f-a802e235a04b Co-authored-by: Amp <amp@ampcode.com>
An empty unmanaged cluster has no accepted replica size to inherit. Validate its explicit SIZE against the invoking role's allow-list and the size map before committing the managed configuration. Keep sizes adopted from existing replicas valid after the allow-list shrinks. Extend cluster-controller coverage for disallowed, unknown, and disabled sizes, successful empty-cluster conversion, and retention of an existing size. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ab00-89fa-7525-ad7f-a802e235a04b Co-authored-by: Amp <amp@ampcode.com>
b53f06d to
1609f3c
Compare
|
one issue was already addressed by my concurrent #40447, pushed a fix for the other issue |
ggevay
left a comment
There was a problem hiding this comment.
LGTM. One inline suggestion and three notes.
-
Description: it becomes the commit message, but it doesn't mention the conversion change.
SET (MANAGED, SIZE = ...)on an empty cluster now rejects sizes that are off the allow-list, unknown or disabled. Main stores all three. -
SQL-564:
Fixescloses the issue, but its second fix, distinguishable errors for missing, off-list and disabled sizes, isn't in this PR. The new tests still expect "unknown cluster replica size" for all three. Should this PR sayPart ofinstead, or should we move that item to its own issue? -
Question, not blocking: should an unchanged SIZE skip the allow-list too, here or in a follow-up? DDL still re-validates it, so once SIZE has left the list, even
SET (REPLICATION FACTOR 0)fails with "unknown cluster replica size 100cc", unless the statement also moves SIZE to an allowed value. Main does this too, but with this PR the controller keeps provisioning replicas for such a cluster. It's your #39557 point about retired sizes.I tried it on this head (commit, no new tests, in case you want it): such ALTERs work, a new off-list size is still rejected, and the tests that exercise the allow-list pass. The catch is that REPLICATION FACTOR can then grow at an off-list size, as #39557 allows for disabled sizes.
| // DDL authorizes sizes before committing the configuration. Reconcile | ||
| // must still realize it if the owner's size allow-list later shrinks. |
There was a problem hiding this comment.
The list isn't per owner: it's one system variable, with only mz_system exempt. "DDL authorizes" also misses sizes that older releases stored through the conversion this PR fixes. Maybe:
| // DDL authorizes sizes before committing the configuration. Reconcile | |
| // must still realize it if the owner's size allow-list later shrinks. | |
| // The allow-list is a DDL-time check on the role writing a size. | |
| // Reconcile does not repeat it, so a size the current list rejects | |
| // still gets its replica, for example after the list shrinks. |
The cluster controller realizes configurations accepted by DDL. Checking the owner's current size allow-list again can strand refresh schedules and hydration bursts, and block allowed resizes in the same decision batch.
Concretize controller replicas without a size allow-list. Keep allocation lookup, disabled-size checks, availability-zone configuration, and transactional resource limits unchanged. DDL remains responsible for authorizing requested sizes.
Extend cluster-controller testdrive coverage for refresh wake-up and hydration bursts after the allow-list shrinks, including DDL rejection and an allowed resize while the retained burst is active.
Fixes SQL-564.