From 9d6d068f411652a47729a0cf8dcb513580952898 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 27 Apr 2026 19:01:30 -0700 Subject: [PATCH] feat(seaweed-volume): cross-disk EC shard reconciliation (#9212) (#9252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(seaweed-volume): fall back to idx dir when reading .vif EcVolume::new and read_ec_shard_config only looked for .vif at the data dir. With the cross-disk reconcile path (where shards live on one disk and .ecx / .ecj / .vif live on a sibling disk — seaweedfs/seaweedfs#9212 / #9244), this would either write a stub .vif on the shard disk and lose the real EC config + dat_file_size or fall back to default ratios despite a perfectly good .vif being present elsewhere on the same volume server. Add a small `locate_vif_path` helper that prefers the data dir and falls back to the idx dir when it differs, and thread the data dir + idx dir pair through `read_ec_shard_config`. Three call sites in grpc_server.rs (VolumeEcShardsGenerate, VolumeEcShardsRebuild, scrub) updated; the scrub path passes the same dir for both args because `find_ec_dir` is the only locator there. * feat(seaweed-volume): primitives for cross-disk EC shard reconcile Adds the three small helpers the reconcile pass needs: - DiskLocation::mount_ec_shards_with_idx_dir — mounts shards on this disk while pointing the EcVolume at a sibling disk's idx dir for .ecx / .ecj / .vif. Mirrors loadEcShardsWithIdxDir in weed/storage/disk_location_ec.go. The existing mount_ec_shards is kept as a thin wrapper over it. - EcVolume::has_shard — `pub` accessor over the internal Vec