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

etcdserver: forward member promote to leader #31

Merged
merged 1 commit into from
May 7, 2019

Conversation

jingyih
Copy link
Owner

@jingyih jingyih commented May 3, 2019

This PR adds server side forwarding of member promote request.

cc @jpbetz @gyuho @WIZARD-CXY

@jingyih jingyih force-pushed the server_forward_member_promote_to_leader branch from 57a06ba to 12e26d2 Compare May 3, 2019 03:44
etcdserver/api/etcdhttp/peer.go Outdated Show resolved Hide resolved
etcdserver/api/etcdhttp/peer.go Outdated Show resolved Hide resolved
etcdserver/api/etcdhttp/peer_test.go Show resolved Hide resolved
etcdserver/server.go Show resolved Hide resolved
etcdserver/server.go Show resolved Hide resolved
etcdserver/cluster_util.go Outdated Show resolved Hide resolved
@jingyih jingyih force-pushed the server_forward_member_promote_to_leader branch from 12e26d2 to 83e3a65 Compare May 3, 2019 21:55
@jingyih
Copy link
Owner Author

jingyih commented May 3, 2019

@jpbetz PR updated. PTAL!

Copy link

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

Just one comment, feel free to merge after having a look at it.

etcdserver/api/etcdhttp/peer.go Show resolved Hide resolved
@@ -260,7 +260,11 @@ func (s *EtcdServer) LeaseRenew(ctx context.Context, id lease.LeaseID) (int64, e
}
}
}
return -1, ErrTimeout

if cctx.Err() == context.DeadlineExceeded {

Choose a reason for hiding this comment

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

Do we need to change the return logic in lease timetolive and renew?

Copy link
Owner Author

Choose a reason for hiding this comment

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

cctx.Err() can be either due to timeout or cancellation. I think in the original code, user can cancel the context but the returned error is ErrTimeout.

@WIZARD-CXY
Copy link

minor things.LGTM

@jingyih jingyih force-pushed the server_forward_member_promote_to_leader branch from 83e3a65 to 9d6ad5b Compare May 6, 2019 00:57
@jingyih jingyih merged commit e8e668c into learner May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants