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
chunked: implement OSTree deduplication #1023
Conversation
@@ -1024,6 +1074,21 @@ func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions) (gra | |||
continue | |||
} | |||
|
|||
found, dstFile, _, err = findFileInOSTreeRepos(&r, ostreeRepos, dirfd, useHardLinks) |
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.
Can found be false and dstFIle != nil? Or found be true and dstFile be nil?
If not then the function should only return dstFile.
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.
yes, it can return found == true
, and dstNil == nil
when doing hard links deduplication so the destination file is not overwritten.
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.
How about found ==false dstNil != nil?
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.
no that is not possible. If the file is not found then the destination is not opened
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 make this clearer if it said
if found {
if dstFile != nil {
if err := setFileAttrs(dstFile, mode, &r, options); err != nil {
dstFile.Close()
return output, err
}
dstFile.Close()
}
continue
}
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.
I've simplified it further and pushed a new version
54fdfe2
to
1aee04b
Compare
if the option ostree_repos is set: [storage.options] pull_options = {enable_partial_images = "true", ostree_repos = "/foo:/bar"} then attempt to deduplicate from the specified list of OSTree repositories. In order to be usable, an OSTree repository must be configured to track the checksum for its files payload (payload link), that is disabled by default: ostree config --repo=/path/to/repo set core.payload-link-threshold N Where N is the minimum size for files to be tracked by their payload and must be a nonzero value. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1aee04b
to
a5a3c60
Compare
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
LGTM |
if the option ostree_repos is set:
then attempt to deduplicate from the specified list of OSTree repositories.
In order to be usable, an OSTree repository must be configured to track
the checksum for its files payload (payload link), that is disabled by
default:
ostree config --repo=/path/to/repo set core.payload-link-threshold N
Where N is the minimum size for files to be tracked by their payload
and must be a nonzero value.
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com