-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Create a raw node instead of a file node when there is no content. #4693
Conversation
importer/helpers/dagbuilder.go
Outdated
@@ -122,6 +122,34 @@ func (db *DagBuilderHelper) NewUnixfsNode() *UnixfsNode { | |||
return n | |||
} | |||
|
|||
// NewUnixfsLeaf creates a lead node filled with date |
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.
This is going to cause a golint warning. (and date
should be data
)
2f195b8
to
c8f80b9
Compare
Jenkins is complianing about this:
Except (1) I did not touch that file (2) that file is already go formatted in that commit as |
hmm, my bad, I will PR that. it seems it's the order of the imports. |
@whyrusleeping are you ok with changing hash of empty file? |
Doesn't this only apply when raw leaves (experimental) are enabled? |
Just tried, for me it changes to |
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.
Blocking for now.
I would like to get explicit "good to go" from everyone.
This fixes things so when raw-leaves are enabled a zero size file creates a zero size raw leaf. When raw-leaves are not enabled the hash created changes from QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH to Qmdsf68UUYTSSx3i4GtDJfxzpAEZt7Mp23m3qa36LYMSiW, since the type field changed from TFile to TRaw. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
c8f80b9
to
6ab1e71
Compare
@Kubuxu I added a special case to avoid changing the hash, I am removing the blocked label. |
@whyrusleeping @Kubuxu @Stebalien I think this should be good to go now. I believe I addressed the concern that was causing @Kubuxu to block it. |
Should the trickle builder also be taken into consideration here? |
I don't think so. The trickle dag format never returns a leaf node's hash, so it will make sense that an empty node is simply a node with no children, rather than an empty leaf node. |
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.
This LGTM. Thanks for the test making sure it stays the same
This fixes things so when raw-leaves are enabled a zero size file creates a zero size raw leaf.
When raw-leaves are not enabled the hash created changes fromQmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH
toQmdsf68UUYTSSx3i4GtDJfxzpAEZt7Mp23m3qa36LYMSiW
, since the type fieldchanged from
TFile
toTRaw
.Closes #4688