-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check time spent on attempting RPC to avoid spending too much time on retrying #1117
Check time spent on attempting RPC to avoid spending too much time on retrying #1117
Conversation
… retrying Signed-off-by: MyonKeminta <[email protected]>
I'm still considering whether the values passed to these |
Signed-off-by: MyonKeminta <[email protected]>
…id-too-much-rpc-retry-on-timeout
Signed-off-by: MyonKeminta <[email protected]>
PTAL while I'm testing how it works in a real cluster with io injection |
internal/locate/region_request.go
Outdated
@@ -2396,3 +2419,10 @@ func (s *replicaSelector) patchRequestSource(req *tikvrpc.Request, rpcCtx *RPCCo | |||
} | |||
sb.WriteString(req.ReadType) | |||
} | |||
|
|||
func (s *replicaSelector) recordAttemptedTime(duration time.Duration) { | |||
s.targetReplica().attemptedTime += duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check s.targetReplica() != nil
, otherwise the method is required to be called at right place.
I didn't finish testing it due to not yet successfully allocate resources for testing 😥 shall we consider merging it first? |
Signed-off-by: MyonKeminta <[email protected]>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <[email protected]> * Handle refreshRegionStore Signed-off-by: MyonKeminta <[email protected]> * Add test Signed-off-by: MyonKeminta <[email protected]> * Address comments Signed-off-by: MyonKeminta <[email protected]> --------- Signed-off-by: MyonKeminta <[email protected]> Co-authored-by: MyonKeminta <[email protected]> Signed-off-by: lance6716 <[email protected]>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <[email protected]> * Handle refreshRegionStore Signed-off-by: MyonKeminta <[email protected]> * Add test Signed-off-by: MyonKeminta <[email protected]> * Address comments Signed-off-by: MyonKeminta <[email protected]> --------- Signed-off-by: MyonKeminta <[email protected]> Co-authored-by: MyonKeminta <[email protected]>
… retrying (#1117) (#1131) Signed-off-by: MyonKeminta <[email protected]> Co-authored-by: MyonKeminta <[email protected]>
… time on retrying (tikv#1117) (tikv#1131)" This reverts commit 062f4c9. Signed-off-by: MyonKeminta <[email protected]>
… time on retrying (#1117) (#1131)" (#1133) This reverts commit 062f4c9. Signed-off-by: MyonKeminta <[email protected]> Co-authored-by: MyonKeminta <[email protected]>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <[email protected]> * Handle refreshRegionStore Signed-off-by: MyonKeminta <[email protected]> * Add test Signed-off-by: MyonKeminta <[email protected]> * Address comments Signed-off-by: MyonKeminta <[email protected]> --------- Signed-off-by: MyonKeminta <[email protected]> Co-authored-by: MyonKeminta <[email protected]>
Ref pingcap/tidb#50432