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

contenthash: don't delete records when a directory is only modified #5521

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

sipsma
Copy link
Collaborator

@sipsma sipsma commented Nov 15, 2024

Before this commit, HandleChange would always recursively remove records whenever any Modify change was applied to a directory path.

This was wasteful in the case where HandleChange was called only due to a metadata modification to a directory. In that case, it makes sense to update the directory's node but no existing entries under the directory need to be thrown away.

Now, we only recursively remove records under a directory for the Delete case and when a Modify change replaces a directory with a non-directory.

Before this commit, HandleChange would always recursively remove records
whenever any Modify change was applied to a directory path.

This was wasteful in the case where HandleChange was called only due to
a metadata modification to a directory. In that case, it makes sense to
*update* the directory's node but no existing entries under the
directory need to be thrown away.

Now, we only recursively remove records under a directory for the Delete
case and when a Modify change replaces a directory with a non-directory.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
@sipsma sipsma merged commit 66996a6 into moby:master Nov 15, 2024
92 checks passed
@thompson-shaun thompson-shaun added this to the v0.18.0 milestone Nov 21, 2024
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.

3 participants