feat(lvol): align shared subsystems with pools (one pool per subsystem) - #1345
Open
schmidt-scaled wants to merge 1 commit into
Open
schmidt-scaled wants to merge 1 commit into
schmidt-scaled wants to merge 1 commit into
Conversation
A namespaced lvol used to join ANY subsystem on its node that had a free
namespace slot, picked at random, so a single NVMe-oF subsystem could
carry namespaces of several pools. Subsystems are now exclusive to a
pool and filled up pool by pool:
* get_next_available_subsystem_on_node takes the joining lvol's pool
(keyword-only, required) and only offers subsystems whose every
non-deleted member (in_creation included) belongs to that pool.
A legacy subsystem that already mixes pools is frozen -- never
offered for a join by any pool.
* fill order is most-occupied-first (ties on NQN, deterministic for
the FDB conflict retry): a pool fills one subsystem completely
(MAX_NAMESPACES_PER_SUBSYSTEM = 50) before a new one is opened;
a new subsystem is created only when none of the pool's subsystems
on the node has a free slot.
* the pool is threaded through every pick site: node placement
(_get_next_3_nodes has_ns_slot), the advisory pre-checks
(_resolve_lvol_subsystem, clone paths in lvol/snapshot controller)
and the authoritative FDB claim transaction
(DBController._claim_lvol_ns_slot_tx), including the -32602
re-claim after an SPDK rejection.
* --namespaced help text (CLI yaml + generated cli.py) describes the
per-pool behaviour.
Tests: pool-exclusivity, frozen mixed subsystems, in_creation pool
claim, fullest-first fill, determinism and required pool_id in
tests/unit/test_subsystem_limits.py; cross-pool claim + fill order
through the claim transaction in tests/unit/test_ns_slot_txn.py; node
placement / advisory resolve with another pool's free slot in
tests/integration/test_subsystem_limit.py.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit af2fe5b)
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.
Summary
Port of #1344 (R26.3) to main. Cherry-pick of the R26.3 commit; the only conflict was the picker function's neighbourhood on main (return-type style
LVol | None, and the carried-over SSE/HA helpers that follow it).A namespaced lvol used to join any subsystem on its node that had a free namespace slot (picked at random), so one NVMe-oF subsystem could carry namespaces from several pools. Subsystems are now exclusive to a pool and filled pool by pool:
get_next_available_subsystem_on_nodetakes the joining lvol's pool (keyword-only, required) and only offers subsystems whose every non-deleted member (in_creation included) belongs to that pool. A legacy subsystem that already mixes pools is frozen: never offered for a join by any pool.MAX_NAMESPACES_PER_SUBSYSTEM= 50) before a new one is opened. A new subsystem is created only when none of the pool's subsystems on the node has a free slot._get_next_3_nodes), the advisory pre-checks (_resolve_lvol_subsystem, clone paths in lvol/snapshot controller) and the authoritative FDB claim transaction (DBController._claim_lvol_ns_slot_tx), including the -32602 re-claim after an SPDK rejection.--namespacedhelp text (CLI yaml + generated cli.py) describes the per-pool behaviour.No DB schema change: pool membership of a subsystem is derived from
LVolMini.pool_uuidof its members inside the same snapshot read the slot count already uses.Tests
Same tests as #1344. Local run on main: 36 unit passed; mocked integration tests pass outside the FDB-gated tier (29 passed, 2 skipped); ruff and mypy clean on the changed modules.
🤖 Generated with Claude Code