swarmkit icon indicating copy to clipboard operation
swarmkit copied to clipboard

Automatically update raft IP address when it changes

Open aaronlehmann opened this issue 7 years ago • 18 comments

This adds an AddrMismatch flag to ProcessRaftMessageResponse, which allows any node that receives a Raft message to signal to the sender that its address didn't match the expected value. Based on this, the sending node can try to call Join again to update its address in Raft.

Using a flag returned on responses to Raft messages allows us to notice address changes that happen at any time, not just between daemon restarts.

This behavior will only be enabled when the advertise address was originally autodetected, to prevent fixed addresses from being changed. A flag has been added to inform the raft code whether the address was autodetected or not. The only change necessary in Docker Engine to enable this feature will be to set this flag in cases where the advertise address was originally autodetected.

DEPENDS ON #2198

cc @aluzzardi @cyli

aaronlehmann avatar May 23 '17 19:05 aaronlehmann

Codecov Report

Merging #2199 into master will increase coverage by 0.13%. The diff coverage is 45%.

@@            Coverage Diff             @@
##           master    #2199      +/-   ##
==========================================
+ Coverage    60.1%   60.23%   +0.13%     
==========================================
  Files         128      128              
  Lines       26177    26204      +27     
==========================================
+ Hits        15734    15785      +51     
+ Misses       9045     9015      -30     
- Partials     1398     1404       +6

codecov[bot] avatar May 23 '17 21:05 codecov[bot]

I have corresponding moby changes at https://github.com/aaronlehmann/docker/tree/swarmkit-rejoin

I've tested this with a cluster and verified that when I restart machines and their IPs change, they get updated automatically.

This branch also has the changes to support swarm join while already part of a cluster. I haven't tested this yet, though, and I'm starting to question the usefulness of this part.

aaronlehmann avatar May 24 '17 00:05 aaronlehmann

LGTM

aluzzardi avatar Jun 13 '17 22:06 aluzzardi

needs a rebase

thaJeztah avatar Aug 05 '17 14:08 thaJeztah

I can rebase and carry this forward, if that would be helpful :)

cyli avatar Aug 08 '17 17:08 cyli

I would appreciate that! But keep in mind the following:

  • This feature would be incomplete if overlay networking and gossip can't handle IP changes. Before merging it, you may want to make sure that those handle the situation correctly, or wait until the necessary changes are made.
  • You'll need to carry the moby changes for this change to be useful.
  • There was some UX discussion that never seemed completely resolved. They may pop back up if/when a moby PR is opened.

aaronlehmann avatar Aug 09 '17 02:08 aaronlehmann

@cyli I have the corresponding network changes. I haven't gotten a chance to test it out end to end. I will try it this week

abhi avatar Aug 09 '17 17:08 abhi

@aaronlehmann Thanks for the caveats! I didn't realize that networking and gossip may not handle the changes. Will do. And thanks @abhinandanpb - was just about to ping you :)

cyli avatar Aug 09 '17 17:08 cyli

(I can't seem to push to this branch - I will open another PR that references this whenever @abhinandanpb would find it useful)

cyli avatar Aug 10 '17 01:08 cyli

I've opened this branch to other committers.

aaronlehmann avatar Aug 10 '17 02:08 aaronlehmann

Thanks @aaronlehmann!

cyli avatar Aug 10 '17 06:08 cyli

This LGTM if everything it passes @abhinandanpb's network tests.

cyli avatar Aug 24 '17 17:08 cyli

ping! what the status on this one?

thaJeztah avatar Sep 22 '17 08:09 thaJeztah

@abhi Have the network changes been merged? If so, if I rebase this to the latest master and the tests pass, is this good to go on rebase?

cyli avatar Feb 06 '18 00:02 cyli

ping @abhi ^^

thaJeztah avatar Mar 07 '18 11:03 thaJeztah

Hi, Any news on this issue?

orenye avatar Mar 04 '20 19:03 orenye

This is a much needed feature. Can it please undergo review and rebase ? @thaJeztah @aaronlehmann

nstankov-bg avatar Jul 15 '21 03:07 nstankov-bg

Wow, interesting to see this PR is still open after several years. I'm no longer involved in the swarmkit project, so I think one of the current maintainers would have to pick this up and bring it up to date.

aaronlehmann avatar Jul 15 '21 16:07 aaronlehmann