From 9d3b66a1addfff33ae3283392c60c597dbbbb2ca Mon Sep 17 00:00:00 2001 From: you06 Date: Mon, 24 Apr 2023 17:28:31 +0800 Subject: [PATCH] fix missting Request.TxnScope Signed-off-by: you06 --- store/copr/coprocessor.go | 2 ++ 1 file changed, 2 insertions(+) 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() }