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

.*: add list-member command #654

Merged
merged 24 commits into from
May 19, 2020
Merged

Conversation

GMHDBJD
Copy link
Collaborator

@GMHDBJD GMHDBJD commented May 8, 2020

What problem does this PR solve?

  • add list-member command in DM-HA

What is changed and how it works?

some interface preview
Screenshot (19)
Screenshot (22)
Screenshot (20)
Screenshot (21)

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change
  • Has interface methods change

@GMHDBJD GMHDBJD added priority/normal Minor change, requires approval from ≥1 primary reviewer status/WIP This PR is still work in progress type/feature New feature labels May 9, 2020
@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels May 9, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 9, 2020

/run-all-tests

@GMHDBJD GMHDBJD added status/WIP This PR is still work in progress and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels May 11, 2020
dm/master/server.go Outdated Show resolved Hide resolved
dm/master/server_test.go Outdated Show resolved Hide resolved
@GMHDBJD GMHDBJD changed the title .*: add get-leader command .*: add list-member command May 12, 2020
@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/WIP This PR is still work in progress labels May 12, 2020
// NewListMemberCmd creates an ListMember command
func NewListMemberCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "list-member master/worker/leader",
Copy link
Member

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/proto/dmmaster.proto Outdated Show resolved Hide resolved
Comment on lines 20 to 25
"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"
Copy link
Contributor

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

return resp, nil
}

_, leaderName, _, err := s.election.LeaderInfo(ctx)
Copy link
Contributor

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

@WangXiangUSTC
Copy link
Contributor

rest LGTM

@WangXiangUSTC WangXiangUSTC added the status/LGT2 Two reviewers already commented LGTM, ready for merge label May 18, 2020
@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 18, 2020

/run-all-tests

@GMHDBJD
Copy link
Collaborator Author

GMHDBJD commented May 18, 2020

PTAL. @WangXiangUSTC @csuzhangxc @lichunzhu

@GMHDBJD GMHDBJD added status/PTAL This PR is ready for review. Add this label back after committing new changes and removed status/LGT2 Two reviewers already commented LGTM, ready for merge labels May 18, 2020
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

Comment on lines 37 to 39
func (c ListMemberFlags) Reset() {
c.names = c.names[:0]
}
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@csuzhangxc csuzhangxc added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels May 19, 2020
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lichunzhu lichunzhu added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels May 19, 2020
@csuzhangxc
Copy link
Member

/run-all-tests

2 similar comments
@lichunzhu
Copy link
Contributor

/run-all-tests

@lichunzhu
Copy link
Contributor

/run-all-tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants