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

br: refactor br cli backoff logic #54644

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Tristan1900
Copy link
Contributor

@Tristan1900 Tristan1900 commented Jul 15, 2024

What problem does this PR solve?

Issue Number: close #54643

Problem Summary:

Refactor the BR CLI backoff retry logic to make is more simplified and extendable in future.

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

NA

Copy link

ti-chi-bot bot commented Jul 15, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. component/dumpling This is related to Dumpling of TiDB. labels Jul 15, 2024
@sre-bot
Copy link
Contributor

sre-bot commented Jul 15, 2024

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 15, 2024
Copy link

tiprow bot commented Jul 15, 2024

Hi @Tristan1900. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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-sigs/prow repository.

@Tristan1900
Copy link
Contributor Author

tests to be fixed
also pending on #54596

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2024
@BornChanger BornChanger added component/br This issue is related to BR of TiDB. and removed component/dumpling This is related to Dumpling of TiDB. labels Jul 29, 2024
@ti-chi-bot ti-chi-bot bot added component/dumpling This is related to Dumpling of TiDB. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 1, 2024
@Tristan1900 Tristan1900 marked this pull request as ready for review October 1, 2024 00:44
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue labels Oct 1, 2024
Signed-off-by: Wenqi Mou <[email protected]>
Signed-off-by: Wenqi Mou <[email protected]>
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 82.64984% with 55 lines in your changes missing coverage. Please review.

Project coverage is 57.4947%. Comparing base (1c386db) to head (33fa670).
Report is 136 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54644         +/-   ##
=================================================
- Coverage   73.3473%   57.4947%   -15.8527%     
=================================================
  Files          1638       1788        +150     
  Lines        453782     653387     +199605     
=================================================
+ Hits         332837     375663      +42826     
- Misses       100556     252502     +151946     
- Partials      20389      25222       +4833     
Flag Coverage Δ
integration 39.3890% <72.9299%> (?)
unit 72.5221% <76.3406%> (-0.0396%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9478% <100.0000%> (ø)
parser ∅ <ø> (∅)
br 63.2640% <82.4840%> (+17.2841%) ⬆️

Signed-off-by: Wenqi Mou <[email protected]>
Signed-off-by: Wenqi Mou <[email protected]>
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2024
Copy link
Contributor

@YuJuncen YuJuncen left a comment

Choose a reason for hiding this comment

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

rest lgtm

isRetryErrFunc := buildIsRetryErrFunc(retryErrs, grpcRetryCodes)
isNonRetryErrFunc := buildIsNonRetryErrFunc(nonRetryErrs)

return newBackoffStrategy(maxRetry, delayTime, maxDelayTime, errContext, isRetryErrFunc, isNonRetryErrFunc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you replace this constructor with functional options or builder pattern?

Copy link

ti-chi-bot bot commented Oct 28, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: YuJuncen
Once this PR has been reviewed and has the lgtm label, please assign gmhdbjd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 28, 2024
Copy link

ti-chi-bot bot commented Oct 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-28 10:15:47.880664025 +0000 UTC m=+258460.719819570: ☑️ agreed by YuJuncen.

Copy link

ti-chi-bot bot commented Nov 8, 2024

PR needs rebase.

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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. component/dumpling This is related to Dumpling of TiDB. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

br: refactor CLI backoff retry logic
4 participants