diff --git a/store/copr/coprocessor.go b/store/copr/coprocessor.go index 1b6c32148d162..4231a7d0a9658 100644 --- a/store/copr/coprocessor.go +++ b/store/copr/coprocessor.go @@ -1168,7 +1168,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() }