gomod: update pdclient to support backoff mechanism for memberLoop (#46769) #46954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #46769
Signed-off-by: husharp [email protected]<!--
Thank you for contributing to TiDB!
PR Title Format:
-->
What problem does this PR solve?
Issue Number: close #46770, ref tikv/pd#6556
Problem Summary:
When waiting for the goroutine to update, the expo function can be used to backoff to sleep when an error is encountered.
PR Summary
Add backoff mechanism
expo
function can be used to backoff to sleep when an error is encountered.Reproduce Step
enable fail point, like gRPC is throttling, cannot read from etcd.
curl -X PUT -d 'return(10)' http://tc-pd-1.tc-pd-peer.csn-simulator-big-cluster-vd62g.svc:2379/pd/api/v1/fail/github.com/tikv/pd/pkg/etcdutil/SlowEtcdKVGet
simulate pd lost leader
curl -X PUT -d 'return("2346857576170797299")' http://tc-pd-1.tc-pd-peer.csn-simulator-big-cluster-vd62g.svc:2379/pd/api/v1/fail/github.com/tikv/pd/server/exitCampaignLeader
Reproduce Result
Grpc request
GetMember
keeps high:TiKV side show
PR Effect
The Grpc
GetMember
call was reduced from 3.2k to 170, which is relative to the TiDB numbers and client requests for triaging checkLeader.For 20 * tidb 3 * PD 50 * TiKV
170 = (50 * 3 / 3 / 3[TiKV side] + 20 * 2 [TiDB side]) * 3[PD Num]
And more tests are necessary to ensure that no further issues arise.
What is changed and how it works?
Check List
test by pd
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.