diff --git a/store/copr/coprocessor.go b/store/copr/coprocessor.go index 1aee41b4e08c0..0e076c3bdb720 100644 --- a/store/copr/coprocessor.go +++ b/store/copr/coprocessor.go @@ -1023,7 +1023,9 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch if worker.kvclient.Stats == nil { worker.kvclient.Stats = make(map[tikvrpc.CmdType]*tikv.RPCRuntimeStats) } + // set ReadReplicaScope and TxnScope so that req.IsStaleRead will be true when it's a global scope stale read. req.ReadReplicaScope = worker.req.ReadReplicaScope + req.TxnScope = worker.req.TxnScope if worker.req.IsStaleness { req.EnableStaleRead() }