Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0 backport] Restore active mount counts on live-restore #45824

Merged

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 27, 2023

When live-restoring a container the volume driver needs be notified that there is an active mount for the volume.
Before this change the count is zero until the container stops and the uint64 overflows pretty much making it so the volume can never be removed until another daemon restart.

(cherry picked from commit 647c2a6)

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 24.0.3 milestone Jun 27, 2023
@neersighted neersighted force-pushed the 24.0_backport_fix_live_restore_local_vol_mounts branch from a70be85 to c10f6ae Compare June 27, 2023 19:41
@neersighted
Copy link
Member

Re-picked from 647c2a6 (as the original PR moved).

@thaJeztah
Copy link
Member Author

Arf, looks like I missed that the containerd log changes were now also included in the PR on master, which causes things to fail miserably now

95.41 # github.com/docker/docker/volume/local
95.41 volume/local/local.go:301:12: undefined: log
95.41 volume/local/local.go:301:18: undefined: context
95.41 volume/local/local.go:324:12: undefined: log
95.41 volume/local/local.go:324:18: undefined: context
95.41 volume/local/local.go:382:45: undefined: context
95.41 volume/local/local.go:391:2: undefined: log

@thaJeztah thaJeztah force-pushed the 24.0_backport_fix_live_restore_local_vol_mounts branch from c10f6ae to 1fed2b0 Compare June 28, 2023 07:39
When live-restoring a container the volume driver needs be notified that
there is an active mount for the volume.
Before this change the count is zero until the container stops and the
uint64 overflows pretty much making it so the volume can never be
removed until another daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 647c2a6)
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 24.0_backport_fix_live_restore_local_vol_mounts branch from 1fed2b0 to c24c37b Compare June 28, 2023 07:45
@thaJeztah
Copy link
Member Author

thaJeztah commented Jun 28, 2023

Fixed the missing imports after the updated version;
https://github.com/moby/moby/compare/c10f6aef3b1c25f29ccd7ecfa000f4afcab11f50..c24c37bd8a7de2ed96ac8f6aa2331324832a9f6a

diff --git a/volume/local/local.go b/volume/local/local.go
index 50f3c21c2d..f156ea2339 100644
--- a/volume/local/local.go
+++ b/volume/local/local.go
@@ -6,2 +6,3 @@ package local // import "github.com/docker/docker/volume/local"
 import (
+       "context"
        "encoding/json"
@@ -13,2 +14,3 @@ import (

+       "github.com/containerd/containerd/log"
        "github.com/docker/docker/daemon/names"
diff --git a/volume/service/service.go b/volume/service/service.go
index a5615fe731..adc7fdb239 100644
--- a/volume/service/service.go
+++ b/volume/service/service.go
@@ -7,2 +7,3 @@ import (

+       "github.com/containerd/containerd/log"
        "github.com/docker/docker/api/types"

@cpuguy83 cpuguy83 merged commit 2bef272 into moby:24.0 Jun 28, 2023
101 checks passed
@thaJeztah thaJeztah deleted the 24.0_backport_fix_live_restore_local_vol_mounts branch June 28, 2023 22:37
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.

None yet

4 participants