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

ttl: reschedule task to other instances when shrinking worker #57703

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Nov 26, 2024

What problem does this PR solve?

Issue Number: close #57990

What changed and how does it work?

This PR makes some changes:

  1. Flush expired rows not deleted in delWorker before it stops.
  2. When stopping a scanWorker, wait for all rows to be deleted before writing its state to task meta.
  3. Mark the status of a task back to waiting when its worker stops to ensure it can be obtained by other instances again.
  4. When task heartbeating, merge the current statistics and the old one that recovered from the task meta.
  5. Add more logs.

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.

None

@lcwangchao lcwangchao marked this pull request as draft November 26, 2024 06:17
@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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 26, 2024
Copy link

tiprow bot commented Nov 26, 2024

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

@lcwangchao lcwangchao force-pushed the ttl_shirink_worker_reschedule branch 8 times, most recently from 6a30db5 to 695c2c7 Compare November 27, 2024 07:54
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 27, 2024
@lcwangchao lcwangchao force-pushed the ttl_shirink_worker_reschedule branch 13 times, most recently from 5bb58a4 to eaee3fe Compare November 27, 2024 12:16
Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 5, 2024
@lcwangchao
Copy link
Collaborator Author

/retest

Copy link

tiprow bot commented Dec 5, 2024

@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Dec 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, YangKeao

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 Dec 5, 2024
Copy link

ti-chi-bot bot commented Dec 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-05 08:39:01.311913915 +0000 UTC m=+1316928.931568431: ☑️ agreed by YangKeao.
  • 2024-12-05 18:14:47.709558408 +0000 UTC m=+1351475.329212921: ☑️ agreed by bb7133.

Copy link

tiprow bot commented Dec 5, 2024

@lcwangchao: 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
fast_test_tiprow 2808f3b link true /test fast_test_tiprow

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

@ti-chi-bot ti-chi-bot bot merged commit bb9096c into pingcap:master Dec 5, 2024
23 of 24 checks passed
@lcwangchao lcwangchao deleted the ttl_shirink_worker_reschedule branch December 6, 2024 00:35
@lcwangchao lcwangchao added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Jan 6, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 6, 2025
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-8.5: #58719.

@lcwangchao lcwangchao added needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. and removed needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Jan 7, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 7, 2025
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-8.5: #58772.

@lcwangchao
Copy link
Collaborator Author

/cherry-pick release-8.5

@ti-chi-bot
Copy link
Member

@lcwangchao: new pull request could not be created: failed to create pull request against pingcap/tidb#release-8.5 from head ti-chi-bot:cherry-pick-57703-to-release-8.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-57703-to-release-8.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}

In response to this:

/cherry-pick release-8.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.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 7, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@lcwangchao
Copy link
Collaborator Author

/cherry-pick release-8.5

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 8, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

@lcwangchao: new pull request created to branch release-8.5: #58778.

In response to this:

/cherry-pick release-8.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.

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-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. 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.

when shrinking the TTL workers, some expired rows will left undeleted
4 participants