Files
seaweedfs/weed/shell
ca06589d64 volume.fix.replication: add a well-placed replica before deleting a misplaced one (#10364)
* volume.fix.replication: add a well-placed replica before deleting a misplaced one

A misplaced volume with no surplus replica (replica count == copy count) used to have its misplaced replica deleted first, and the replacement copied only on the next pass. That drops the volume below its intended durability, and permanently so when no destination can accept the replacement copy. Now such volumes get a well-placed replica first, and the misplaced one is trimmed as surplus on a later pass, following the same fulfill-before-delete principle as volume.tier.move (#8950).

The classification switch is extracted into classifyReplicaSet so the add-wins-over-trim priority is unit-testable.

Also stop the fix loop when an -apply pass makes no progress (nothing copied, nothing deleted); previously an unplaceable under-replicated volume made the loop spin forever, re-collecting the topology every 15 seconds. And propagate ewg.Wait() errors instead of swallowing them.

* volume.fix.replication: drop unused allLocations from deleteOneVolume

---------

Co-authored-by: Chris Lu <chris.lu@gmail.com>
2026-07-21 12:43:38 -07:00
..
2026-06-19 09:09:01 -07:00