Skip to content

Commit

Permalink
skip down stores
Browse files Browse the repository at this point in the history
Signed-off-by: hehechen <[email protected]>
  • Loading branch information
hehechen committed Jan 30, 2023
1 parent 86b058b commit a6fb515
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion domain/infosync/tiflash_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"github.com/gorilla/mux"
"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/tidb/ddl/placement"
"github.com/pingcap/tidb/store/helper"
"github.com/pingcap/tidb/tablecodec"
Expand Down Expand Up @@ -92,7 +93,11 @@ func getTiFlashPeerWithoutLagCount(tiFlashStores map[int64]helper.StoreStat, tab
if err != nil {
logutil.BgLogger().Error("Fail to get peer status from TiFlash.",
zap.Int64("tableID", tableID))
return 0, err
// Just skip down or offline or tomestone stores, because PD will migrate regions from these stores.
if store.Store.State == int64(metapb.StoreState_Up) && store.Store.StateName != "Down" {
return 0, err
}
continue
}
flashPeerCount += len(regionReplica)
}
Expand Down

0 comments on commit a6fb515

Please sign in to comment.