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: Enable checkpoint advancer to pause tasks lagged too large #51441

Merged
merged 14 commits into from
Mar 13, 2024

Conversation

RidRisR
Copy link
Contributor

@RidRisR RidRisR commented Mar 1, 2024

What problem does this PR solve?

Issue Number: close #50803

Problem Summary:

What changed and how does it work?

Now, a new option called CheckPointLagLimit is added to the advancer config. When it is set, advancer will check if the checkpoint is lagged too large on every tick. If so, advancer would send a warning to PD and unstall the task.
PS: Theoretically, we need a resume signal when the task could be resumed. However, there is no channel to send this signal now. Maybe we will add it in the future.

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

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

A new option called `CheckPointLagLimit` is added to the advancer config. When it is set, advancer will check if the checkpoint is lagged too large on every tick. If so, advancer would send a warning to PD and unstall the task.

Copy link

tiprow bot commented Mar 1, 2024

Hi @RidRisR. 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.

@RidRisR RidRisR marked this pull request as draft March 1, 2024 03:31
@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed and removed do-not-merge/needs-linked-issue labels Mar 1, 2024
@RidRisR RidRisR changed the title Advancer Enable advancer to pluge tasks lagged too large Mar 5, 2024
@RidRisR RidRisR changed the title Enable advancer to pluge tasks lagged too large Enable checkpoint advancer to pluge tasks lagged too large Mar 5, 2024
@RidRisR RidRisR changed the title Enable checkpoint advancer to pluge tasks lagged too large br: Enable checkpoint advancer to pluge tasks lagged too large Mar 5, 2024
@RidRisR RidRisR marked this pull request as ready for review March 5, 2024 06:28
return
case resp, ok := <-pauseCh:
if !ok || !handleResponse(resp) {
pauseCh = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Nits: I think we'd better bring the default branch back and remove the if. Even in this context the ctx should be canceled and the channel must be closed. In a cleanup context, unbounded blocking is somehow dangerous -- it may lead to unexpected leakage or make the program fail to exit.

@ti-chi-bot ti-chi-bot bot merged commit 7548df7 into pingcap:master Mar 13, 2024
30 of 35 checks passed
@3pointer
Copy link
Contributor

LGTM. Note: for now it seems this function is disabled by default. For now, the configuration of TiDB cannot be passed to advancer, which means this function won't be usable in a TiDB binary. Should we enable this with a value safe enough, say, 72h or even longer? cc @3pointer @BornChanger

I think we should enable it with a default value, 3 days is safe enough and we could not let log backup block GC to much.

@BornChanger
Copy link
Contributor

/type cherry-pick-for-release-6,5

Copy link

ti-chi-bot bot commented Mar 25, 2024

@BornChanger: The label(s) type/cherry-pick-for-release-6,5 cannot be applied, because the repository doesn't have them.

In response to this:

/type cherry-pick-for-release-6,5

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 ti-community-infra/tichi repository.

@BornChanger
Copy link
Contributor

/type cherry-pick-for-release-6.5

@BornChanger
Copy link
Contributor

/type cherry-pick-for-release-7.1

@BornChanger
Copy link
Contributor

/type cherry-pick-for-release-7.5

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 26, 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: #52105.

@BornChanger
Copy link
Contributor

/label needs-cherry-pick-release-7.1

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circuit breaker log backup task when checkpoint ts does not advance for a long time
6 participants