@@ -964,7 +964,7 @@ func buildBatchCopTasksCore(bo *backoff.Backoffer, store *kvStore, rangesForEach
964964 var needRetry bool
965965 minReplicaNum := uint64 (math .MaxUint64 )
966966 for _ , task := range tasks {
967- rpcCtx , unavailableReason , err := cache .GetTiFlashRPCContext (bo .TiKVBackoffer (), task .region , isMPP , tikv .LabelFilterNoTiFlashWriteNode )
967+ rpcCtx , unavailableDetail , err := cache .GetTiFlashRPCContext (bo .TiKVBackoffer (), task .region , isMPP , tikv .LabelFilterNoTiFlashWriteNode )
968968 if err != nil {
969969 return nil , errors .Trace (err )
970970 }
@@ -975,9 +975,17 @@ func buildBatchCopTasksCore(bo *backoff.Backoffer, store *kvStore, rangesForEach
975975 // same as rpc error.
976976 if rpcCtx == nil {
977977 needRetry = true
978- logutil . BgLogger (). Info ( "retry for TiFlash peer with region missing" ,
978+ fields := []zap. Field {
979979 zap .Uint64 ("region id" , task .region .GetID ()),
980- zap .String ("reason" , unavailableReason .String ()))
980+ zap .String ("reason" , unavailableDetail .Reason .String ()),
981+ }
982+ if len (unavailableDetail .StoreIDs ) > 0 {
983+ fields = append (fields , zap .Uint64s ("store_ids" , unavailableDetail .StoreIDs ))
984+ }
985+ if len (unavailableDetail .PeerIDs ) > 0 {
986+ fields = append (fields , zap .Uint64s ("peer_ids" , unavailableDetail .PeerIDs ))
987+ }
988+ logutil .BgLogger ().Info ("retry for TiFlash peer with region missing" , fields ... )
981989 // Probably all the regions are invalid. Make the loop continue and mark all the regions invalid.
982990 // Then `splitRegion` will reloads these regions.
983991 continue
0 commit comments