moby / moby/swarmkit

Promoting 2 nodes in short succession sometimes leave one node unreachable

Open
#2,196 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.7k
Forks
676
Avg merge
4d 9h
Merged PRs (30d)
6

Description

In the course of writing some end to end tests for docker, I've found that sometimes promoting 2 nodes in short succession sometimes fails. One of the promoted nodes ends up in "Unreachable" state and has to be removed from the cluster and rejoined.

The failure is intermittent. It does not happen every time. The failure may or may not be related to previous promote/demote cycles failing silently.

The code snippet that causes this:

	// now promote 2 workers at the same time
	// first, pick 2 workers
	candidates := workers[0:2]
	// update both of their specs
	for _, candidate := range candidates {
		// get the latest version of the candidate
		c, _, err := cli.NodeInspectWithRaw(testContext, candidate.ID)
		require.NoError(t, err, "error getting latest version of candidate %v", candidate.ID)
		c.Spec.Role = swarm.NodeRoleManager
		err = cli.NodeUpdate(testContext, c.ID, c.Version, c.Spec)
		require.NoError(t, err, "error with node update")
	}

And the result:

ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS
0d1lke3s3zbwnaopuqqhdlull     sanimej-e2e-1       Ready               Active              Unreachable
m3tj6cxmvpkg8th29w6kr4uoc *   sanimej-e2e-0       Ready               Active              Leader
vn4jsthinmzit3ckvvb3ipttx     sanimej-e2e-2       Ready               Active              Reachable

As you can see, one node is Unreachable

/cc @sanimej

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Docker end-to-end test snippet that promotes two workers through NodeInspectWithRaw and NodeUpdate, then examine the promotion and prior promote/demote-cycle behavior. Reproduce repeated promotions in short succession and compare the cluster's manager statuses. Done means both promoted nodes remain Reachable without requiring removal and rejoining.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.