Skip to content

fix(du): preserve completed snapshots and label initial progress - #433

Merged
majinghe merged 3 commits into
mainfrom
cxymds/fix/initial-snapshot-progress
Nov 23, 2026
Merged

majinghe merged 3 commits into
mainfrom
cxymds/fix/initial-snapshot-progress

Conversation

@cxymds

@cxymds cxymds commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Related Issues

User-reported missing bucket snapshots during the first scanner sweep on RustFS release/1.0.7 at 3dbcae5128fadb9e9ab10101dcebe83d162cb10e. Console companion: rustfs/console#317. Backend companion: rustfs/rustfs#9592.

Background

A completed server snapshot must remain stable while later scanning is in progress. A bucket with no completed measurement may expose progress only when the server explicitly authorizes it as an initial scan. Missing or malformed history must not silently become an empty bucket.

Changes

  • Request datausageinfo?view=snapshot for server snapshot reads and keep completed bucket values ahead of initial progress.
  • Validate first-scan stage, source coverage, timestamp, and paired nonnegative integer values. Enumeration without measurements remains unavailable rather than becoming zero.
  • Preserve per-bucket certification timestamps and distinguish initial partial statistics from completed server snapshots. Scope metadata to the requested bucket.
  • Keep the existing server_snapshot source and partial exit code; extend optional V3 metadata without changing the protected V1 schema or exit-code definitions.

Validation

Passed locally on the submitted changes:

cargo fmt --all --check
cargo check --workspace -j1
CARGO_BUILD_JOBS=1 cargo clippy --workspace -- -D warnings
cargo test --workspace -j1

Adapter and command regression tests cover explicit initial progress, malformed or untrusted progress, completed-value precedence, and bucket scope. The three initial review threads are addressed. Completed rows require both measurement fields; progress and unavailable names use set indexes, including a 10,000-bucket regression. Backend companion validation is continuing. No live VM or production testing was performed.

CI fixes and status

Updated url to 2.5.9 in the main and native-client lockfiles to address RUSTSEC-2026-0592. Host setup installs only missing packages through temporary signed official Ubuntu/Debian sources, so an unrelated Git PPA HTTP 503 does not block formatting or build tools. Eight setup-action tests are wired into the existing contract job. The HTTP/2 fault fixture accepts expected disconnects after injecting a fault while preserving the assertion that a destructive request is never retried; its regression passed ten consecutive local runs.

Local workspace Clippy with all targets, workspace tests, formatting, dependency advisories, and locked native metadata checks pass on 108dd4a. New GitHub checks are running after the lockfile and review fixes; earlier successes or failures are not presented as results for the new head. No live VM or native SDK runtime validation was performed locally.

Only consume explicitly authorized first-scan values and retain bucket certification timestamps in server snapshot reports.
@cxymds
cxymds marked this pull request as ready for review November 23, 2026 14:29
Copilot AI balanced review requested due to automatic review settings November 23, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Snapshot handling can report successful zero usage for malformed or unmeasured buckets, hiding unavailable measurements and producing incorrect totals.

3 open issues
What changed in this PR

Updates du server-snapshot reporting to preserve completed bucket measurements while exposing valid first-scan progress as explicitly partial statistics, alongside the console companion changes.

Changes:

  • Requests the snapshot view and validates initial progress without replacing completed measurements.
  • Adds per-bucket timestamps and unavailable-bucket metadata, with bucket-scoped output and partial-state labels.
  • Extends optional V3 output metadata and adds adapter and command regression tests.
File Description
schemas/​output_v3.json Adds optional bucket timestamps, initial-progress metadata, and unmeasured bucket names.
crates/​s3/​src/​ops.rs Requests and interprets snapshot data, validates progress, and adds adapter tests.
crates/​core/​src/​ops.rs Extends usage reports with per-bucket measurement metadata.
crates/​cli/​src/​commands/​du.rs Scopes metadata, labels partial statistics, and adds command regression tests.

Review effort: Balanced

Comment thread crates/s3/src/ops.rs Resolved
Comment thread crates/s3/src/ops.rs Resolved
Comment thread crates/s3/src/ops.rs Resolved
Install only missing build tools from signed distribution repositories so an unrelated Git PPA outage cannot block CI. Update url to the patched release and preserve pending snapshot state for unmeasured initial scans.
Keep incomplete measurement rows unavailable, index bucket names for linear merging, and synchronize the native lockfile with the URL security update. Accept expected transport disconnects after fault injection without weakening duplicate-request assertions.
@majinghe
majinghe self-requested a review November 23, 2026 23:43
@majinghe
majinghe merged commit 7f5d900 into main Nov 23, 2026
14 checks passed
@majinghe
majinghe deleted the cxymds/fix/initial-snapshot-progress branch November 23, 2026 23:45
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