fix: prevent failover of regions to the same peer (#5632)

This commit is contained in:
Weny Xu
2025-03-04 02:41:27 +08:00
committed by GitHub
parent 31f29d8a77
commit dc24c462dc

View File

@@ -416,6 +416,12 @@ impl RegionSupervisor {
)
.await?;
let to_peer = peers.remove(0);
if to_peer.id == from_peer.id {
warn!(
"Skip failover for region: {region_id}, from_peer: {from_peer}, trying to failover to the same peer."
);
return Ok(());
}
let task = RegionMigrationProcedureTask {
cluster_id,
region_id,