Repository navigation
fix(ilm): parse v2 tier-stats contract in tier info - #441
Merged
Merged
Conversation
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.
Related Issues
Relates to rustfs/rustfs#9626.
Background & User Impact
Running
rc bucket lifecycle tier info <TIER> <ALIAS>(orrc ilm tier info <TIER> <ALIAS>) against RustFS servers speaking the V2/rustfs/admin/v3/tier-statscontract (introduced in rustfs/rustfs#7110) only displayed tier configuration without inventory or 24-hour transition statistics, forcing operators to hand-sign Admin API requests.Root Cause
execute_infoincrates/cli/src/commands/ilm/tier.rscalledGET /tier-statswithout atierquery parameter and looked upstats.get(&tier_name)at the top level of the JSON object. Because the V2 response uses an envelope ({ contractVersion, inventory, activity, tiers: [...] }) instead of the legacy V1 top-level map, the lookup always returnedNone, and request errors were silently swallowed intoNone.Solution
AdminApi::tier_stats(crates/core/src/admin/mod.rs) andAdminClient::tier_stats(crates/s3/src/admin.rs) to accept an optionaltierfilter (GET /tier-stats?tier=<TIER>)./tier-statsparsing incrates/cli/src/commands/ilm/tier.rswith case-insensitive tier matching and backward-compatible V1 top-level map fallback.Inventory (cluster-wide)andTransitions (last 24h)in both human-readable and--jsonoutputs:0wheninventory.statusisnot-accounted/unavailableor when no inventory entry exists for the tier yet.nodesReporting/nodesExpectedandunavailableNodes) for 24-hour transitions.statsError(JSON) andStats: unavailable (...)(text) instead of silently hiding them.Validation
cargo fmt --all --check— passedcargo clippy --workspace -- -D warnings— passed (0 warnings)cargo test --workspace— all unit, integration, and doc tests passed