Skip to content

fix(api): a migrated volume is found under the id its PV names - #1697

Open
schmidt-scaled wants to merge 2 commits into
mainfrom
fix/volume-lookup-ns-uuid
Open

schmidt-scaled wants to merge 2 commits into
mainfrom
fix/volume-lookup-ns-uuid

Conversation

@schmidt-scaled

Copy link
Copy Markdown
Contributor

Migration and fail-back give a volume a new record id, while its namespace keeps the original one (LVol.ns_uuid). A PV names the original id for life, so every v2 lookup the CSI made for a migrated volume answered 404 in both clusters.

Bed bf28 (2026-11-19): vol-1's PV names 731ff4bb, and the volume now lives on cluster B as record 46a93411 with ns_uuid=731ff4bb. The CSI reconnect loop failed with "volume … not found in any pool" and could not restore the paths a node crash had taken, so the volume ran on 1 of 6 paths. Operator #929's cross-cluster resolver assumes a migrated volume keeps its id. With this change that lookup succeeds without any CSI change.

_lookup_volume falls back to the pool's live volume whose ns_uuid is the requested id: online first, then newest. It does this both when the id is unknown and when the record found belongs to another pool (the kept source). Every /volumes/{id}/… route uses this lookup, including detail and connect.

Tests: tests/unit/web/api/v2/test_volume_lookup_ns_uuid.py (6 tests). The v2 API unit suite passes (661).

🤖 Generated with Claude Code

Migration and fail-back give the volume a new record id; its namespace keeps
the original one (LVol.ns_uuid). A Kubernetes PV names the original id for
life, so every v2 lookup the CSI made for a migrated volume answered 404 in
both clusters. Bed bf28 (2026-11-19): the CSI reconnect loop could not
restore the paths a node crash had taken and vol-1 ran on 1 of 6 paths.

_lookup_volume falls back to the pool's live volume whose ns_uuid is the
requested id (online first, then newest), both when the id is unknown and
when the record found belongs to another pool (the kept source).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the target/main Targets the development branch label Nov 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/main Targets the development branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants