Files
RustFSandKevin 173c7a1694 fix(pools,ecstore,scanner,http): harden zero-downtime multi-pool expansion, delete recovery, scanner hot-reload, and HTTP/1.1 Expect: 100-continue interop (backlog#3412) (#9942)
* fix(ecstore,pool-reload): enforce uniform W+EC contract, 1x1/1x4/4x8 expansion, config persistence, drift checks, and cutover write fencing

* fix(pool-reload,rpc,console): support bare-path single-node promotion RPC auth/disk lookup, crash-recovery convergence, idempotent reload retry, and static console directory routes

* fix(pool-reload): accept single-node bare-path Pool 0 promotion prefix during hot-expand startup agreement

* fix(ecstore): allow Local<->RpcOnly multipart proof authority and bare-path->URL disk handle transition on committed live topology hot-reload

* perf(ecstore): parallelize rebalance and headroom-checked decommission data movement

* fix(ecstore): skip heavy Sets/Semaphore in decommission tracing spans to prevent runtime stalls

* fix(startup,pool_reload): validate stripe/EC pre-DNS and enforce bidirectional peer agreement pre-store

* fix(startup): expose bootstrap local_node_name for pre-store RPC auth before ECStore init

* fix(decommission): classify paged usage-cache blocks as set-local scanner objects during listing and sweep

* fix(pool-reload): bypass stale circuit breaker on maintenance sync and tolerate single-peer sync lag for hot-expand joiners

* fix(decommission): account for inflight temporary copies during reservation growth and fence fast-grant writes during temporary delta measurement

* fix(delete-recovery): adopt strictly older superseded null generations after partition overwrite-then-delete

* fix(layout): inherit pool 0 stripe width for compatible multi-pool expansion geometries (e.g. 4x4 + 8x8 + 12x4 -> 1x16 + 4x16 + 3x16)

* fix(pool-reload): treat mid-init added pool format probe as retryable during preflight

During hot pool expansion preflight, newly started joining nodes initialize
format.json concurrently across all drives of the added pool before marking
startup_formats_ready=true and entering pool_join_standby. Previously,
POST /pools/preflight detected formats_ready=false in peer_cluster_preflight
but still ran probe_candidate_pool_disks unconditionally, causing a mid-write
snapshot of freshly written cluster formats and not-yet-written unformatted
drives to be misclassified as a permanent mixed-format layout failure.

Pass remote expansion peers whose startup_formats_ready is not yet true into
probe_candidate_pool_disks_with_initializing_hosts so partial-format snapshots
on initializing added pools report a retryable standby-init error while
preserving hard errors for offline/corrupt/foreign/mismatched drives and
settled mixed-format pools. Add unit coverage in store::reload::tests.

* fix(delete-recovery): reclaim divergent write rollback backups and unblock committed absence delete settlement

Two related defects under network partitions could leave an unversioned bucket
permanently undeletable (BucketNotEmpty) with delete recovery spinning on
DeleteRecoveryLegacyAmbiguous (blocked=1, pending_keys=1):

1. In SetDisks rename_data (both early-ack and synchronous paths in
   crates/ecstore/src/set_disk/core/io_primitives.rs), backup_reclaims skipped
   deleting {object}/{rollback_dir}/xl.meta.bkp whenever
   cleanup_data_dirs[idx] == Some(rollback_dir), assuming commit_rename_data_dir
   would reclaim rollback_dir. However, commit_rename_data_dir only reclaims
   disks matching the quorum-reduced data_dir/final_data_dir. A partition-healed
   lagging drive holding an older D0 (!= quorum D1) was skipped by both paths,
   deterministically stranding D0/xl.meta.bkp on disk.

2. In SetDisks delete recovery (crates/ecstore/src/set_disk/ops/delete_recovery.rs),
   when a pure write rollback backup (xl.meta.bkp with zero delete evidence)
   coexisted with a subsequent quorum-committed unversioned absence delete
   (target_absent=true), background recovery and heal (explicit_delete=false)
   only recognized superseded write backups while the successor generation was
   still live. Once live xl.meta was deleted, the backup stayed LegacyAmbiguous
   and blocked key-wide finalization of the committed delete across all drives.

Only skip per-file backup reclamation for disks actually scheduled for quorum
directory cleanup, order journaled transactions ahead of journal-less legacy
groups in causal_transaction_order, and prove on disk when a journal-less pure
write backup of an unprotected null generation is superseded by a committed
absence-delete authority (failing closed on real legacy delete residues with
markers/receipts or newer/versioned/locked backups). Add end-to-end regressions.

* fix(scanner,http): rebind scanner leader on live topology hot-reload and close HTTP/1.1 empty-body Expect: 100-continue connections

* fix(ecstore): use non-blocking movement-gate refresh in decommission watchdog to prevent fair-RwLock starvation

* fix(ecstore): settle delete recovery on DeleteBucket and fix hint/peer wake & authority selection (Bug #22)

- Drop stale delete_recovery_runtime hints when the target bucket is deleted or
  its expected incarnation is retired (BucketNotFound), and classify missing
  incarnation lookups on strictly absent buckets as BucketNotFound in heal.rs
  instead of spinning forever on retryable failures (Bug #22A).
- Poll local and remote drive runtime_state across all sets on each recovery
  tick without network RPCs so returning partitioned remote peers immediately
  wake MissingQuorum waiters instead of waiting up to 30s/backoff (Bug #22B).
- Probe read-only for pending delete-recovery transactions during ordinary
  DeleteBucket (O(1) key probe on local VisibleVersion, set-wide probe on
  OrphanDirectory or remote BucketNotEmpty) and settle them non-destructively
  (explicit_delete=false, reusing the held bucket namespace lock when
  object==bucket) before returning 409 BucketNotEmpty, while leaving raw
  metadata-less residue untouched and scanner mutation fences unbumped on
  genuinely non-empty buckets (Bug #22C).
- Select per-copy matching receipt authority for AdoptCommit (in both dry_run
  and settlement), classify witness-only/unadoptable null receipt conflicts
  cleanly instead of looping on OutdatedXLMeta, and bound automatic discard of
  stranded write-rollback backups beside committed absence deletes to
  non-majority subsets to preserve quorum legacy-ambiguity semantics (Bug #22D).

* style: rustfmt pool-expansion and delete-recovery changes

* fix(ecstore,rustfs): resolve all 10 PR #9942 review blockers and error-other-format ratchet

1. Restrict bare_local_path_for_promoted_disk_ref to verified local host+port identities (active/staged local endpoints, RUSTFS_LOCAL_ENDPOINT_HOST, non-wildcard local node name, or local interface IP / OS hostname only while in Path-only mode).
2. Explicitly match Local <-> RpcOnly authority-kind transitions in replace_multipart_proof_topology and fail closed on genuine replace_topology inconsistencies.
3. Fix double-layer escaping in format_env_volumes_assignment so whitespace, quotes, $, backticks, #, and backslashes round-trip safely through systemd/shell and parse_env_config_content.
4. Reject missing/mismatched ports and arbitrary foreign hosts in resolve_incoming_rpc_audience on wildcard binds, restricting accepted authorities to receiver-verified local aliases and RAII-staged promotion identities.
5. Retain distributed target_guard ownership and LockLostSignal across fast-grant decommission writes and scope temporary-write fast-grant fencing to (store_id, target_pool_index) across all source owners.
6. Retain ServerContextSlot in GatewayStack and enforce exact slot resolution in pool_reload::resolve_runtime so cutover write fences never leak across embedded instances.
7. Recover legacy space-joined multi-drive bare-path cmd_line promotions in single_pool_path_promotion without assuming whitespace is an unambiguous separator.
8. Extend BucketNotFound fallback in run_bucket_heal_at_incarnation to expected=Some(incarnation) hints when strict volume-not-found is confirmed on disk.
9. Propagate settlement/conflict/lock-loss errors in settle_pending_delete_recovery_for_bucket_delete, run detached under bucket lifecycle/namespace fences with cooperative deadline, cover all BucketDeleteBlockerKind preflight variants, and restrict bucket_ns_guard reuse on object==bucket strictly to (pool 0, set 0).
10. Guard has_conflicting_null_generation against vacuous .all() with zero receipt peers and upgrade delete-recovery quorum wakeups to track monotonic online_recovery_epoch, disk handle changes, and in-flight before/after snapshots.
11. Replace new pool-topology Error::other(format!) call sites with typed Error::InvalidArgument and update scripts/error-other-format-baseline.txt plus uniform-width unit tests.

* fix(server): move per-slot cutover write fence to HTTP edge to preserve gateway census

* fix(clippy): resolve clippy warnings in ecstore and pool_reload

---------

Co-authored-by: Kevin <kevin@Kevins-Mac-Mini.local>
2026-12-06 01:00:29 +08:00
..