-
Notifications
You must be signed in to change notification settings - Fork 190
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wiil review later
dm/ctl/master/config.go
Outdated
cmd := &cobra.Command{ | ||
Use: "task [task-name]", | ||
Short: "manage or show task configs", | ||
RunE: configTaskList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use anonymous functions in the same format as above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here?
use func(cmd *cobra.Command, args []string) error
instead of configTaskList
…into fixHandleErrCommands
@lichunzhu new comments added, PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
dm/ctl/master/config.go
Outdated
newExportCfgsCmd(), | ||
newImportCfgsCmd(), | ||
) | ||
cmd.PersistentFlags().StringP("path", "d", "", "specify the file path to export`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd.PersistentFlags().StringP("path", "d", "", "specify the file path to export`") | |
cmd.PersistentFlags().StringP("path", "p", "", "specify the file path to export`") |
dm/ctl/master/config.go
Outdated
} | ||
|
||
func configMasterList(cmd *cobra.Command, args []string) error { | ||
if len(args) == 0 || len(args) > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(args) == 0 || len(args) > 1 { | |
if len(args) != 1 { |
dm/ctl/master/config.go
Outdated
RunE: exportCfgsFunc, | ||
} | ||
cmd.Flags().StringP("dir", "d", "configs", "specify the output directory, default is `./configs`") | ||
cmd.Flags().String("dir", "", "specify the configs directory, default is `./configs`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove the short parameter -d
return cmd | ||
} | ||
|
||
// exportCfgsFunc exports configs. | ||
func exportCfgsFunc(cmd *cobra.Command, args []string) error { | ||
dir, err := cmd.Flags().GetString("dir") | ||
filePath, err := cmd.Flags().GetString("path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by this path
parameter. It seems like a single file path, but actually it means the path to a directory. Then why we need to support both path
and dir
while there is no difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to support dir
parameter. To keep compatible with older version we support both now but mark dir
as hidden.
) | ||
|
||
// NewShardDDLLockCmd creates a ShardDDLLock command. | ||
func NewShardDDLLockCmd() *cobra.Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we can merge shard-ddl-lock
and show-ddl-lock
into one command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe shard-ddl-lock show?
@lichunzhu new comments added, PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lichunzhu please merge master and resolve conflits |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 72226d1
|
In response to a cherrypick label: new pull request created: #2011. |
What problem does this PR solve?
#1692 part 1
What is changed and how it works?
Add
binlog
,shard-ddl-locks
,binlog-schema
,config
commands and update relative integration tests.Check List
Tests
Code changes
Related changes