Repository navigation
[R26.3] fix(stats): size lvol usage with the lvstore's own cluster_sz, not the current formula - #1515
Merged
Merged
Conversation
…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>
Hamdy-khader
approved these changes
Oct 21, 2026
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.
Backport of the main PR (same title) to R26.3, hand-ported: this branch has no
collect_lvol_recordhelper (the call is inline inmain()) and is Python 3.9, soOptional[int]instead ofint | None.Problem
On a 26.3.2.1 cluster (2x2)
sbctl lvol listreports 39.7 TiB used on a 21 TiB volume. 26.3.2 (#1387) changedcreate_lvstoreto size an lvstore cluster atpage_size × ndcsand the lvol stat collector to assume that size for every lvstore, but lvstores created on ≤ 26.3.1 usepage_size × 1and keep it. Every pre-existing lvstore is overcounted byndcs. 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 newStorageNode.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
LVolStatCollectorservice changes. Restart it with the new image;lvol listcorrects itself on the next collection cycle.🤖 Generated with Claude Code