Skip to content

feat(lvol): align shared subsystems with pools (one pool per subsystem) - #1345

Open
schmidt-scaled wants to merge 1 commit into
mainfrom
feature/pool-subsystem-affinity
Open

schmidt-scaled wants to merge 1 commit into
mainfrom
feature/pool-subsystem-affinity

Conversation

@schmidt-scaled

Copy link
Copy Markdown
Contributor

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_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, so the FDB conflict retry is deterministic): 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), 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.

No DB schema change: pool membership of a subsystem is derived from LVolMini.pool_uuid of 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

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)
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.

2 participants