Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

server: create new lease if expired #253

Merged
merged 1 commit into from
Jun 13, 2016

Conversation

sgotti
Copy link
Member

@sgotti sgotti commented Jun 10, 2016

If a server cannot communicate with etcd for a time greater then the lease
timeout (30s) its lease will expire and the server won't reregister
requiring it to be restarted.

This patch fixes this making the server, inside the heartbeat goroutine,
renew the current lease or create a new lease if expired and use this
one to register itself.

This should fix #252 and can be a starting point for option 2 in #230 (comment).

If a server cannot communicate with etcd for a time greater then the lease
timeout (30s) its lease will expire and the server won't reregister
requiring it to be restarted.

This patch fixes this making the server, inside the heartbeat goroutine,
renew the current lease or create a new lease if expired and use this
one to register itself.
@sgotti
Copy link
Member Author

sgotti commented Jun 10, 2016

I'd like to write some HA integration tests for this but I'm not sure if there're some already being implemented or I should just start with the one in the integration dir using the temp mds implementation.

@philips
Copy link
Contributor

philips commented Jun 13, 2016

@sgotti My hope for HA integration tests is that we use k8s to orchestrate it. In the case of etcd we wrote an agent to create network partitions, introduce SIGPAUSE, etc. But, I would like to port this thing to k8s for use by Torus. I don't think we have an issue about it though.

@barakmich
Copy link
Contributor

Nice. We can follow this up with a listener structure for volumes that can do the right things based on if the lease had to be renewed. For the moment, it solves the issues you claim.

@barakmich
Copy link
Contributor

LGTM

@barakmich barakmich merged commit b00c7f7 into coreos:master Jun 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer doesn't reregister after lost lease.
3 participants