-
Notifications
You must be signed in to change notification settings - Fork 39
Support matching chunks using uncompressed digests in zck_delta_size and zckdl #112
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
base: main
Are you sure you want to change the base?
Conversation
|
I see errors in windows compilations, but they are not related to the new code... maybe a compiler update now treating implicit function declarations as errors? |
jdieter
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.
I have some suggestions to restructure the logic on this. Can you please take a look and tell me what you think?
| HASH_FIND(hh, src_info->ht, tgt_idx->digest, tgt_idx->digest_size, f); | ||
| if(f && f->length == tgt_idx->length && | ||
| f->comp_length == tgt_idx->comp_length) | ||
| /* If both archives has uncompressed data digests, check them instead of the compressed ones */ |
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 think my preference here is to first check that the compression types are identical, and, if so, run HASH_FIND. If f is still NULL (either because the compression types weren't identical or because HASH_FIND didn't find a matching hash), then check if both have uncompressed sources, and if so, run HASH_FIND on the uncompressed sources. This ensures that matching compressed hashes are checked first, and we then only check for matching uncompressed sources if no matches were found.
| } | ||
|
|
||
| /* | ||
| * Compare digest for compressed data if the same compressor |
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.
If you make the above change, is this full change necessary? Maybe it's better to just duplicate the logic I suggested above?
| ALLOCD_BOOL(NULL, b); | ||
| } | ||
|
|
||
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 prefer not to have spaces/tabs in empty lines.
Previous version was not checking uncompressed data digests if available, leading to being unable to reuse chunks compressed with different zstd versions, which lead to different compressed data and different compressed data digests.