Skip to content
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

gomod: update pdclient to support backoff mechanism for memberLoop (#46769) #46955

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #46769

Signed-off-by: husharp [email protected]<!--

Thank you for contributing to TiDB!

PR Title Format:

  1. pkg [, pkg2, pkg3]: what's changed
  2. *: what's changed

-->

What problem does this PR solve?

Issue Number: close #46770, ref tikv/pd#6556

Problem Summary:

  • Add backoff mechanism
    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

  • When waiting for the goroutine to update, the expo function can be used to backoff to sleep when an error is encountered.

Reproduce Step

  1. 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

  2. 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:
image

TiKV side show

image

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.

image

What is changed and how it works?

Check List

test by pd
Tests

  • Unit test
  • Integration test

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

update pdclient to support backoff mechanism for memberLoop

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 13, 2023
@ti-chi-bot ti-chi-bot added the type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR. label Sep 13, 2023
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved labels Sep 13, 2023
@nolouch
Copy link
Member

nolouch commented Sep 18, 2023

cc @HuSharp

Signed-off-by: husharp <[email protected]>
@HuSharp HuSharp force-pushed the cherry-pick-46769-to-release-7.1 branch from bfdf20a to ab9eb16 Compare September 18, 2023 06:29
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Sep 18, 2023
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

❗ No coverage uploaded for pull request base (release-7.1@4007579). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-7.1     #46955   +/-   ##
================================================
  Coverage               ?   73.4658%           
================================================
  Files                  ?       1203           
  Lines                  ?     376756           
  Branches               ?          0           
================================================
  Hits                   ?     276787           
  Misses                 ?      82315           
  Partials               ?      17654           

@@ -95,7 +95,7 @@ require (
github.com/tdakkota/asciicheck v0.2.0
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tikv/client-go/v2 v2.0.8-0.20230713054852-a3875bcbc94f
github.com/tikv/pd/client v0.0.0-20230519121736-d15a686a670e
github.com/tikv/pd/client v0.0.0-20230905092614-113cdedbebb6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 18, 2023
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 18, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 18, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-18 08:31:51.482769824 +0000 UTC m=+506277.450357871: ☑️ agreed by nolouch.
  • 2023-09-18 08:35:05.292993209 +0000 UTC m=+506471.260581260: ☑️ agreed by rleungx.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 18, 2023

@CabinfeverB: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CabinfeverB, nolouch, rleungx, xhebox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Sep 18, 2023
@ti-chi-bot ti-chi-bot bot merged commit 38fb0eb into pingcap:release-7.1 Sep 18, 2023
2 checks passed
@HuSharp HuSharp deleted the cherry-pick-46769-to-release-7.1 branch September 19, 2023 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants