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

Lightning: increase backoff if split fails #49518

Merged
merged 3 commits into from
Jan 8, 2024
Merged

Lightning: increase backoff if split fails #49518

merged 3 commits into from
Jan 8, 2024

Conversation

mittalrishabh
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #49517

Problem Summary:
Lightning job is failing intermittently after enable BR on prod clusters because of batch split failure. During the backup process, BR temporarily disables the schedulers for a period of 1-2 minutes. However, the Lightning job, which does not have a backoff mechanism, continues to retry the process for up to 5 times without pausing or spacing out the retries.

What changed and how does it work?

i am adding a exponential back off before each retry and now it will retry upto 930 seconds before if fails the job

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
NO

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

Documentation
NO

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

Release note

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

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Dec 16, 2023
Copy link

ti-chi-bot bot commented Dec 16, 2023

Hi @mittalrishabh. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

Copy link

tiprow bot commented Dec 16, 2023

Hi @mittalrishabh. 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/test-infra repository.

@lance6716
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Dec 16, 2023
Copy link

codecov bot commented Dec 16, 2023

Codecov Report

Merging #49518 (dd863e2) into master (2065be4) will decrease coverage by 4.6926%.
Report is 58 commits behind head on master.
The diff coverage is 20.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49518        +/-   ##
================================================
- Coverage   71.9600%   67.2674%   -4.6926%     
================================================
  Files          1438       2558      +1120     
  Lines        345749     849351    +503602     
================================================
+ Hits         248801     571337    +322536     
- Misses        76712     254230    +177518     
- Partials      20236      23784      +3548     
Flag Coverage Δ
integration 37.2742% <20.0000%> (?)
unit 79.2959% <20.0000%> (+7.3358%) ⬆️

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

Components Coverage Δ
dumpling 73.6130% <ø> (+17.3001%) ⬆️
parser ∅ <ø> (∅)
br 70.6383% <20.0000%> (+18.9987%) ⬆️

@D3Hunter
Copy link
Contributor

some background about this pr: #49517 (comment)

@D3Hunter
Copy link
Contributor

D3Hunter commented Dec 19, 2023

there are already backoff in region split, just not long enough

waitTime *= 2
if waitTime > retrySplitMaxWaitTime {
waitTime = retrySplitMaxWaitTime
}

@mittalrishabh
Copy link
Contributor Author

there are already backoff in region split, just not long enough

waitTime *= 2
if waitTime > retrySplitMaxWaitTime {
waitTime = retrySplitMaxWaitTime
}

It is only for 4 seconds. BR can suspend split from 60 seconds to 10 min. And i don't want to increase this backoff time as it is going to add backoff in each region split which will be very expensive.

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2023
@mittalrishabh mittalrishabh changed the title add backoff if split fails Lightning: add backoff if split fails Dec 19, 2023
@mittalrishabh
Copy link
Contributor Author

can you please review this PR

Copy link
Contributor

@lance6716 lance6716 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

br/pkg/lightning/backend/local/local.go Outdated Show resolved Hide resolved
@mittalrishabh
Copy link
Contributor Author

Let me know if you agree with 10 second initial back off

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

just noticed that SplitAndScatterRegionByRanges has a maximum 4 seconds sleep for 8 times, so I think here we sleep 10 seconds is good.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 5, 2024
@mittalrishabh
Copy link
Contributor Author

I need lgtm label to checkin

@lance6716
Copy link
Contributor

PTAL @D3Hunter

Copy link

ti-chi-bot bot commented Jan 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, lance6716

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 8, 2024
Copy link

ti-chi-bot bot commented Jan 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-05 02:20:23.331794411 +0000 UTC m=+2396314.369021322: ☑️ agreed by lance6716.
  • 2024-01-08 04:08:25.378208741 +0000 UTC m=+243494.962462429: ☑️ agreed by D3Hunter.

@D3Hunter D3Hunter changed the title Lightning: add backoff if split fails Lightning: increase backoff if split fails Jan 8, 2024
Copy link

ti-chi-bot bot commented Jan 8, 2024

@mittalrishabh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/check_dev_2 dd863e2 link unknown /test check-dev2

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@lance6716
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit 2a564d4 into pingcap:master Jan 8, 2024
27 of 28 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 8, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #50164.

AilinKid pushed a commit to AilinKid/tidb that referenced this pull request Jan 17, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Jan 25, 2024
@Benjamin2037 Benjamin2037 added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Mar 20, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #51929.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lightning: split backoff is not long enough, and fail when EBS BR disabled region split
5 participants