Browse Source

fix: ensure partial EC volume moves are reported as failures

Set hasMoved=false when a shard fails to move, even if previous shards
succeeded. This prevents the caller from incorrectly assuming the entire
volume was evacuated, which could lead to data loss if the source server
is decommissioned based on this incorrect status.
pull/7621/head
chrislu 4 weeks ago
parent
commit
5763c007f6
  1. 2
      weed/shell/command_volume_server_evacuate.go

2
weed/shell/command_volume_server_evacuate.go

@ -239,6 +239,8 @@ func (c *commandVolumeServerEvacuate) moveAwayOneEcVolume(commandEnv *CommandEnv
fmt.Fprintf(writer, "no available destination for ec shard %d.%d: %d nodes have no free slots\n", fmt.Fprintf(writer, "no available destination for ec shard %d.%d: %d nodes have no free slots\n",
ecShardInfo.Id, shardId, skippedNodes) ecShardInfo.Id, shardId, skippedNodes)
} }
// Ensure partial moves are reported as failures to prevent data loss
hasMoved = false
return return
} }
} }

Loading…
Cancel
Save