Repository navigation
fix(store): find replicas and snapshots in any name spelling, store layer stacks in canonical case - #217
Open
Andrei Kvapil (kvaps) wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…al case rd create, rg create and rg modify validated a layer stack case-insensitively and stored it as the caller spelled it, and so did the CLI. Some readers compare the stored value exactly: the satellite controller's DRBD check read `drbd,storage` as a stack without DRBD, so allocation waited and requeued while the apply path brought DRBD up. Every write path now stores the canonical spelling, and the satellite check folds case for objects written before this or applied by hand. Fixes #204 Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
LINSTOR names are case-insensitive and the store addresses one object through the folded CRD slug, but a replica or snapshot keeps its definition's name in spec and the field selector compares it exactly. A listing asked in another spelling came back empty. On `rd d PVC-X` over `pvc-x` that let the snapshot gate pass and the cascade reap nothing, and the folded delete then took the definition and left its replicas and snapshots behind. The node-scoped listing had the same gap for node names. The Kubernetes store now lists under the given, the folded and the registered spelling, and stores new replicas under their definition's and their node's registered spelling, and snapshots under their definition's, so rows written through the store always fall under one the listing asks. The in-memory store folds its comparisons to match. Every caller of these listings gets the fix, on the REST doors and in the CLI. Fixes #194 Fixes #212 Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Andrei Kvapil (kvaps)
force-pushed
the
fix/name-case-folding
branch
from
October 24, 2026 21:53
6aef318 to
bf57f52
Compare
Autoplace, explicit resource create and make-available each store a definition's first stack from a CSI layer_list. Pin that a lowercase list reads back in canonical case on every one of them. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
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.
LINSTOR names are case-insensitive, and the store addresses one object through the folded CRD slug, so
PVC-Xandpvc-xare the same definition. A replica or snapshot keeps its definition's name in spec, though, and the field selector compares it exactly. A listing asked in another spelling came back empty.On
rd d PVC-Xoverpvc-xthat let the snapshot gate pass over snapshots it could not see, the cascade reaped nothing, and the folded delete took the definition and left its replicas and snapshots behind, with DRBD still up under them. The new envtest test reproduces it: before the fix the delete answers 200 over a definition with a snapshot. The node-scoped listing had the same gap for node names (#212).The Kubernetes store now lists a definition's replicas and snapshots, and a node's replicas, under the given, the folded and the registered spelling. It stores new replicas under their definition's and their node's registered spelling, and snapshots under their definition's, so rows written through the store always fall under one the listing asks. For the common all-lowercase name that is one spelling and one query, as before, plus one
Getof the definition or node (cached on the REST door, from the API server on the node-scoped and uncached reads).Rows written before this in a fourth spelling, neither the asked, the folded nor the registered one, stay out of reach. Nothing is deployed on such data yet, so there is no migration for it. The in-memory store folds its comparisons to match, and a conformance test pins both. Every caller of these listings gets the fix, on the REST doors and in the CLI.
The layer stack had the same problem (#204):
rd create,rg create,rg modifyand the CLI stored a layer stack as the caller spelled it while some readers compare exactly: the satellite controller readdrbd,storageas a stack without DRBD, so allocation waited and requeued while the apply path brought DRBD up. Every write path now stores the canonical spelling, the autoplace paths that give a definition its first stack included, and the satellite check folds case for objects written before or applied by hand.Stacked on #190.
Fixes #194
Fixes #204
Fixes #212
Testing
TestRDDeleteInAnotherCaseSeesSnapshotsAndReplicas(envtest) fails with the spelling set reverted and passes with it.ChildrenOfDefinitionUnderAnySpellingandListByNodeUnderAnySpellingrun on both stores; reverting the spelling set, the write canonicalisation or the in-memory fold reddens them.TestCSILayerListIsStoredInCanonicalCasesends a lowercaselayer_listthrough autoplace, resource create and make-available. Reverting the canonicalisation at each of them fails its own subtest.go test ./...with envtest assets: green apart from the knownpkg/restshutdown flake.go test -tags=integration ./tests/integration/...: one failure in a full run,TestGroupFRDeleteCascadesSnapshotstiming out its 30s wait; it then passed 7 times in a row on its own. All-lowercase names take the same single query as before, so I read it as the knownEventuallyflake, but I'm naming it.