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

dm-worker: fix panic in query status #274

Merged
merged 3 commits into from
Sep 9, 2019

Conversation

amyangfei
Copy link
Contributor

What problem does this PR solve?

Fix panic

panic: interface conversion: interface {} is *pb.LoadStatus, not *pb.DumpStatus

goroutine 176025 [running]:
github.com/pingcap/dm/dm/worker.(*Worker).Status(0xc000108000, 0x0, 0x0, 0x2, 0x2, 0xc0003202c0)
        /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/status.go:101 +0xb1d
github.com/pingcap/dm/dm/worker.(*Worker).QueryStatus(0xc000108000, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/worker.go:312 +0xf5
github.com/pingcap/dm/dm/worker.(*Server).QueryStatus(0xc000554040, 0x18dee00, 0xc00556e6c0, 0xc00bd48170, 0xc000554040, 0xc00556e6c0, 0xc0002a3bd0)
        /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/worker/server.go:244 +0x2a0
github.com/pingcap/dm/dm/pb._Worker_QueryStatus_Handler(0x15fcd80, 0xc000554040, 0x18dee00, 0xc00556e6c0, 0xc0088b9e60, 0x0, 0x18dee00, 0xc00556e6c0, 0x0, 0x0)
        /home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/dm/pb/dmworker.pb.go:3851 +0x23e
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003622c0, 0x18f3760, 0xc0004f5e00, 0xc00043ee00, 0xc00041bad0, 0x2a8aca8, 0x0, 0x0, 0x0)
        /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:995 +0x4ab
google.golang.org/grpc.(*Server).handleStream(0xc0003622c0, 0x18f3760, 0xc0004f5e00, 0xc00043ee00, 0x0)
        /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:1275 +0xda6
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0003f4ae0, 0xc0003622c0, 0x18f3760, 0xc0004f5e00, 0xc00043ee00)
        /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:710 +0x9f
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /go/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:708 +0xa1

What is changed and how it works?

use the same unit.Unit object when we check its type and status

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note
    • Fix a potential panic bug when we query-status during subtask unit transforming between different units.

@amyangfei amyangfei added priority/normal Minor change, requires approval from ≥1 primary reviewer type/bug-fix Bug fix needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 labels Sep 7, 2019
@amyangfei
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Sep 7, 2019

Codecov Report

Merging #274 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master       #274   +/-   ##
===========================================
  Coverage   60.0514%   60.0514%           
===========================================
  Files           134        134           
  Lines         14759      14759           
===========================================
  Hits           8863       8863           
  Misses         5052       5052           
  Partials        844        844

@amyangfei amyangfei added the status/PTAL This PR is ready for review. Add this label back after committing new changes label Sep 7, 2019
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/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Sep 7, 2019
@csuzhangxc
Copy link
Member

@WangXiangUSTC PTAL

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 status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Sep 9, 2019
@amyangfei amyangfei merged commit 2c262b8 into pingcap:master Sep 9, 2019
amyangfei added a commit to amyangfei/dm that referenced this pull request Sep 9, 2019
@amyangfei amyangfei added the needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated label Sep 9, 2019
@amyangfei amyangfei deleted the fix-query-status-panic branch September 9, 2019 02:50
@csuzhangxc csuzhangxc mentioned this pull request Sep 12, 2019
@amyangfei amyangfei added already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked already-update-release-note The release note is updated. Add this label once the release note is updated and removed needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Sep 23, 2019
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants