Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

fix(load): stop goroutines after restore returned (#744) #747

Merged
merged 5 commits into from
Jun 17, 2020

Conversation

csuzhangxc
Copy link
Member

@csuzhangxc csuzhangxc commented Jun 17, 2020

What problem does this PR solve?

fix #743

What is changed and how it works?

call cancel after Restore returned.

Check List

Tests

Code changes

  • Has exported variable/fields change

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note

@csuzhangxc csuzhangxc added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes type/bug-fix Bug fix type/cherry-pick This PR is just a cherry-pick (backport) needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Jun 17, 2020
@csuzhangxc csuzhangxc added this to the v1.0.6 milestone Jun 17, 2020
@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

1 similar comment
@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #747 into release-1.0 will not change coverage.
The diff coverage is n/a.

@@              Coverage Diff               @@
##           release-1.0       #747   +/-   ##
==============================================
  Coverage      57.8541%   57.8541%           
==============================================
  Files              166        166           
  Lines            16991      16991           
==============================================
  Hits              9830       9830           
  Misses            6204       6204           
  Partials           957        957           

@csuzhangxc csuzhangxc added status/WIP This PR is still work in progress and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 17, 2020
@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

@@ -263,25 +263,21 @@ func isResumableError(err *pb.ProcessError) bool {
return true
}

switch err.Type {
case pb.ErrorType_ExecSQL:
Copy link
Member Author

Choose a reason for hiding this comment

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

We should remove this ProcessError.Type later because we have better code, class, etc. cc @GMHDBJD

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will do it in #746 later

}

for _, tc := range testCases {
err := unit.NewProcessError(tc.errorType, tc.err)
err := unit.NewProcessError(pb.ErrorType_UnknownError, tc.err)
Copy link
Member Author

Choose a reason for hiding this comment

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

this pb.ErrorType_UnknownError should be removed later.

@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

@csuzhangxc
Copy link
Member Author

/run-all-tests tidb=v4.0.0

func statusProcessResult(pr *pb.ProcessResult) *pb.ProcessResult {
if pr == nil {
return nil
}
result := proto.Clone(pr).(*pb.ProcessResult)
if result != nil {
for i := range result.Errors {
result.Errors[i].Error = nil
if result.Errors[i].Error != nil {
result.Errors[i].Msg = ""
Copy link
Member Author

Choose a reason for hiding this comment

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

now, our Msg do not including error codes, class, etc.

update this line will change the response from

                    "errors": [
                        {
                            "Type": "UnknownError",
                            "msg": "TCPReader get relay event with error: ERROR 1236 (HY000): Could not find first log file name in binary log index file",
                            "error": null
                        }
                    ],

to

                        "errors": [
                            {
                                "Type": "UnknownError",
                                "msg": "",
                                "error": {
                                    "ErrCode": 10006,
                                    "ErrClass": 1,
                                    "ErrScope": 2,
                                    "ErrLevel": 3,
                                    "Message": "run table schema failed - dbfile ./dumped_data.task_single/db_single.tbl-schema.sql: execute statement failed: CREATE TABLE `tbl` (`c1` int(11) NOT NULL,`ct` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创 建时间',PRIMARY KEY (`c1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;: Error 1067: Invalid default value for 'ct'",
                                    "RawCause": "Error 1067: Invalid default value for 'ct'"
                                }
                            }
                        ],

@csuzhangxc csuzhangxc added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels Jun 17, 2020
@csuzhangxc
Copy link
Member Author

@WangXiangUSTC @GMHDBJD PTAL

Copy link
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

@GMHDBJD
Copy link
Collaborator

GMHDBJD commented Jun 17, 2020

/run-all-tests tidb=v4.0.0

Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

@WangXiangUSTC WangXiangUSTC added this to Reviewer approved in Stability Improvement via automation Jun 17, 2020
@WangXiangUSTC WangXiangUSTC added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jun 17, 2020
@csuzhangxc csuzhangxc merged commit 7e59da8 into pingcap:release-1.0 Jun 17, 2020
Stability Improvement automation moved this from Reviewer approved to Done Jun 17, 2020
@csuzhangxc csuzhangxc deleted the pick-744 branch June 17, 2020 09:47
@csuzhangxc csuzhangxc added already-update-release-note The release note is updated. Add this label once the release note is updated and removed needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-update-release-note The release note is updated. Add this label once the release note is updated priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/bug-fix Bug fix type/cherry-pick This PR is just a cherry-pick (backport)
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants