Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

want: need transfer leadership with client manually #7584

Closed
siddontang opened this issue Mar 23, 2017 · 3 comments
Closed

want: need transfer leadership with client manually #7584

siddontang opened this issue Mar 23, 2017 · 3 comments
Assignees
Milestone

Comments

@siddontang
Copy link
Contributor

Hi

I see transfer leader is not exported to client.

// transferLeadership transfers the leader to the given transferee.
// TODO: maybe expose to client?
func (s *EtcdServer) transferLeadership(ctx context.Context, lead, transferee uint64) error {

It is a very useful feature, assume we have three DC 1, 2, 3, 1 and 2 are in same city with very high speed network, 3 is in another remote city with some network delay (20ms). All our clients are deployed in 1 and 2.

In this case, we must ensure the etcd leader is in 1 or 2, not in 3. If we find leader is in 3, we must transfer to 1 or 2 explicitly.

@gyuho
Copy link
Contributor

gyuho commented Mar 23, 2017

It will be fairly simple. Should we support this? /cc @heyitsanthony @xiang90

type Cluster interface {
	// MemberList lists the current cluster membership.
	MemberList(ctx context.Context) (*MemberListResponse, error)

	// MemberAdd adds a new member into the cluster.
	MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error)

	// MemberRemove removes an existing member from the cluster.
	MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error)

	// MemberUpdate updates the peer addresses of the member.
	MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error)

	TransferLeadership(ctx context.Context, transferee uint64) error
}

?

@heyitsanthony
Copy link
Contributor

Probably belongs in Maintenance since it's targeted at one endpoint?

@xiang90 xiang90 added this to the v3.3.0 milestone Mar 23, 2017
@xiang90
Copy link
Contributor

xiang90 commented Mar 23, 2017

Let us do this in 3.3. This is useful, but not something urgent i feel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants