Skip to content

Commit

Permalink
executor: ignore the invalid region in region cache during fast analy…
Browse files Browse the repository at this point in the history
…ze (#22289)

Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>

Co-authored-by: Kenan Yao <cauchy1992@gmail.com>
  • Loading branch information
lzmhhh123 and eurekaka authored Jan 8, 2021
1 parent 7177f49 commit 1b9ef96
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion executor/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package executor
import (
"bytes"
"context"
"fmt"
"math"
"math/rand"
"runtime"
Expand Down Expand Up @@ -638,7 +639,12 @@ func (e *AnalyzeFastExec) getSampRegionsRowCount(bo *tikv.Backoffer, needRebuild
if *err != nil {
return
}

if rpcCtx == nil {
logutil.Logger(context.TODO()).Warn(
fmt.Sprintf("region %d is invalid in region cache during fast analyze, ignore the samples in it",
loc.Region.GetID()))
continue
}
ctx := context.Background()
resp, *err = client.SendRequest(ctx, rpcCtx.Addr, req, tikv.ReadTimeoutMedium)
if *err != nil {
Expand Down

0 comments on commit 1b9ef96

Please sign in to comment.