diff --git a/internal/locate/replica_selector_test.go b/internal/locate/replica_selector_test.go index c835f1a99..cde4921ce 100644 --- a/internal/locate/replica_selector_test.go +++ b/internal/locate/replica_selector_test.go @@ -442,7 +442,7 @@ func (tp RegionErrorType) Valid(addr string, req *tikvrpc.Request) bool { } } // replica-read. - if req.StaleRead == false && req.ReplicaRead == true { + if !req.StaleRead && req.ReplicaRead { switch tp { case NotLeaderErr, NotLeaderWithNewLeader1Err, NotLeaderWithNewLeader2Err, NotLeaderWithNewLeader3Err: // NotLeaderErr will not return in replica read.