Skip to content

[R26.3] fix(stats): size lvol usage with the lvstore's own cluster_sz, not the current formula - #1515

Merged
wmousa merged 1 commit into
R26.3from
fix/lvol-used-size-from-lvstore-stack-R26.3
Oct 21, 2026
Merged

wmousa merged 1 commit into
R26.3from
fix/lvol-used-size-from-lvstore-stack-R26.3

Conversation

@wmousa

@wmousa wmousa commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Backport of the main PR (same title) to R26.3, hand-ported: this branch has no collect_lvol_record helper (the call is inline in main()) and is Python 3.9, so Optional[int] instead of int | None.

Problem

On a 26.3.2.1 cluster (2x2) sbctl lvol list reports 39.7 TiB used on a 21 TiB volume. 26.3.2 (#1387) changed create_lvstore to size an lvstore cluster at page_size × ndcs and the lvol stat collector to assume that size for every lvstore, but lvstores created on ≤ 26.3.1 use page_size × 1 and keep it. Every pre-existing lvstore is overcounted by ndcs. Display only.

Fix

Read the cluster size from the lvstore's persisted creation parameters in snode.lvstore_stack (what SPDK was given and replays on every restart) via a new StorageNode.lvstore_cluster_size(lvs_name), with the settings formula kept only as a logged fallback. Unit tests cover both cluster sizes, the full-volume case from the report, and the fallback.

Rollout

Only the LVolStatCollector service changes. Restart it with the new image; lvol list corrects itself on the next collection cycle.

🤖 Generated with Claude Code

…e current formula

Backport of the main fix to R26.3.

The lvol stat collector turns num_allocated_clusters into bytes with a
cluster size recomputed from the cluster settings (page_size x ndcs since
26.3.2, page_size x 1 before). An lvstore keeps the cluster size it was
created with, so on a cluster upgraded across 26.3.2 every pre-existing
lvstore is overcounted by ndcs: a customer's 2x2 cluster showed 39.7 TiB
used on a 21 TiB volume (2026-10-21).

create_lvstore persists the exact SPDK parameters in snode.lvstore_stack
and every restart replays them, so that record is the real cluster size
for any release. Expose it as StorageNode.lvstore_cluster_size(lvs_name)
and have the collector read it, keeping the settings-derived formula only
as a logged fallback for a node record without the entry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added the target/R26.3 Targets release branch R26.3 label Oct 21, 2026
@wmousa
wmousa merged commit a156ba5 into R26.3 Oct 21, 2026
8 checks passed
@wmousa
wmousa deleted the fix/lvol-used-size-from-lvstore-stack-R26.3 branch October 21, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/R26.3 Targets release branch R26.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants