Skip to content

catalog: correct the swap null contract on console utilization views - #39066

Merged
leedqin merged 1 commit into
MaterializeInc:mainfrom
leedqin:swap-null-contract
Sep 23, 2026
Merged

leedqin merged 1 commit into
MaterializeInc:mainfrom
leedqin:swap-null-contract

Conversation

@leedqin

@leedqin leedqin commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #39034, addressing the QA review finding on that PR.

The problem

CONSOLE_MEMORY_SHARES_SQL claims a replica size that cannot swap reports null for swap_of_ram_percent. The Kubernetes orchestrator does not produce that. collect_heap_usage returns Some(vm_swap) whenever /proc/self/status is readable, and vm_swap is 0 for a process with no swap — so a non-swap size reads 0, indistinguishable from a swap-enabled replica sitting idle.

Null means no sample at all: the process orchestrator, a failed clusterd usage fetch, or history rows predating the column. None of those mean "this size cannot swap".

The claim was wrong in the NOTE, the commit message and the PR description of #39034, and the Console follow-up was going to be built on it. A chart gating its swap layer on null would have drawn an empty layer on every non-swap size.

The fix

heap_limit_percent already carries the capability signal, with no extra column and no join. heap_limit is mem_limit + swap_limit from the cgroup, so it equals the RAM allocation exactly when no swap is granted:

heap_limit_percent > 1.0   ->  the size can swap
heap_limit_percent = 1.0   ->  it cannot

So the contract becomes: gate the swap layer on heap_limit_percent, not on nullness. Both a non-swap size and an idle swap-enabled replica report swap 0; the ceiling is what separates them.

The test

The slt asserted the old contract against a hand-built null row, so it was really testing how MAX propagates null, not what the views produce for a non-swap size — it passed while the property it named was false in production. It now covers the real case: r1 can swap and is not, r7 cannot swap, and the two are separated by the ceiling.

r1  0  1.25  true
r7  0  1     false

The alternative I did not take

Deriving the null from swap_enabled in mz_internal.mz_cluster_replica_size_internal would make the original claim true. It costs a join in each of the three indexed views on mz_catalog_server — which #39034 went to some length to avoid, measuring and rejecting an argmax for +6 operators and +3 arrangements per view — and it buys nothing heap_limit_percent does not already express.

Release notes

No user-facing release note. These views are mz_internal and marked RELATION_SPEC_UNDOCUMENTED; they exist for the Console.

🤖 Generated with Claude Code

CONSOLE_MEMORY_SHARES_SQL claimed that a replica size which cannot swap reports
null for swap_of_ram_percent. That is not what the Kubernetes orchestrator
produces. collect_heap_usage returns Some(vm_swap) whenever /proc/self/status
is readable, and vm_swap is 0 for a process with no swap, so a non-swap size
reads 0 here, indistinguishable from a swap-enabled replica that is idle.

Null means no sample at all: the process orchestrator, a failed clusterd usage
fetch, or history rows predating the column. None of those mean "this size
cannot swap".

heap_limit_percent already carries the capability signal and needs no extra
column or join: heap_limit is mem_limit + swap_limit from the cgroup, so it
equals the RAM allocation exactly when no swap is granted. A consumer deciding
whether to draw a swap layer should gate on heap_limit_percent > 1.0 rather
than on a null swap reading, which would leave an empty layer on every non-swap
size.

The slt asserted the old contract against a hand-built null row, so it tested
how MAX propagates null rather than what the views produce for a non-swap size.
It now covers both: r1 can swap and is not, r7 cannot swap, and the two are
separated by the ceiling rather than by nullness.

Deriving the null from swap_enabled in mz_cluster_replica_size_internal was the
alternative. It would cost a join in each of the three indexed views on
mz_catalog_server, which the original change went to some length to avoid, and
it buys nothing heap_limit_percent does not already express.
@leedqin
leedqin merged commit a87a882 into MaterializeInc:main Sep 23, 2026
84 checks passed
@bosconi bosconi mentioned this pull request Sep 25, 2026
maheshwarip added a commit that referenced this pull request Oct 2, 2026
The v26.44.0 release-note train, one commit per snapshot. Dates in RC
snapshots are provisional until the release ships; the final snapshot
sets the real dates.

**rc.1** adds the `## v26.44.0` section — 6 Improvements, 3 Agent
Skills, 4 Bug Fixes — and the `v26.44` row in the self-managed operator
compatibility table. No Features section: nothing in this snapshot's 144
in-scope PRs rises to one. The Agent Skills section is back after five
empty windows — the window `(2026-09-23T16:49:13Z,
2026-09-25T02:18:32Z]` holds 4 PRs and all 4 are published.

**final** sets the real dates and adds no new bullets. Nothing shipped
on the materialize side between `v26.44.0-rc.1` and the `v26.44.0` tag:
`GET /compare/v26.44.0-rc.1...v26.44.0` is `ahead_by: 1`, and that one
commit is the version bump, so every `rc.1` classification and all four
verified flag defaults still hold at the ship tag. This train has only
one RC (no `v26.44.0-rc.2` tag exists). Its two changes are:

- **Real dates**: Cloud **2026-09-30**, Self-Managed **2026-10-01**,
from the `v26.44.0` tag's commit date (`2026-09-30T10:50:59Z`) and `+1
day` — one day earlier than the provisional pair rc.1 carried, exactly
as rc.1 predicted. Both date lines in `_index.md` and the `Release
date:` in the YAML are updated.
- **One cross-snapshot rewrite, not a new bullet**:
[agent-skills#74](MaterializeInc/agent-skills#74)
finishes the `mz-` rename that
[#68](MaterializeInc/agent-skills#68) left
`materialize-docs` out of. Rather than publishing a second Agent Skills
bullet saying skills were renamed to `mz-`, `materialize-docs` is now
`mz-docs` is folded into the existing **`mz-` skill names** bullet as
another example. The rc.1 snapshot directory is left as the record of
what was reviewed at the time.

The final commit preserves the two Features a human editor added to this
branch — **SCIM group-to-role mapping is generally available** and
**Operational dashboards for Self-Managed** — and leaves the
Improvements and Bug Fixes sections untouched.

⚠️ **Reviewer checks**

- **The hedged-reads entry has an open testing caveat — still open, and
the one entry to cut if it stays open.** #39110 flips
`persist_blob_hedged_get_enabled` to `true` in the code default, which
is what carries the capability to Self-Managed — Cloud has served it on
through LaunchDarkly since 2026-09-24. But the PR states that real GCS
and Azure object stores are not yet tested (CI covers MinIO and Azurite)
and that testing under
[PER-120](https://linear.app/materializeinc/issue/PER-120) "should
finish before this reaches self-managed users." Nothing in the `final`
increment resolves this, and Linear was not reachable from that run.
**If [PER-120](https://linear.app/materializeinc/issue/PER-120) has not
closed, cut this entry before merging.** It is the only conditional
entry in the release.
- **The balancerd connection-limit entry changes the meaning of
something already published.** `balancerd_max_connections` shipped an
entry in v26.42.0 rc.2 describing over-limit connections as "rejected
with an error". #38854 removes that: the `TOO_MANY_CONNECTIONS` response
and the HTTPS 503 are gone, and a client over the limit now sees libpq's
"server closed the connection unexpectedly". Anyone who built alerting
on the v26.42.0 wording needs this.
- **Two PRs are excluded as already published by the v26.43.0 train** —
#38615 and #39029. Both merged to `main` inside the rc.1 window and were
cherry-picked onto the v26.43 release branch, where that train's rc.2
snapshot published them. Accounted for in `omitted.md` under "Already
published in an earlier release".
- **This branch will need a rebase if the v26.43.0 docs PR merges
first.** `_index.md` here still jumps from `## v26.44.0` to `##
v26.42.0` — the v26.43.0 section is absent because that train's PR
([#38928](#38928)) has
not merged. Whichever of the two merges second needs the rebase to get
the sections in version order.
- **Resolved:** rc.1's provisional dates were flagged as very likely one
day high. They were — the `final` snapshot corrects them down by one
day, on the tag date.

**Inclusion rate is 9.7% (14/144) at rc.1**, inside the usual 5–15%
band, and **20% (1/5) at `final`**, which reads high only because the
denominator is five. The rc.1 denominator is dominated by dependency
automation — 91 of the 142 materialize PRs are dependency bumps, 65 of
them a single Dependabot fan-out of the
`materialize-terraform-self-managed` modules across five
`test/terraform` directories. Strip those and the materialize side is 10
included out of 49.

Snapshot drafts (with PR links) in mz-skills:
- rc.1:
[release_notes.md](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/rc.1/release_notes.md)
/
[omitted.md](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/rc.1/omitted.md)
- final:
[release_notes.md](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/final/release_notes.md)
/
[omitted.md](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/final/omitted.md)

**Borderline PRs omitted:** rc.1: 7 — [review borderline
calls](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/rc.1/omitted.md#borderline),
final: 0 —
[none](https://github.com/MaterializeInc/mz-skills/blob/main/data/mz-release-notes/v26.44.0/final/omitted.md#borderline).

The rc.1 borderline calls are unchanged by seeing the whole release,
since `final` adds no materialize PRs. Two are still worth a reviewer's
eye: #39125 (the local kind install guide moving to RustFS) — the
documented Self-Managed local-kind install **fails today** for every
published tag, because their `minio.yaml` references a Docker Hub
repository MinIO deleted, and this is the likeliest restoration; and
#39034/#39066 (the catalog half of the Console cluster-utilization
memory and swap columns) — **if that Console PR shipped in this release,
it belongs in the notes as a Console improvement.** Three further items
are gated on flags (`enable_upsert_v2`,
`enable_compute_index_peek_offload`, `enable_unified_cluster`).

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Valerie Chiang <[email protected]>
Co-authored-by: Pranshu Maheshwari <[email protected]>
Co-authored-by: Pranshu Maheshwari <[email protected]>
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