Skip to content

Conversation

@houseme
Copy link
Contributor

@houseme houseme commented Jan 20, 2026

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

#1540

Summary of Changes

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Additional Notes


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

houseme and others added 3 commits January 20, 2026 12:07
… missing

### Problem
In SNMD (single-node multi-drive) deployments (e.g., Docker), the console may display an incorrect total capacity because
`StorageInfo.backend.standard_sc_data` can be empty/incomplete in some code paths. The current capacity calculation then
skips most disks and under-reports capacity.

### Changes
- Add safe fallback logic in `get_total_usable_capacity*()`:
  - If `standard_sc_data` is missing or no disks match the expected indices, sum capacity/free space from online disks.
- Populate minimal backend shape in `SetDisks` storage info (`drives_per_set`, `total_sets`) to improve consistency and
  observability without guessing parity.

### Files
- `crates/ecstore/src/pools.rs`
- `crates/ecstore/src/set_disk.rs`

### Result
Capacity and free-space shown in the console remain correct and stable for SNMD/Docker deployments, even when backend
storage-class metadata is unavailable.
…k-capacity

* 'main' of github.com:rustfs/rustfs:
  Helm: Add ability to enable Virtual Hosting paths (#1559)
…_LOG (#1529)

Signed-off-by: heihutu <30542132+heihutu@users.noreply.github.com>
Signed-off-by: majinghe <42570491+majinghe@users.noreply.github.com>
Co-authored-by: heihutu <30542132+heihutu@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 20, 2026 04:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the capacity calculation functions resilient when backend information is missing or inconsistent, addressing issue #1540. It also standardizes environment variables across deployment configurations by replacing RUST_LOG with RUSTFS_OBS_LOGGER_LEVEL.

Changes:

  • Added fallback capacity calculation logic when backend metadata (standard_sc_data) is missing or empty
  • Introduced helper functions to detect disk online states and calculate fallback capacities
  • Populated minimal backend shape in get_storage_info to prevent downstream errors
  • Standardized logging configuration across all deployment files (Dockerfile, Helm, Docker Compose, Ansible)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/ecstore/src/pools.rs Added resilient capacity calculation with fallback logic and disk state detection
crates/ecstore/src/set_disk.rs Populated drives_per_set and total_sets in BackendInfo to provide minimal valid structure
Dockerfile Replaced RUST_LOG with RUSTFS_OBS_LOGGER_LEVEL and added OBS environment variables
helm/rustfs/values.yaml Updated log_level setting and changed obs_environment from "develop" to "development"
docs/examples/docker/enhanced-docker-deployment.sh Replaced RUST_LOG with RUSTFS_OBS_LOGGER_LEVEL
docs/examples/docker/docker-quickstart.sh Replaced RUST_LOG with RUSTFS_OBS_LOGGER_LEVEL
docs/examples/docker/docker-comprehensive.yml Removed duplicate RUST_LOG environment variable
docs/ansible/binary-mnmd.yml Removed RUST_LOG environment variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@houseme houseme merged commit 7c8fd85 into main Jan 20, 2026
12 checks passed
@houseme houseme deleted the fix/fix-hard-disk-capacity branch January 20, 2026 05:03
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.

3 participants