cluster-spec-sheet: recreate the region for envd CPU changes - #38012
Open
aljoscha wants to merge 3 commits into
Open
cluster-spec-sheet: recreate the region for envd CPU changes#38012aljoscha wants to merge 3 commits into
aljoscha wants to merge 3 commits into
Conversation
`mz region enable --environmentd-cpu-allocation` on a region that still has durable state is a 0dt rollout, so the new environmentd comes up in read-only mode and only promotes after the caught-up stability period, ten minutes fleet-wide. The sweep soft-disabled the old envd away first, so nothing served SQL while we waited that out and the 300s readiness wait failed. Hard-disable instead: with no state left there is no predecessor generation to catch up with, the new envd promotes as soon as it has booted, and the sweep re-prepares the small amount of state it needs per scale point. Readiness also gets a positive check that we reached the recreated region (no user tables) plus sustained probes, since neither `mz region enable` nor a single query can tell a leftover envd from the new one.
A sweep now does a dozen region API calls and staging returns the occasional 502, which the CLI does not retry for us. Seen in spec-sheet build 29: the sweep got through four scale points and then `mz region enable` died with `status 502 Bad Gateway`.
Both region paths were spelling out the `mz region enable` invocation with its version and staging-override args, and the two readiness waits each carried their own psycopg connect block and poll loop. Pull out `enable_region`, `cloud_sql` and `_await_probe` so each of those lives in one place. No behavior change beyond the poll interval for the down-wait and the sustained-probe count for the Docker wait, which now match the cloud wait.
def-
approved these changes
Aug 3, 2026
def-
left a comment
Contributor
There was a problem hiding this comment.
Oh well, sounds expensive too!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The envd CPU sweeps have been failing against staging with
failed to apply Cloud CPU override for environmentd via 'mz region': never got correct result ... FATAL: upstream server not available(SQL-596).Nothing is wrong with the environment.
mz region enable --environmentd-cpu-allocationon a region that still has durable state is a 0dtrollout, so the new envd comes up read-only and only promotes after the
caught-up stability period:
Enabled at 06:19:48, caught up and healthy by 06:20:03, would have promoted at
~06:30. We wait 300s and give up at 06:25, and nothing serves SQL in between
because the soft disable took the old envd away. The
with_0dt_caught_up_check_stability_period=0swe pass via--environmentd-extra-argisn't in effect there (600000 is the compiled-indefault, and the region is hard-disabled at job start so there's no stale
ALTER SYSTEM SET). That's being followed up separately, this PR makes the test notdepend on it.
Description
Hard-disable instead of soft-disable: with no state left there's no predecessor
generation to catch up with, so the new envd promotes as soon as it has booted
and the gate never applies. The sweep re-runs
prepareper scale point, sincethe wipe takes its state with it (one table, one insert, both envd workloads
have an empty
setup()). Teardown's reset to the default allocation goesthrough the same recreate, so it can't leave the region in read-only limbo for a
following scenario.
Readiness gets an honest check, which is what let this hide. After the recreate
we assert the region has no user tables, which can only hold for a fresh region
and so rules out a leftover envd, and
wait_for_envdnow wants severalconsecutive probes instead of one, reports how long it waited, and allows 600s
instead of 300s. Neither
mz region enable(which only checks that somethinganswers on the SQL port) nor a single query can tell old envd from new, and
before this change the wait was returning one to two seconds after the
re-enable, which is well inside a real bring-up.
The second commit retries the disable/enable pair, because a sweep makes a dozen
region API calls and staging returns the occasional 502 that the CLI does not
retry itself.
Verification
Test-only. Ran on staging in spec-sheet build 29, where
qps_envd_strong_scalingpassed: all six scale points plus the teardown reset,each region recreate serving SQL after 6-9s, roughly two minutes per point end
to end. That scenario has been failing since build 27. Measured QPS matches
build 26, the last green run, within a few percent at every point but the
32-core one, which is a plateau in the benchmark unrelated to this change, see
SQL-596 for that.
Closes SQL-596