Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Support for determining leader location#607

Merged
chungers merged 6 commits intodocker-archive:masterfrom
chungers:leader-forward
Jun 24, 2017
Merged

Support for determining leader location#607
chungers merged 6 commits intodocker-archive:masterfrom
chungers:leader-forward

Conversation

@chungers
Copy link
Copy Markdown
Contributor

This PR is necessary for upcoming API work because

  • It adds a registration mechanism for leader's location (as a URL). The leader's location, which is how the client or other followers can forward http traffic to the leader, can now be stored in the backend that is used for leadership detection in the first place.
    • os: a file now stores the location of the leader node
    • swarm: a new Swarm annotation is added
    • etcd: a value at a given key infrakit/leader/location now stores the url to contacting the leader.
  • The poller, on determining that this current node is the leader, writes its location to the backend, if one is assigned. In the case of single node infrakit, there's no change.
  • A Store interface is introduced to let an application read the location of the leader. This is not the RPC SPI, but rather a golang interface that interested applications (e.g. the Mux) will make use.
  • The Mux has been adapted to support running in the three environments listed above. The reason it's the Mux that supports this and not the Manager itself, is because the Mux provides a network endpoint that is reachable and therefore is the actual component in infrakit that really depends on this feature. If the Mux is never run, then existing leader detection mechanism is sufficient.
  • The Mux CLI has been updated to plumb through the Store and leadership detections. This will allow the Mux running on a non-leader (follower) to be able to determine the location of the leader and forward client requests to the leader, so that when leadership changes, the client only has to contact a single, stable IP address.

Signed-off-by: David Chung david.chung@docker.com

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 23, 2017

Codecov Report

Merging #607 into master will decrease coverage by 0.46%.
The diff coverage is 23.8%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #607      +/-   ##
==========================================
- Coverage    47.3%   46.84%   -0.47%     
==========================================
  Files          91       87       -4     
  Lines        6204     6197       -7     
==========================================
- Hits         2935     2903      -32     
- Misses       2969     3000      +31     
+ Partials      300      294       -6
Impacted Files Coverage Δ
pkg/leader/etcd/v3/etcd.go 0% <0%> (ø) ⬆️
pkg/rpc/mux/server.go 61.66% <71.42%> (+3.13%) ⬆️
pkg/provider/google/plugin/gcloud/tags.go 82.14% <0%> (+3.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e968dab...7f258ab. Read the comment docs.

David Chung added 6 commits June 24, 2017 14:32
Signed-off-by: David Chung <david.chung@docker.com>
Signed-off-by: David Chung <david.chung@docker.com>
Signed-off-by: David Chung <david.chung@docker.com>
Signed-off-by: David Chung <david.chung@docker.com>
Signed-off-by: David Chung <david.chung@docker.com>
Signed-off-by: David Chung <david.chung@docker.com>
@chungers chungers merged commit 305def1 into docker-archive:master Jun 24, 2017
chungers pushed a commit to chungers/infrakit that referenced this pull request Sep 30, 2017
chungers pushed a commit to chungers/infrakit that referenced this pull request Oct 1, 2017
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.

1 participant