Skip to content

Commit f3c388c

Browse files
committed
Allow switchover/failover on empty shard
1 parent ff556fa commit f3c388c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎internal/app/switchover.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ const (
1717

1818
func (app *App) countAliveHAReplicasWithinNodes(nodes []string, shardState map[string]*HostState) int {
1919
cnt := 0
20+
noData := app.noDataInShard(shardState)
2021
for _, hostname := range nodes {
2122
state, ok := shardState[hostname]
22-
if ok && state.PingOk && state.PingStable && state.ReplicaState != nil && !app.lacksData(state) {
23+
if ok && state.PingOk && state.PingStable && state.ReplicaState != nil && (!app.lacksData(state) || noData) {
2324
cnt++
2425
}
2526
}

0 commit comments

Comments
 (0)