pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
430 stars 286 forks source link

cdc client config format refinement #6331

Closed Tammyxia closed 2 years ago

Tammyxia commented 2 years ago

What did you do?

What did you expect to see?

No response

What did you see instead?

As above

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

(paste TiCDC version here)
v6.1.0
nongfushanquan commented 2 years ago

/assign @3AceShowHand

3AceShowHand commented 2 years ago

For anyone interested in the problem, you can reproduce it by the following step

  1. create a config file, just name it config.toml
  2. ./bin/cdc cli changefeed create --pd=http://127.0.0.1:2379 --config=~/config.toml
3AceShowHand commented 2 years ago

./bin/cdc cli changefeed create --pd=http://127.0.0.1:2379 --sink-uri="blackhole://" --config=config.toml works

image

./bin/cdc cli changefeed create --pd=http://127.0.0.1:2379 --sink-uri="blackhole://" --config=~/config.toml does not work, since ~/config.toml is relative path, which is not automatically converted by cobra.

image
3AceShowHand commented 2 years ago

Normally, the ~ is expanded by the shell before your program sees it.

This should not treat as a bug, it's within the convention. Even though we can fix this manually by adding more code, I do not think this is necessary and useful. Because, =~/foo is not supported by the shell, not the cdc program.

see more: https://stackoverflow.com/a/30027501/6075468

3AceShowHand commented 2 years ago

close by the comments above