-
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
Finalize TarSum Version 1 w/ refactor #8869
Conversation
Version0 Version = iota | ||
// Prefix of "tarsum.dev" | ||
Version1 | ||
// VersionDev is the prefix of "tarsum.dev" |
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.
Should be "VersionDev has", also pretty sure these comments are intended to specify what the prefix of each type is so either should be with each version or removed.
195f7fe
to
520e3ba
Compare
I've run the benchmarks on my machine with both the master version of the package and this branch. It looks like we get some negligible to small improvement in speed and a significant improvement in memory performance which is most noticeable in archives with several files. This is probably due to the changes in how allocations are done when selecting tar headers. Have a look:
|
@ewindisch @vbatts @unclejack please review |
520e3ba
to
f442293
Compare
reading over it, it LGTM. Perhaps, the maneuver to drop the mtime header could be more explicit, but at least you have a comment there ;-) |
Also, I've made progress on writing a specification for the TarSum, and should have a PR for it. Hopefully next week. |
f442293
to
6646961
Compare
updated with fixed variable name. I had called something an |
ping @ewindisch |
@jlhawn Why is mtime being removed? |
@unclejack the .wh. files primarily. but really are not needed. |
LGTM |
ping @vbatts @ewindisch |
1: "tarsum.dev", | ||
Version0: "tarsum", | ||
Version1: "tarsum.v1", | ||
VersionDev: "tarsum.dev", |
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.
👍 Thanks for that. I didn't mean to leave those as just integers. :-)
LGTM |
gah... will amend now. |
The current Dev version of TarSum includes hashing of extended file attributes and omits inclusion of modified time headers. I refactored the logic around the version differences to make it more clear that the difference between versions is in how tar headers are selected and ordered. TarSum Version 1 is now declared with the new Dev version continuing to track it. Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
6646961
to
a7aa2c8
Compare
ping @vbatts @unclejack @jfrazelle @crosbymichael @vieux Please review again due to rebase 👍 |
@jlhawn did you functionally change anything with the rebase, or just double checking from LGTMs? |
no functional changes, no. Just fixed my commit message, and since PR history shows LGTMs before the commit I just wanted double check from maintainers. |
right |
I've been trying to ping @ewindisch too. It's odd that his GitHub username doesn't autocomplete so I'm not sure if he's even getting notifications about this. :( If that's the case I'll need some extra LGTMs from the core maintainers I guess. |
still LGTM |
@jlhawn I've been at a conference this past week. I'll review first chance. |
} | ||
} | ||
|
||
func v1TarHeaderSelect(h *tar.Header) (orderedHeaders [][2]string) { |
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.
not really a fan of version number in a function name, could have probably been an interface, but I understand it might be out of scope for this PR
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.
Well, there is an interface tarHeaderSelector
. I made it so that the tarHeaderSelectFunc
type implements the interface. It's like http.Handler
and http.HandlerFunc
. The version numbers are in the func name because I hadn't thought of a better way to differentiate them.
LGTM |
thanks @ewindisch (hey auto-complete works again!) |
for k := range h.Xattrs { | ||
xAttrKeys = append(xAttrKeys, k) | ||
} | ||
sort.Strings(xAttrKeys) |
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.
hrm. hold the phone. we should add tests around the case sensitivity of the these keys. How that relates to sorting and whether there could be collisions.
Ensuring case size of headers will still be accounted for. moby#8869 (comment) Signed-off-by: Vincent Batts <vbatts@redhat.com>
OK. Just gave myself necessary warm-fuzzies. |
ping @ewindisch |
LGTM. I initially had some issues, but upon review, it was nothing that wasn't already in the existing code. |
Are we good to merge? Do we want anyone else to review? |
LGTM good to go |
+1 |
Finalize TarSum Version 1 w/ refactor
Ensuring case size of headers will still be accounted for. moby#8869 (comment) Signed-off-by: Vincent Batts <vbatts@redhat.com>
The current Dev version of TarSum includes hashing of extended
file attributes and omits inclusion of modified time headers.
I refactored the logic around the version differences to make it
more clear that the difference between versions is in how tar
headers are selected and ordered.
TarSum Version 1 is now declared with the new Dev version continuing
to track it.
Docker-DCO-1.1-Signed-off-by: Josh Hawn josh.hawn@docker.com (github: jlhawn)