@@ -66,7 +66,6 @@ import (
6666 "github.com/tikv/client-go/v2/tikvrpc"
6767 "github.com/tikv/client-go/v2/util"
6868 "github.com/tikv/client-go/v2/util/async"
69- "github.com/tikv/pd/client/errs"
7069 pderr "github.com/tikv/pd/client/errs"
7170)
7271
@@ -482,8 +481,8 @@ func (s *RegionRequestSender) SendReqAsync(
482481 return
483482 }
484483
485- if req .Context . MaxExecutionDurationMs == 0 {
486- req .Context . MaxExecutionDurationMs = uint64 (timeout .Milliseconds ())
484+ if req .MaxExecutionDurationMs == 0 {
485+ req .MaxExecutionDurationMs = uint64 (timeout .Milliseconds ())
487486 }
488487
489488 s .reset ()
@@ -989,7 +988,7 @@ func (s *sendReqState) next() (done bool) {
989988 logutil .Eventf (bo .GetCtx (), "send %s request to region %d at %s" , req .Type , s .args .regionID .id , s .vars .rpcCtx .Addr )
990989 s .storeAddr = s .vars .rpcCtx .Addr
991990
992- req .Context . ClusterId = s .vars .rpcCtx .ClusterID
991+ req .ClusterId = s .vars .rpcCtx .ClusterID
993992 if req .InputRequestSource != "" && s .replicaSelector != nil {
994993 patchRequestSource (req , s .replicaSelector .replicaType ())
995994 }
@@ -1240,7 +1239,7 @@ func (s *sendReqState) initForAsyncRequest() (ok bool) {
12401239
12411240 // set access location based on source and target "zone" label.
12421241 s .setReqAccessLocation (req )
1243- req .Context . ClusterId = s .vars .rpcCtx .ClusterID
1242+ req .ClusterId = s .vars .rpcCtx .ClusterID
12441243 if req .InputRequestSource != "" && s .replicaSelector != nil {
12451244 patchRequestSource (req , s .replicaSelector .replicaType ())
12461245 }
@@ -1425,8 +1424,8 @@ func (s *RegionRequestSender) SendReqCtx(
14251424
14261425 // If the MaxExecutionDurationMs is not set yet, we set it to be the RPC timeout duration
14271426 // so TiKV can give up the requests whose response TiDB cannot receive due to timeout.
1428- if req .Context . MaxExecutionDurationMs == 0 {
1429- req .Context . MaxExecutionDurationMs = uint64 (timeout .Milliseconds ())
1427+ if req .MaxExecutionDurationMs == 0 {
1428+ req .MaxExecutionDurationMs = uint64 (timeout .Milliseconds ())
14301429 }
14311430
14321431 state := & sendReqState {
@@ -1513,7 +1512,7 @@ func (s *RegionRequestSender) logSendReqError(bo *retry.Backoffer, msg string, r
15131512 builder .WriteString (", timeout: " )
15141513 builder .WriteString (util .FormatDuration (timeout ))
15151514 builder .WriteString (", req-max-exec-timeout: " )
1516- builder .WriteString (util .FormatDuration (time .Duration (int64 (req .Context . MaxExecutionDurationMs ) * int64 (time .Millisecond ))))
1515+ builder .WriteString (util .FormatDuration (time .Duration (int64 (req .MaxExecutionDurationMs ) * int64 (time .Millisecond ))))
15171516 builder .WriteString (", retry-times: " )
15181517 builder .WriteString (strconv .Itoa (retryTimes ))
15191518 if s .AccessStats != nil {
@@ -1600,7 +1599,7 @@ func fetchRespInfo(resp *tikvrpc.Response) string {
16001599
16011600func isRPCError (err error ) bool {
16021601 // exclude ErrClientResourceGroupThrottled
1603- return err != nil && errs .ErrClientResourceGroupThrottled .NotEqual (err )
1602+ return err != nil && pderr .ErrClientResourceGroupThrottled .NotEqual (err )
16041603}
16051604
16061605func storeIDLabel (rpcCtx * RPCContext ) string {
0 commit comments