{"action":"created","issue":{"url":"https://api.github.com/repos/flatpak/flatpak/issues/2342","repository_url":"https://api.github.com/repos/flatpak/flatpak","labels_url":"https://api.github.com/repos/flatpak/flatpak/issues/2342/labels{/name}","comments_url":"https://api.github.com/repos/flatpak/flatpak/issues/2342/comments","events_url":"https://api.github.com/repos/flatpak/flatpak/issues/2342/events","html_url":"https://github.com/flatpak/flatpak/pull/2342","id":383131883,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNjc0NDEz","number":2342,"title":"Double disk de-duplication on --system pull","user":{"login":"uajain","id":8775041,"node_id":"MDQ6VXNlcjg3NzUwNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/8775041?v=4","gravatar_id":"","url":"https://api.github.com/users/uajain","html_url":"https://github.com/uajain","followers_url":"https://api.github.com/users/uajain/followers","following_url":"https://api.github.com/users/uajain/following{/other_user}","gists_url":"https://api.github.com/users/uajain/gists{/gist_id}","starred_url":"https://api.github.com/users/uajain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uajain/subscriptions","organizations_url":"https://api.github.com/users/uajain/orgs","repos_url":"https://api.github.com/users/uajain/repos","events_url":"https://api.github.com/users/uajain/events{/privacy}","received_events_url":"https://api.github.com/users/uajain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-11-21T14:02:15Z","updated_at":"2018-11-30T00:39:28Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/flatpak/flatpak/pulls/2342","html_url":"https://github.com/flatpak/flatpak/pull/2342","diff_url":"https://github.com/flatpak/flatpak/pull/2342.diff","patch_url":"https://github.com/flatpak/flatpak/pull/2342.patch"},"body":"This PR tries to address the issue : https://github.com/ostreedev/ostree/issues/1723\r\n(ideally we wanted to move this issue inside Flatpak's umbrella but it's seems that it's not possible). So please refer to the discussion there. Most of moderate to high-level details inside commit messages too.\r\n\r\nSummary of changes:\r\n* Let system-helper create a child repo in `$SYSTEM_REPO/tmp`. For convenience  put this child repo in a cache dir (that has the convention `flatpak-cache-$ref-XXXXXX`)\r\n* `FlatpakSystemHelperOngoingPull`'s struct member `root_dir` points to this `flatpak-cache-$ref-XXXXXX` (because it's the root owned directory)\r\n* `FlatpakSystemHelperOngoingPull`'s struct member `user_dir` points to this another directory that gets created `flatpak-cache-$ref-XXXXXX-bindfs`. We will `bindfs` mount this directory and give it back to the client to do the pull in the child repo. `bindfs` lets client (non-sudo) write to this child repo. While the actual file creation is being done in the `root_dir` folder. As long as the bindfs mount  is up, the client is able to write(or pull) to the child repo.\r\n* When the child pull is finished, we unmount `bindfs` mount. In case of failure, we force unmount things or kill the `bindfs` subprocess. The idea to use a FUSE filesystem is basically that it is in user space and can be spawned into a separate child process(which can be killed).\r\n* Make the local \"trusted\" pull. That should use hardlinks and thus double disk situation is avoided.\r\n* In case of error in mounting directories or pull failures, we the system-helper's `CancelPull` method, to cleanup.\r\n* If `bindfs` is not found on the system, we fallback on the current `--system` pull  behaviour (that would use double-disk space). \r\n\r\nI have been testing this since couple of weeks now. It has worked well in my testing locally. Though I am having troubles on how to write rigours tests for this feature (any help is welcome here). "},"comment":{"url":"https://api.github.com/repos/flatpak/flatpak/issues/comments/443047552","html_url":"https://github.com/flatpak/flatpak/pull/2342#issuecomment-443047552","issue_url":"https://api.github.com/repos/flatpak/flatpak/issues/2342","id":443047552,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzA0NzU1Mg==","user":{"login":"mwleeds","id":7833263,"node_id":"MDQ6VXNlcjc4MzMyNjM=","avatar_url":"https://avatars2.githubusercontent.com/u/7833263?v=4","gravatar_id":"","url":"https://api.github.com/users/mwleeds","html_url":"https://github.com/mwleeds","followers_url":"https://api.github.com/users/mwleeds/followers","following_url":"https://api.github.com/users/mwleeds/following{/other_user}","gists_url":"https://api.github.com/users/mwleeds/gists{/gist_id}","starred_url":"https://api.github.com/users/mwleeds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwleeds/subscriptions","organizations_url":"https://api.github.com/users/mwleeds/orgs","repos_url":"https://api.github.com/users/mwleeds/repos","events_url":"https://api.github.com/users/mwleeds/events{/privacy}","received_events_url":"https://api.github.com/users/mwleeds/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T00:39:28Z","updated_at":"2018-11-30T00:39:28Z","author_association":"COLLABORATOR","body":"Okay, so it sounds like the commit messages could be updated to say we're aiming for a \"hardlinkable pull\" rather than a \"trusted pull\", but don't do it now because I think you'd erase my pending review comments"}}
{"actor":{"display_login":"mwleeds"}}