Repository navigation
Fix durability volume placement handling - #641
Hrishikesh Kashyap (Hrishikeshkashyap) wants to merge 6 commits into
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
Add the storage-node requirement to every non-empty required selector term instead of appending a bypassable OR term. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Give durability volumes precedence over availability volumes and intersect their resolved node sets. Deny admission when durability placement is missing or has no common node. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject Pods that reference missing ordinary PVCs so placement is recalculated on a later CREATE. Preserve generic ephemeral and unbound WFFC claims while continuing to enforce resolved durability volumes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain hard topology and owner metadata for durability volumes. Reject wrong-node staging and require an existing LV instead of allocating an empty replacement, while preserving availability recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document affinity composition, multi-volume aggregation, unresolved PVC handling, CSI durability hardening, and live cluster verification results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover missing, unbound, and generic-ephemeral claims; affinity composition and volume aggregation; retained topology, owner validation, and existing-only LVM staging. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e71e57f to
f5eb2ad
Compare
There was a problem hiding this comment.
🟡 Changes recommended
CSI topology-key handling and CreateVolume idempotency remain incorrect.
3 open findings
What changed in this PR
Hardens durability placement across admission, provisioning, and staging.
Changes:
- Enforces intersected durability affinity and rejects unresolved PVC placement.
- Preserves durability topology and prevents wrong-node or empty-volume recovery.
- Expands regression tests and documentation.
| File | Description |
|---|---|
internal/webhook/hyperconverged/handler.go |
Enforces durability placement. |
internal/webhook/hyperconverged/handler_unit_test.go |
Adds affinity regressions. |
internal/webhook/hyperconverged/handler_test.go |
Extends webhook integration coverage. |
internal/csi/node/node.go |
Validates ownership during staging. |
internal/csi/node/node_test.go |
Tests durability staging. |
internal/csi/core/lvm/node.go |
Adds existing-only ensure operation. |
internal/csi/core/lvm/lvm.go |
Prevents replacement LV allocation. |
internal/csi/core/lvm/lvm_test.go |
Tests existing-only behavior. |
internal/csi/core/interfaces.go |
Extends the node interface. |
internal/csi/core/fake.go |
Supports staging-path tests. |
internal/csi/controller/controller.go |
Persists failover metadata and topology. |
internal/csi/controller/controller_test.go |
Tests durability provisioning. |
docs/user-guide.md |
Documents durability behavior. |
docs/design/webhooks.md |
Updates placement design. |
docs/design/pv-recovery.md |
Describes mode-specific recovery. |
docs/architecture.md |
Updates architectural guarantees. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Normalize missing or invalid values to the availability policy. | ||
| failoverMode := core.FailoverModeAvailability | ||
| switch req.GetParameters()[core.FailoverModeParam] { | ||
| case core.FailoverModeDurability: | ||
| failoverMode = core.FailoverModeDurability |
| if requirement.Key != corev1.LabelHostname || | ||
| requirement.Operator != corev1.NodeSelectorOpIn { | ||
| continue | ||
| } |
| if requirement.Key == KubernetesNodeHostNameLabel && | ||
| requirement.Operator == corev1.NodeSelectorOpIn { | ||
| nodes = append(nodes, requirement.Values...) | ||
| } |
|
Could you split this into separate PRs for affinity composition, multi-volume placement, claim resolution/admission policy, and CSI durability enforcement, each with its relevant tests and docs? They share a durability-placement theme, but each fix or behavior change may need a different amount of discussion. For example, rejecting Pods with missing PVCs deserves separate consideration from fixing affinity composition. Splitting them would let us review and merge straightforward fixes without blocking them on changes that need more discussion. |
|
Superseded by four focused pull requests as requested:
|


Several durability placement gaps could let a Pod bypass storage restrictions, combine durability volumes that do not share a node, or recreate missing durability storage on another node. This PR makes durability placement mandatory from admission through staging while preserving availability-mode recovery.
Type of Change
Description
Admission and scheduling
<pod-name>-<volume-name>for generated generic-ephemeral claim names.CSI defense in depth
CreateVolume.AccessibleTopologyfor durability volumes while availability volumes continue using webhook-managed placement.NodeStageVolumechanges metadata or touches LVM.NotFoundwhen the LV is missing.Behavior Change
A Pod that references a missing ordinary PVC is now denied. The caller must create the PVC and retry Pod creation so admission can resolve and enforce all storage placement constraints. Missing generated generic-ephemeral claims and initially unbound WaitForFirstConsumer claims remain supported.
How Has This Been Tested?
NotFoundand were not recreated.CSI Conformance
CreateVolumeandNodeStageVolumebehavior against CSI specification v1.12.0.FailedPrecondition; missing durability metadata or LV usesNotFound.Checklist