Skip to content

Fix live-restore w/ restart policies + volume refs#44231

Merged
cpuguy83 merged 1 commit into
moby:masterfrom
cpuguy83:fix_restore_volumerefs
Oct 3, 2022
Merged

Fix live-restore w/ restart policies + volume refs#44231
cpuguy83 merged 1 commit into
moby:masterfrom
cpuguy83:fix_restore_volumerefs

Conversation

@cpuguy83

Copy link
Copy Markdown
Member

Before this change restarting the daemon in live-restore with running containers + a restart policy meant that volume refs were not restored. This specifically happens when the container is still running and there is a restart policy that would make sure the container was running again on restart.

The bug allows volumes to be removed even though containers are referencing them. 😱

Fixes #41686

Before this change restarting the daemon in live-restore with running
containers + a restart policy meant that volume refs were not restored.
This specifically happens when the container is still running *and*
there is a restart policy that would make sure the container was running
again on restart.

The bug allows volumes to be removed even though containers are
referencing them. 😱

Signed-off-by: Brian Goff <[email protected]>
Comment on lines +388 to +391
t.Run("volume references", testLiveRestoreVolumeReferences)
}

func testLiveRestoreVolumeReferences(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was there a specific reason for splitting this into two functions? (I can see the reason for the subtests inside testLiveRestoreVolumeReferences(), but was a bit confused about the split here 😅 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Potential other live restore tests.
Just namespacing.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

I was wondering indeed when reading that ticket some time ago, but hadn't found the time to dig in "what step" we were missing; thanks!

@thaJeztah thaJeztah added this to the v-next milestone Sep 30, 2022
@Chostakovitch

Copy link
Copy Markdown

@cpuguy83 Wonderful work, thank you!

@cpuguy83

cpuguy83 commented Oct 3, 2022

Copy link
Copy Markdown
Member Author

Backports: 22.06: #44237, 20.10: #44238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker volume prune removes ALL volumes when live restore is enabled and unless-stopped restart policy is used

4 participants