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

dm-worker/: refine query error #512

Merged
merged 4 commits into from
Mar 4, 2020

Conversation

lichunzhu
Copy link
Contributor

@lichunzhu lichunzhu commented Mar 3, 2020

What problem does this PR solve?

#509
Current DM-worker may have no currUnit when some error occurs during Init, which will cause nil-pointer error while using worker.QueryError.

What is changed and how it works?

Avoid query currUnit.Error when currUnit is nil. Use result.Errors as Error when currUnit is nil.

Check List

Tests

  • Unit test
  • Integration test

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@lichunzhu
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

@lichunzhu
Copy link
Contributor Author

/run-all-tests tidb=release-3.0

case pb.UnitType_Sync:
stError.Error = &pb.SubTaskError_Sync{Sync: us.(*pb.SyncError)}
if cu != nil {
// oneof error
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// oneof error
// one of error

@WangXiangUSTC
Copy link
Contributor

LGTM

@WangXiangUSTC WangXiangUSTC added the status/LGT1 One reviewer already commented LGTM label Mar 4, 2020
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Mar 4, 2020
@lichunzhu lichunzhu merged commit 3ae47e8 into pingcap:master Mar 4, 2020
@lichunzhu lichunzhu deleted the worker/queryErrorRefine branch March 4, 2020 08:51
lichunzhu added a commit that referenced this pull request Mar 10, 2020
* Avoid query `currUnit.Error` when `currUnit` is nil. Use `result.Errors` as Error when `currUnit` is nil.
lichunzhu added a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
* fix worker query error bug
lichunzhu added a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
* fix worker query error bug
lichunzhu added a commit to lichunzhu/dm that referenced this pull request Apr 7, 2020
* fix worker query error bug
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants