-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
fix Bind-mounts not properly registering after daemon restart #10147
fix Bind-mounts not properly registering after daemon restart #10147
Conversation
477b6f9
to
16f9a04
Compare
16f9a04
to
a3de790
Compare
v.AddContainer(container.ID) | ||
} else { | ||
// if container was created with an old daemon, this volume may not be registered | ||
v, err := container.daemon.volumes.FindOrCreateVolume(path, container.VolumesRW[path]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the volume is not a rw
volume in VolumesRW
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, from what I can tell this is only used for very old daemons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be pre 1.3 daemons, so not that old.
I'll update this VolumesRW thing to make sure we don't panic here. It shouldn't be nil, but it could be.
a3de790
to
7b2752b
Compare
@crosbymichael Updated |
@cpuguy83 Is it possible to write test for this? We have test-daemon for restarting. |
@LK4D4 There is a test there. |
@cpuguy83 Yup, sorry :) |
v.AddContainer(container.ID) | ||
} else { | ||
// if container was created with an old daemon, this volume may not be registered | ||
var mode = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mode := true
? Also mode
is pretty weird name, maybe writtable
?
7b2752b
to
c837416
Compare
Fixes moby#9629 moby#9768 A couple of issues: 1) Volume config is not restored if we couldn't find it with the graph driver, but bind-mounts would never be found by the graph driver since they aren't in that dir 2) container volumes were only being restored if they were found in the volumes repo, but volumes created by old daemons wouldn't be in the repo until the container is at least started. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
c837416
to
e744b0d
Compare
@LK4D4 Updated |
LGTM |
2 similar comments
LGTM |
LGTM |
…d-container fix Bind-mounts not properly registering after daemon restart
Does it fix #9801? |
thanks @grossws I have closed that issue. |
It will cause a panic with this patch. |
How so? |
hi @cpuguy83 , when u restart the daemon without -g to specify another new storage path, u would like to get this:
And i think this was caused by |
OK, so fast........ |
Fixes #9629 #9768
Volume config is not restored if we couldn't find it with the graph
driver, but bind-mounts would never be found by the graph driver since
they aren't in that dir
container volumes were only being restored if they were found in the
volumes repo, but volumes created by old daemons wouldn't be in the
repo until the container is at least started.