Skip to content

feat(api): default KVCacheBackend leader.multiTenancy to true - #695

Merged
thxCode merged 1 commit into
mainfrom
kvcb-multitenancy-default
Sep 28, 2026
Merged

thxCode merged 1 commit into
mainfrom
kvcb-multitenancy-default

Conversation

@thxCode

@thxCode thxCode commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind enhancement
/kind api-change
/area worker

What this PR does / why we need it:

Defaults KVCacheBackend's leader.multiTenancy to true (*bool with +k8s:validation:default=true; every reader goes through MultiTenancyEnabled(), which reads an unset field as the schema default, so an object that never passed the API server answers the same as one that did).

The tenant ledger is what makes the rest of this API mean what it says: without it a KVCachePoolBinding's ceiling is recorded but not enforced, and a master serves one reuse domain only, so a second Binding on it is refused. Mooncake has taken the -enable_multi_tenants switch since 0.3.12 — verified against the upstream tags: absent from v0.3.10.post2 and v0.3.11, present from v0.3.12 on — and the default store image is on 0.3.13.post1. KVCacheBackend has not shipped in any release tag, so the default changes before anyone upgrades into it.

Omitting the key and writing multiTenancy: false are now different things: only the explicit false renders no switch. A store image older than Mooncake 0.3.12 does not recognize the switch and its master exits at startup, so a backend on such an image — including the 0.3.10.post2 variants this project publishes — sets false explicitly.

Docs: backend.md records the 0.3.12 floor beside the build variants that need the opt-out, and the walkthrough's Step-1 backend now reads as the multi-tenant shape it renders.

Which issue(s) this PR links to:

None.

Special notes for your reviewer:

Upgrade note: an existing KVCacheBackend that never set the field reads as true under this build, so its leader is re-rendered with -enable_multi_tenants=true on the first reconcile after the upgrade — the leader restarts and the cached contents do not survive. A backend pinned to a store image older than Mooncake 0.3.12 must set leader.multiTenancy: false before the operator is upgraded, or its master exits at startup on the unknown flag.

Does this PR introduce a user-facing change?

action required: `KVCacheBackend`'s `leader.multiTenancy` now defaults to `true`. A backend pinned to a Mooncake store image older than 0.3.12 must set `leader.multiTenancy: false` explicitly — the default renders a switch such a master does not recognize, and it exits at startup. Any other backend that never set the field gains the per-tenant quota ledger on the first reconcile after the upgrade, which restarts its leader and does not preserve cached contents.

The tenant ledger is what makes the rest of the KV cache API mean what
it says: without it a KVCachePoolBinding's ceiling is recorded but not
enforced, and a master serves one reuse domain only, so a second
Binding on it is refused. Mooncake has taken the -enable_multi_tenants
switch since 0.3.12, and the default store image is on 0.3.13.post1.

The field becomes a pointer so omitting the key and writing
multiTenancy: false stay different: only the explicit false renders no
switch. A store image older than Mooncake 0.3.12 does not recognize
the switch and its master exits at startup, so a backend on such an
image, including the 0.3.10.post2 variants this project publishes,
sets false here. Readers go through MultiTenancyEnabled, which reads
an unset field as the schema default so an object that never passed
the API server answers the same as one that did.
@gpustack-code-review

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 9 selected item(s).

@thxCode
thxCode merged commit 3879479 into main Sep 28, 2026
10 checks passed
thxCode added a commit that referenced this pull request Sep 28, 2026
…Tenancy false (#696)

#695 made leader.multiTenancy default to true, but the pool page still
described the ledger-less master as the plain case. Say where a
ledger-less master now comes from: a managed backend that declares
leader.multiTenancy: false, which a store image older than Mooncake
0.3.12 has to, or an external master started without multi-tenancy.
The omitted domain name is now the tenant the engines are handed on a
multi-tenant master, so name each domain once a second Binding shares
it. The kubectl example reads from a managed backend's default.

Signed-off-by: thxCode <thxcode0824@gmail.com>
@thxCode
thxCode deleted the kvcb-multitenancy-default branch September 29, 2026 06:07
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