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

dmctl fail to operate-source when flavor is not specified and GTID is set #1380

Closed
lichunzhu opened this issue Jan 15, 2021 · 2 comments · Fixed by #1385
Closed

dmctl fail to operate-source when flavor is not specified and GTID is set #1380

lichunzhu opened this issue Jan 15, 2021 · 2 comments · Fixed by #1385
Labels
severity/major type/bug This issue is a bug report

Comments

@lichunzhu
Copy link
Contributor

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.

cat source.yaml

source-id: "test"

enable-gtid: true
enable-relay: true
relay-binlog-gtid: "8fed3d32-1e6e-11eb-9e0f-0242ac110003:1-2933"
from:
  host: "127.0.0.1"
  user: "root"
  password: ""
  port: 3306
purge:
  remain-space: 15

./dmctl operator-source create source.yaml

  1. What did you expect to see?
    Add source successfully.

  2. What did you see instead?

[code=11009:class=dm-worker:scope=internal:level=high], Message: relay-binlog-gtid 8fed3d32-1e6e-11eb-9e0f-0242ac110003:1-2933: parse GTID 8fed3d32-1e6e-11eb-9e0f-0242ac110003:1-2933, RawCause: invalid flavor 
  1. Versions of the cluster

    • DM version (run dmctl -V or dm-worker -V or dm-master -V):
      1fc1f5fcd7b25d0bfd05589a053ccfe1c4f59422
@lichunzhu lichunzhu added the type/bug This issue is a bug report label Jan 15, 2021
@lichunzhu
Copy link
Contributor Author

lichunzhu commented Jan 15, 2021

The root cause is because that

if err := cfg.ParseYaml(content); err != nil {
is before
if err = cfg.Adjust(ctx, fromDB.DB); err != nil {

When we didn't specify flavor dm will not adjust it, dm will fail at
_, err = gtid.ParserGTID(c.Flavor, c.RelayBinlogGTID)

@lance6716
Copy link
Collaborator

Anyway we could try parse gtid in every flavor if user didn't specified it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity/major type/bug This issue is a bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants