-
Notifications
You must be signed in to change notification settings - Fork 18.9k
daemon: overlay2: Write layer metadata atomically #46471
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
Conversation
When the daemon process or the host running it is abruptly terminated, the layer metadata file can become inconsistent on the file system. Specifically, `link` and `lower` files may exist but be empty, leading to overlay mounting errors during layer extraction, such as: "failed to register layer: error creating overlay mount to <path>: too many levels of symbolic links." This commit introduces the use of `AtomicWriteFile` to ensure that the layer metadata files contain correct data when they exist on the file system. Signed-off-by: Mike <[email protected]>
|
/cc @dmcgowan |
neersighted
left a comment
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.
LGTM
|
Wanted to have a quick check if Line 13 in 39b2bf5
|
thaJeztah
left a comment
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.
LGTM
…ng power cut (#476) During power cycle tests, we have found multiple sporadically issues in case docker image pull operations and a device power cut. Similar issues are reported here (moby/moby#42964) and a fix was provided here (moby/moby#46471). Signed-off-by: Joerg Zeidler <[email protected]>
This is the band aid to address issue #42964.
When the daemon process or the host running it is abruptly terminated, the layer metadata file can become inconsistent on the file system. Specifically,
linkandlowerfiles may exist but be empty, leading to overlay mounting errors during layer extraction, such as: "failed to register layer: error creating overlay mount to : too many levels of symbolic links."This commit introduces the use of
AtomicWriteFileto ensure that the layer metadata files contain correct data when they exist on the file system.The steps to reproduce the issue are described here #42964.