-
Notifications
You must be signed in to change notification settings - Fork 233
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 <MyonKeminta@users.noreply.github.com>
I'm still considering whether the values passed to these |
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
…id-too-much-rpc-retry-on-timeout
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 <MyonKeminta@users.noreply.github.com>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Handle refreshRegionStore Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Add test Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Address comments Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> --------- Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Signed-off-by: lance6716 <lance6716@gmail.com>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Handle refreshRegionStore Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Add test Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Address comments Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> --------- Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
… retrying (tikv#1117) * Check time spent on attempting RPC to avoid spending too much time on retrying Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Handle refreshRegionStore Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Add test Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Address comments Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> --------- Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Ref pingcap/tidb#50432