archive: preserve hardlinks in Tar and Untar#8046
Conversation
|
Cross compile is failing ---> Making bundle: cross (in bundles/1.2.0-dev/cross)
Created symlinks: /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/amd64/docker /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/amd64/docker-1.2.0-dev /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/amd64/docker-1.2.0-dev.md5 /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/amd64/docker-1.2.0-dev.sha256
Created binary: /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/386/docker-1.2.0-dev
Created binary: /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/linux/arm/docker-1.2.0-dev
Created binary: /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/darwin/amd64/docker-1.2.0-dev
Created binary: /go/src/github.com/docker/docker/bundles/1.2.0-dev/cross/darwin/386/docker-1.2.0-dev
# github.com/docker/docker/archive
archive/archive.go:194: cannot use stat.Ino (type uint32) as type uint64 in map index
archive/archive.go:198: cannot use stat.Ino (type uint32) as type uint64 in map index |
26a96cb to
81044bd
Compare
|
@crosbymichael fixed PTAL |
|
While this does fix |
|
I must have had a funky setup when testing above, because I just tested this on btrfs, dm and aufs and it preserves hardlinks within the same layer http://fpaste.org/134988/15577514/ What will not be preserved is hardlinks to files that a parent layer owns. |
|
@crosbymichael and @unclejack PTAL |
|
@vbatts I was getting failures in the tests with this PR on btrfs. I'll look into it and provide more information. |
|
Ah. Might be worth me adding some integration tests that inodes match
|
|
@vbatts This failure I was getting looked like this: This is only happening with this PR, master is OK. |
|
@unclejack i've looked into this a bit, and really do not think this failure is a part of this feature, but something racy in the integration tests. If I change the name of the touched file in that test, from "test" to "aaa", then the test passes. It looks like the exported tar stream only gets to around "bin/ifconfig" before it reaches the end of the stream. |
|
Ahh, it looks like this is also the fix for docker-library/official-images#184; swell! 👍 |
|
Awesome. Hopefully I'll get an integration test done after I get my kids to
|
81044bd to
0e829dd
Compare
|
Rebased and added an integration test PTAL @unclejack |
|
@vbatts Integration test failed. See drone details. |
|
Drone failed because of that funky race condition. Again, I'm thinking it's unrelated, but not sure why this expresses it :-\ |
|
@vbatts Disabling seenFiles for TarWithOptions fixes the problem: https://gist.github.com/unclejack/2106d93de3653e07d5e7 The archive ends up getting closed. |
|
Oh good. I'll grab that in the morning
|
0e829dd to
47320e5
Compare
|
Just added a failing test that is more clear than the integration test that is failing. Perhaps i should make a separate PR to get just that unit test and benchmark into master. Though I'm still not sure why this tar stream seems to end early. :-\ |
47320e5 to
14fd587
Compare
There was a problem hiding this comment.
why is this code commented out? can we remove it if it's not going to be used?
There was a problem hiding this comment.
Ah. I was working to get a unit test to isolate the failure, rather than
going through the integration tests that fails more crypticly. I'll
uncomment it.
On Fri, Sep 26, 2014 at 4:03 PM, Erik Hollensbe [email protected]
wrote:
In archive/archive_test.go:
@@ -63,6 +64,51 @@ func TestCmdStreamGood(t *testing.T) {
}
}+func TestTarFiles(t *testing.T) {
+
- // try without hardlinks
- //if err := checkNoChanges(t, 1000, false); err != nil {
- //t.Error(err)
- //}
- // try with hardlinks
why is this code commented out? can we remove it if it's not going to be
used?—
Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/8046/files#r18110637.
|
seems legit; LGTM after my comments are addressed. |
69afc5a to
12cb429
Compare
|
the test failures i'm seeing are fixed with #8571 |
|
also, I hope #8641 would land first, so the benchmarks of this PR are more comparable to master. |
12cb429 to
933cfed
Compare
ea4a4aa to
7e0c0f6
Compare
|
@unclejack @tiborvass ALRIGHTY. I found the subtle issue of recording the Also, cleaned up a couple of spots while I was ruling out points-of-concern. |
There was a problem hiding this comment.
Do we still need this file for something?
There was a problem hiding this comment.
I don't guess so, except as a place to have a main() for debugging... I'll remove it if you don't care for it.
There was a problem hiding this comment.
That's OK, we can keep it as it is. I was under the impression this served a very particular purpose during the debugging phase.
7e0c0f6 to
f55e536
Compare
|
@unclejack done except for removal of the example app. |
There was a problem hiding this comment.
According to google style guide this ta should be pointer, because it contains pointers.
There was a problem hiding this comment.
@LK4D4 are you saying the function needs to be a pointer receiver? (func (ta *tarAppender)...)
f55e536 to
9831c0e
Compare
|
@unclejack @LK4D4 @tiborvass rebased with reviews. PTAL. |
There was a problem hiding this comment.
Maybe make sense to create this as pointer too. Just for consistency.
* integration test for preserving hardlinks Signed-off-by: Vincent Batts <[email protected]> Signed-off-by: Vincent Batts <[email protected]>
By default is a demo of file differences, but can be used to create a tar of changes between an old and new path. Signed-off-by: Vincent Batts <[email protected]> Signed-off-by: Vincent Batts <[email protected]>
Signed-off-by: Vincent Batts <[email protected]> Signed-off-by: Vincent Batts <[email protected]>
9831c0e to
f14a9ed
Compare
|
@LK4D4 fixed. PTAL |
|
LGTM |
2 similar comments
|
LGTM |
|
LGTM |
archive: preserve hardlinks in Tar and Untar
There was a problem hiding this comment.
What if stat is not type syscall.Stat_t ?
ping @unclejack
Signed-off-by: Vincent Batts [email protected]