-
Notifications
You must be signed in to change notification settings - Fork 188
Conversation
/run-all-tests |
dm/ctl/master/list_member.go
Outdated
// NewListMemberCmd creates an ListMember command | ||
func NewListMemberCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "list-member master/worker/leader", |
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.
Can we list all members if no more argument specified? in other words, make master
/worker
/leader
become optional arg ([--master] [--worker] [--leader]
).
dm/ctl/master/list_member.go
Outdated
"github.com/gogo/protobuf/proto" | ||
"github.com/pingcap/dm/dm/ctl/common" | ||
"github.com/pingcap/dm/dm/pb" | ||
|
||
"github.com/pingcap/errors" | ||
"github.com/spf13/cobra" |
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.
need to format these pkg
dm/master/server.go
Outdated
return resp, nil | ||
} | ||
|
||
_, leaderName, _, err := s.election.LeaderInfo(ctx) |
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.
seems that the information returned by LeaderInfo
is enough, don't need to query etcd again? and we can update the result of LeaderInfo
if necessary
rest LGTM |
/run-all-tests |
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/list_member.go
Outdated
func (c ListMemberFlags) Reset() { | ||
c.names = c.names[:0] | ||
} |
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.
Is this necessary? and where do we call this Reset
?
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 necessary. I have removed it.
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
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
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
What problem does this PR solve?
What is changed and how it works?
some interface preview
Check List
Tests
Code changes