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

disttask/ddl: fix hang when reverting #50357

Closed
wants to merge 6 commits into from

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Jan 12, 2024

What problem does this PR solve?

Issue Number: ref #50307

Problem Summary:
Revert process run forever since we didn't mark failed revert subtask as revert_failed.

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

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

None

Copy link

ti-chi-bot bot commented Jan 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ywqzzy. For more information see the Kubernetes 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 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 12, 2024
Copy link

tiprow bot commented Jan 12, 2024

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

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Merging #50357 (417d075) into master (c1eb8ab) will decrease coverage by 16.4191%.
Report is 1 commits behind head on master.
The diff coverage is 82.3529%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50357         +/-   ##
=================================================
- Coverage   70.0552%   53.6361%   -16.4192%     
=================================================
  Files          1444       1553        +109     
  Lines        419997     586677     +166680     
=================================================
+ Hits         294230     314671      +20441     
- Misses       105464     248095     +142631     
- Partials      20303      23911       +3608     
Flag Coverage Δ
integration 21.6577% <82.3529%> (?)

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

Components Coverage Δ
dumpling 54.0269% <ø> (ø)
parser ∅ <ø> (∅)
br 55.6086% <ø> (+5.9147%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 12, 2024
@ywqzzy ywqzzy changed the title disttask/ddl: fix hang when reverting [WIP] disttask/ddl: fix hang when reverting Jan 12, 2024
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 12, 2024
Comment on lines 40 to 42
if task.State != proto.TaskStateRunning {
return
}
Copy link
Contributor

@D3Hunter D3Hunter Jan 12, 2024

Choose a reason for hiding this comment

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

shouldn't we fix the case that disttask is still reverting, but ddl mark it as rollback done?

it's ok for reverting task to take slots, as it's transient normally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am working on it

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-tests-checked labels Jan 12, 2024
},
proto.TaskStateFailed: {},
proto.TaskStateRevertFailed: {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove it since we will remove all reverting logic

@ywqzzy ywqzzy changed the title [WIP] disttask/ddl: fix hang when reverting disttask/ddl: fix hang when reverting Jan 12, 2024
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed and 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 Jan 12, 2024
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Jan 12, 2024
@D3Hunter
Copy link
Contributor

D3Hunter commented Jan 12, 2024

Revert process run forever since we didn't mark failed revert subtask as revert_failed.

if we have revert_failed subtask, task need to be this state too. but i don't think we should maintain it

maybe we can fix the Init fail in below part, so current framework logic can keep working

return errors.Trace(errors.Errorf("index info not found: %d", bgm.EleIDs[0]))

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Jan 12, 2024

Revert process run forever since we didn't mark failed revert subtask as revert_failed.

if we have revert_failed subtask, task need to be this state too. but i don't think we should maintain it

maybe we can fix the Init fail in below part, so current framework logic can keep working

return errors.Trace(errors.Errorf("index info not found: %d", bgm.EleIDs[0]))

Just a tmp fix for previous version of tidb, we can fire another pr to remove reverting process completely.

Copy link

ti-chi-bot bot commented Jan 12, 2024

@ywqzzy: The following tests 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 417d075 link true /test check-dev
idc-jenkins-ci-tidb/unit-test 417d075 link true /test unit-test

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.

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Jan 12, 2024

close as we have better approch

@ywqzzy ywqzzy closed this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants