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

DM/Openapi: ignore can not connect error when force delete task #5364

Merged
merged 7 commits into from
May 13, 2022
Merged

DM/Openapi: ignore can not connect error when force delete task #5364

merged 7 commits into from
May 13, 2022

Conversation

WizardXiao
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #5363

What is changed and how it works?

add check when delete task.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 9, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Ehco1996
  • buchuitoudegou

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 9, 2022
@WizardXiao WizardXiao added area/dm Issues or PRs related to DM. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 9, 2022
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 9, 2022
@WizardXiao
Copy link
Contributor Author

/run-all-tests

@WizardXiao
Copy link
Contributor Author

/cc @Ehco1996

@ti-chi-bot ti-chi-bot requested a review from Ehco1996 May 9, 2022 09:22
Copy link
Contributor

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

if err == nil {
return true
}
if force && strings.Contains(err.Error(), "connect: connection refused") {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about use
errors.Is(err, syscall.ECONNREFUSED)

Copy link
Contributor Author

@WizardXiao WizardXiao May 11, 2022

Choose a reason for hiding this comment

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

i tried errors.Is(err, syscall.ECONNREFUSED) and run inegration test, but it can't ignore connection refused. I still don't know the root cause, i will find it out later

Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is because this error is wrapped by terror

return nil, terror.DBErrorAdapt(err, terror.ErrDBDriverError)

ok not change here

Copy link
Contributor

@Ehco1996 Ehco1996 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 added the status/LGT1 Indicates that a PR has LGTM 1. label May 11, 2022
@WizardXiao
Copy link
Contributor Author

please help me take a look, tanks. @GMHDBJD @dsdashun

}
metaSchema := *task.MetaSchema
err = s.removeMetaData(ctx, taskName, metaSchema, toDBCfg)
if err != nil {
return terror.Annotate(err, "while removing metadata")
if !ignoreCannotConnectError(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand forcing to delete tasks shouldn't have returned errors. But what if the user restarts the same task again but the metadata still exists?

Copy link
Contributor Author

@WizardXiao WizardXiao May 12, 2022

Choose a reason for hiding this comment

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

i make a discussion note here.
when user recreates the same task, and the downstream recovers again, it will still have the metadata, then it need remove metadata when start task or manually delete metadata.
after disscuss with @sunzhaoyang, this is rare, we can just print warning log. but it still has risk,and most of openapi's interface has no warning message when it can run successfully. so i will pose a #5410 to note this.

Copy link
Contributor

@buchuitoudegou buchuitoudegou left a comment

Choose a reason for hiding this comment

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

LGTM but probably result in #5409

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 12, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2022

Codecov Report

Merging #5364 (d4e6208) into master (687e248) will decrease coverage by 0.0898%.
The diff coverage is 52.6616%.

Flag Coverage Δ
cdc 61.0650% <52.6616%> (+0.4664%) ⬆️
dm 52.1201% <ø> (-0.3495%) ⬇️

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

@@               Coverage Diff                @@
##             master      #5364        +/-   ##
================================================
- Coverage   56.1240%   56.0341%   -0.0899%     
================================================
  Files           522        528         +6     
  Lines         65325      69438      +4113     
================================================
+ Hits          36663      38909      +2246     
- Misses        25094      26819      +1725     
- Partials       3568       3710       +142     

@WizardXiao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e51ecb0

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 12, 2022
@WizardXiao
Copy link
Contributor Author

/run-dm-integration-test

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label May 12, 2022
@WizardXiao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 19fe4fa

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 12, 2022
@WizardXiao
Copy link
Contributor Author

/run-all-tests

@WizardXiao
Copy link
Contributor Author

/run-dm-integration-test

1 similar comment
@WizardXiao
Copy link
Contributor Author

/run-dm-integration-test

@WizardXiao
Copy link
Contributor Author

/run-leak-test

@ti-chi-bot ti-chi-bot merged commit 08928bf into pingcap:master May 13, 2022
@WizardXiao WizardXiao mentioned this pull request May 17, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DM/Openapi: ignore can not connect error when force delete task
5 participants