{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4052","repository_url":"https://api.github.com/repos/ipfs/go-ipfs","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4052/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4052/comments","events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4052/events","html_url":"https://github.com/ipfs/go-ipfs/issues/4052","id":241453302,"number":4052,"title":"[add] --nocopy --trickle; copies data and ignores trickle","user":{"login":"djdv","id":13862850,"avatar_url":"https://avatars1.githubusercontent.com/u/13862850?v=4","gravatar_id":"","url":"https://api.github.com/users/djdv","html_url":"https://github.com/djdv","followers_url":"https://api.github.com/users/djdv/followers","following_url":"https://api.github.com/users/djdv/following{/other_user}","gists_url":"https://api.github.com/users/djdv/gists{/gist_id}","starred_url":"https://api.github.com/users/djdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djdv/subscriptions","organizations_url":"https://api.github.com/users/djdv/orgs","repos_url":"https://api.github.com/users/djdv/repos","events_url":"https://api.github.com/users/djdv/events{/privacy}","received_events_url":"https://api.github.com/users/djdv/received_events","type":"User","site_admin":false},"labels":[{"id":109732110,"url":"https://api.github.com/repos/ipfs/go-ipfs/labels/bug","name":"bug","color":"fc2929","default":true},{"id":109732113,"url":"https://api.github.com/repos/ipfs/go-ipfs/labels/help%20wanted","name":"help wanted","color":"0e8a16","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ipfs/go-ipfs/milestones/36","html_url":"https://github.com/ipfs/go-ipfs/milestone/36","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/milestones/36/labels","id":2892103,"number":36,"title":"go-ipfs 0.4.14","description":"","creator":{"login":"Kubuxu","id":2259282,"avatar_url":"https://avatars3.githubusercontent.com/u/2259282?v=4","gravatar_id":"","url":"https://api.github.com/users/Kubuxu","html_url":"https://github.com/Kubuxu","followers_url":"https://api.github.com/users/Kubuxu/followers","following_url":"https://api.github.com/users/Kubuxu/following{/other_user}","gists_url":"https://api.github.com/users/Kubuxu/gists{/gist_id}","starred_url":"https://api.github.com/users/Kubuxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kubuxu/subscriptions","organizations_url":"https://api.github.com/users/Kubuxu/orgs","repos_url":"https://api.github.com/users/Kubuxu/repos","events_url":"https://api.github.com/users/Kubuxu/events{/privacy}","received_events_url":"https://api.github.com/users/Kubuxu/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":10,"state":"open","created_at":"2017-11-06T18:56:10Z","updated_at":"2018-02-10T17:40:34Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2017-07-08T14:19:42Z","updated_at":"2018-02-23T03:37:13Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- Output From `ipfs version --all` -->\r\n#### Version information:\r\ngo-ipfs version: 0.4.10-00573cb2c\r\nRepo version: 5\r\nSystem version: amd64/windows\r\nGolang version: go1.8.3\r\n<!-- Bug, Feature, Enhancement, Etc -->\r\n#### Type:\r\nBug\r\n<!-- One of following:\r\n    Critical - System crash, application panic.\r\n    High - The main functionality of the application does not work, API breakage, repo format breakage, etc.\r\n    Medium - A non-essential functionality does not work, performance issues, etc.\r\n    Low - An optional functionality does not work.\r\n    Very Low - Translation or documentation mistake. Something that really does not matter much but should be noticed for a future release. -->\r\n#### Severity:\r\nLow-Medium\r\n#### Description:\r\nOn my machine if I try to use --nocopy with the trickledag format it will still copy file blocks, as well as output a hash for the standard dag format, but even this behaviour is inconsistent. These are the cases I've tried and their results with a log below, the sample data is just 25M from udevrandom.\r\n\r\nNothing has been done yet, file is added with --nocopy\r\nResult: As expected, file data is not copied to the datastore, standard hash returned\r\nFile has been added via --nocopy already, it is added again with --nocopy and -t\r\nResult: File data is not copied, but standard dag hash returned, not trickle\r\nRepo is cleaned, file is added with --nocopy and -t\r\nResult: File data is copied, and standard dag hash returned\r\nRepo is cleaned, file added with -t\r\nResult: As expected,  file data is copied to the datastore, trickle hash returned\r\n\r\nIn addition to this please look at the log below to see the blocks directory changing size, even after everything is removed it seems to have grown is size a few kb. I'm not sure if this is expected or not.\r\nI haven't tested this elsewhere yet. I originally caught this after adding a lot of files like this `add --nocopy -r -w -Q --chunker=rabin --pin=false --cid-version=1 --hash=Blake2b-256`, -t was only provided conditionally (if more than half the files provided were multimedia files) so the arguments would turn into `add --nocopy -r -w -Q --chunker=rabin --pin=false --cid-version=1 --hash=Blake2b-256 -t`, I don't think any of the other arguments there affect --nocopy like this.\r\n\r\n```\r\n>cd %HOMEPATH%\\.ipfs\r\n\r\n>ipfs init\r\n...\r\n\r\n>ipfs config --json Experimental.FilestoreEnabled true\r\n\r\n>cksum random\r\n2009307347 26214400 random\r\n\r\n>du -sh blocks\r\n68K\tblocks\r\n\r\n>ipfs add --pin=false --nocopy random\r\nadded QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr random\r\n\r\n>du -sh blocks\r\n77K\tblocks\r\n\r\n>ipfs get --output=validate QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr\r\nSaving file(s) to validate\r\n>cksum validate\r\n2009307347 26214400 validate\r\n\r\n>ipfs add --pin=false --nocopy -t random\r\nadded QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr random\r\n\r\n>du -sh blocks\r\n77K\tblocks\r\n\r\n>ipfs get --output=validate QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr\r\nSaving file(s) to validate\r\n>cksum validate\r\n2009307347 26214400 validate\r\n\r\n>ipfs repo gc\r\nremoved QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr\r\n...\r\nremoved zb2rhoTbL7rcs2J8enZ5R54gijwPdLGGHS3JtpFw74vDw8MyZ\r\n\r\n>du -sh blocks\r\n55K\tblocks\r\n\r\n>ipfs add --pin=false --nocopy -t random\r\nadded QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr random\r\n\r\n>du -sh blocks\r\n26M\tblocks\r\n\r\n>ipfs get --output=validate QmYt8DnHxMa2Jo9mcoYMD4rqjobHqhjwTWS4HUXtxuVtMr\r\nSaving file(s) to validate\r\n>cksum validate\r\n2009307347 26214400 validate\r\n\r\n>ipfs repo gc\r\nremoved zb2rhanQbgX9Q4uzrtDC5MtsukDRLBPLPwR4XvYNaJFHpAvSt\r\n...\r\nremoved zb2rhdQWSLuJLhMQ7kwEpRT3pGHeHcMbHjFBJo7DmfNGiWfSF\r\n\r\n>du -sh blocks\r\n67K\tblocks\r\n\r\n>ipfs add --pin=false -t random\r\nadded QmYDL6Rnkhhog6NFwykAtAD2uT5R62PVBB4F9t85vUX6NM random\r\n\r\n>ipfs get --output=validate QmYDL6Rnkhhog6NFwykAtAD2uT5R62PVBB4F9t85vUX6NM\r\nSaving file(s) to validate\r\n>cksum validate\r\n2009307347 26214400 validate\r\n\r\n>ipfs repo gc\r\nremoved QmWLPNh6mVuqsxpWTiW7YNaGWbMjmxfUUweJ18xaiBfn1s\r\n...\r\nremoved QmdtwfJv8g6FQxAnHFVPpNxiasitZGvGzoVtSuScswQZfG\r\n\r\n>du -sh blocks\r\n79K\tblocks\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments/367900526","html_url":"https://github.com/ipfs/go-ipfs/issues/4052#issuecomment-367900526","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/4052","id":367900526,"user":{"login":"kevina","id":1271492,"avatar_url":"https://avatars2.githubusercontent.com/u/1271492?v=4","gravatar_id":"","url":"https://api.github.com/users/kevina","html_url":"https://github.com/kevina","followers_url":"https://api.github.com/users/kevina/followers","following_url":"https://api.github.com/users/kevina/following{/other_user}","gists_url":"https://api.github.com/users/kevina/gists{/gist_id}","starred_url":"https://api.github.com/users/kevina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevina/subscriptions","organizations_url":"https://api.github.com/users/kevina/orgs","repos_url":"https://api.github.com/users/kevina/repos","events_url":"https://api.github.com/users/kevina/events{/privacy}","received_events_url":"https://api.github.com/users/kevina/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T03:37:13Z","updated_at":"2018-02-23T03:37:13Z","author_association":"CONTRIBUTOR","body":"@schomatis the offset is the offset from the start of the backing file, so it should likely be the offset of the base node.  It might be helpful to look at the filestore code to see of PosInfo is used, in particular readDataObj (https://github.com/ipfs/go-ipfs/blob/master/filestore/fsrefstore.go#L152)."}}
{"actor":{"display_login":"kevina"}}