Skip to content

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
fix/csi-clone-and-restore-idempotencyfrom
fix/name-case-folding
Open

Andrei Kvapil (kvaps) wants to merge 3 commits into
fix/csi-clone-and-restore-idempotencyfrom
fix/name-case-folding

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

LINSTOR names are case-insensitive, and the store addresses one object through the folded CRD slug, so PVC-X and pvc-x are 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-X over pvc-x that 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 Get of 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 modify and the CLI stored a layer stack as the caller spelled it while some readers compare exactly: the satellite controller 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, 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.
  • The conformance subtests ChildrenOfDefinitionUnderAnySpelling and ListByNodeUnderAnySpelling run on both stores; reverting the spelling set, the write canonicalisation or the in-memory fold reddens them.
  • The layer-stack write paths and the satellite check were each reverted, and the named test fails.
  • TestCSILayerListIsStoredInCanonicalCase sends a lowercase layer_list through 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 known pkg/rest shutdown flake.
  • go test -tags=integration ./tests/integration/...: one failure in a full run, TestGroupFRDeleteCascadesSnapshots timing 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 known Eventually flake, but I'm naming it.
  • golangci-lint 2.11.4 (the CI pin) over the whole tree: clean.
  • Not run on a stand.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0558c095-86e2-4876-a9e2-020d5558790a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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>
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>
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