Skip to content

[18.03] Adding logic to restore networks in order#2656

Merged
dperny merged 1 commit into
moby:bump_v18.03from
thaJeztah:18.03-restore-networks
Jun 6, 2018
Merged

[18.03] Adding logic to restore networks in order#2656
dperny merged 1 commit into
moby:bump_v18.03from
thaJeztah:18.03-restore-networks

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

cherry-pick of #2571 for the 18.03 branch

git checkout -b 18.03-restore-networks upstream/bump_v18.03
git cherry-pick -s -S -x 7f9db677bf1d6413bf6f9a41e4e7349e0dea3d65
git push -u origin

no conflicts, cherry-pick was clean

This commits adds a fix for restore case where
there might a mix of allocated and unallocated
network in raft. During restore the allocator
was going over the networks lexicographically which
would mean that there might be a chance for an
unallocated network say net1 o be allocated the same vxlan
id or subnet pool that was allocated to another networki net2.
Because of this during restoring, when allocator tries
to allocate the reallocate network net2, it would fail
because it allocated network resources to net1 during restore.
This would mean services,tasks and network itself would be in a
messed up state.

Signed-off-by: Abhinandan abhi@docker.com
(cherry picked from commit 7f9db67)
Signed-off-by: Sebastiaan van Stijn github@gone.nl

- What I did

- How I did it

- How to test it

- Description for the changelog

This commits adds a fix for restore case where
there might a mix of allocated and unallocated
network in raft. During restore the allocator
was going over the networks lexicographically which
would mean that there might be a chance for an
unallocated network say net1 o be allocated the same vxlan
id or subnet pool that was allocated to another networki net2.
Because of this during restoring, when allocator tries
to allocate the reallocate network net2, it would fail
because it allocated network resources to net1 during restore.
This would mean services,tasks and network itself would be in a
messed up state.

Signed-off-by: Abhinandan <abhi@docker.com>
(cherry picked from commit 7f9db67)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

Got a failure in CI:

ok  	github.com/docker/swarmkit/manager/orchestrator/global	2.023s	coverage: 82.2% of statements
--- FAIL: TestServiceRemoveDeadTasks (0.26s)
	Error Trace:	task_reaper_test.go:544
	Error:		Not equal: 800 (expected)
			        != 640 (actual)
		

	Error Trace:	task_reaper_test.go:547
	Error:		Not equal: 800 (expected)
			        != 640 (actual)
		

FAIL
coverage: 86.1% of statements
FAIL	github.com/docker/swarmkit/manager/orchestrator/replicated	6.657s
make: *** [coverage] Error 1

@thaJeztah
Copy link
Copy Markdown
Member Author

ping @abhi @fcrisciani @dperny @anshulpundir PTAL

could use some help verifying if the failure is related or not

@thaJeztah
Copy link
Copy Markdown
Member Author

Restarted CI

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2018

Codecov Report

Merging #2656 into bump_v18.03 will increase coverage by <.01%.
The diff coverage is 62.85%.

@@               Coverage Diff               @@
##           bump_v18.03    #2656      +/-   ##
===============================================
+ Coverage        61.68%   61.68%   +<.01%     
===============================================
  Files              134      134              
  Lines            21781    21795      +14     
===============================================
+ Hits             13436    13445       +9     
+ Misses            6913     6904       -9     
- Partials          1432     1446      +14

@mavenugo
Copy link
Copy Markdown
Contributor

mavenugo commented Jun 5, 2018

Thanks @thaJeztah . LGTM

Copy link
Copy Markdown
Contributor

@abhi abhi left a comment

Choose a reason for hiding this comment

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

LGTM

@dperny
Copy link
Copy Markdown
Collaborator

dperny commented Jun 6, 2018

We don't strictly have enough maintainer LGTMs but like Who's Line, everything is made up and the points don't matter.

@dperny dperny merged commit 0b1ad7c into moby:bump_v18.03 Jun 6, 2018
@thaJeztah thaJeztah deleted the 18.03-restore-networks branch June 6, 2018 17:54
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.

4 participants