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

Empty syncer config item cause DM-master panic #3732

Closed
GMHDBJD opened this issue Aug 21, 2021 · 6 comments · Fixed by #5298 · May be fixed by pingcap/dm#2244
Closed

Empty syncer config item cause DM-master panic #3732

GMHDBJD opened this issue Aug 21, 2021 · 6 comments · Fixed by #5298 · May be fixed by pingcap/dm#2244
Assignees
Labels
affects-5.3 affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 area/dm Issues or PRs related to DM. severity/major type/bug The issue is confirmed as a bug.

Comments

@GMHDBJD
Copy link
Contributor

GMHDBJD commented Aug 21, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
    task config
---
name: test
task-mode: all

target-database:
  host: "127.0.0.1"
  port: 4000
  user: "test"
  password: "/Q7B9DizNLLTTfiZHv9WoEAKamfpIUs="

mysql-instances:
  - source-id: "mysql-replica-01"
    syncer-config-name: "global"

syncers:
  global:

start-task ./task.toml
  1. What did you expect to see?
    task runs normal or report a config error
  2. What did you see instead?
    master panic
dm-master startup 2021-08-21 16:28:34.106341359 +0800 CST m=+0.239573077
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3627087]

goroutine 487 [running]:
github.com/pingcap/dm/dm/config.(*TaskConfig).adjust(0xc000f6a360, 0x0, 0x0)
        /nvme1n1/gmhdbjd/code/dm/dm/config/task.go:592 +0x73c7
github.com/pingcap/dm/dm/config.(*TaskConfig).Decode(0xc000f6a360, 0xc000f90500, 0x49c, 0x0, 0x0)
        /nvme1n1/gmhdbjd/code/dm/dm/config/task.go:393 +0x3a5
github.com/pingcap/dm/dm/master.(*Server).generateSubTask(0xc000450240, 0x52c1138, 0xc0006bdda0, 0xc000f90500, 0x49c, 0xa, 0xa, 0x0, 0x0, 0x0, ...)
        /nvme1n1/gmhdbjd/code/dm/dm/master/server.go:1341 +0x10a
github.com/pingcap/dm/dm/master.(*Server).StartTask(0xc000450240, 0x52c1138, 0xc0006bdda0, 0xc0006bddd0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/code/dm/dm/master/server.go:419 +0x546
github.com/pingcap/dm/dm/pb._Master_StartTask_Handler.func1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/code/dm/dm/pb/dmmaster.pb.go:3666 +0x19c
github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).UnaryServerInterceptor.func1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0xc000a467e0, 0xc000410bb8, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:107 +0x1b5
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x13c
go.etcd.io/etcd/etcdserver/api/v3rpc.newUnaryInterceptor.func1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0xc000a467e0, 0xc000a46800, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/go.etcd.io/[email protected]/etcdserver/api/v3rpc/interceptor.go:70 +0x80a
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x13c
go.etcd.io/etcd/etcdserver/api/v3rpc.newLogUnaryInterceptor.func1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0xc000a467e0, 0xc000a46820, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/go.etcd.io/[email protected]/etcdserver/api/v3rpc/interceptor.go:77 +0x143
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x13c
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1(0x52c1138, 0xc0006bdda0, 0x42cffe0, 0xc0006bddd0, 0xc000a467e0, 0xc000410bb8, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:34 +0x290
github.com/pingcap/dm/dm/pb._Master_StartTask_Handler(0x43b25c0, 0xc000450240, 0x52c1138, 0xc0006bdda0, 0xc0007abb60, 0xc0007389f0, 0x0, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/code/dm/dm/pb/dmmaster.pb.go:3668 +0x4a7
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003ac480, 0x52d5658, 0xc0010dd500, 0xc0007ae500, 0xc000bc28a0, 0x681e160, 0x0, 0x0, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/google.golang.org/[email protected]/server.go:1024 +0x1a5c
google.golang.org/grpc.(*Server).handleStream(0xc0003ac480, 0x52d5658, 0xc0010dd500, 0xc0007ae500, 0x0)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/google.golang.org/[email protected]/server.go:1313 +0xf11
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00073b0f0, 0xc0003ac480, 0x52d5658, 0xc0010dd500, 0xc0007ae500)
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/google.golang.org/[email protected]/server.go:722 +0x199
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /nvme1n1/gmhdbjd/environment/go/pkg/mod/google.golang.org/[email protected]/server.go:720 +0x131
@lance6716
Copy link
Contributor

not sure if our linter doesn't work

@lance6716
Copy link
Contributor

even if we fix the panic in adjust, the behaviour is not expected

loaders:
  global:

this will add a config that has 0 pool-size, and "" dir. Maybe user is expecting two default values?

PTAL @sunzhaoyang

@sunzhaoyang
Copy link

sunzhaoyang commented Oct 21, 2021

even if we fix the panic in adjust, the behaviour is not expected

loaders:
  global:

this will add a config that has 0 pool-size, and "" dir. Maybe user is expecting two default values?

PTAL @sunzhaoyang

If a configuration item is filled in, press the filled value; if not filled in, press the default value, there should be no 0 or “”.

@lance6716 lance6716 transferred this issue from pingcap/dm Dec 6, 2021
@lance6716 lance6716 added area/dm Issues or PRs related to DM. type/bug The issue is confirmed as a bug. labels Dec 6, 2021
@lance6716
Copy link
Contributor

/assign @docsir

@ti-chi-bot
Copy link
Member

@lance6716: GitHub didn't allow me to assign the following users: docsir.

Note that only pingcap members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @docsir

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.

@sylzd
Copy link

sylzd commented Aug 1, 2022

encountered at version 5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 area/dm Issues or PRs related to DM. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
7 participants