Skip to content
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

Record the hardlinks in the cache commit message, so we can restore them #828

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

richardc
Copy link
Contributor

@richardc richardc commented Mar 13, 2018

Description

The git backed build cache duplicates hardlinked files, as git just stores them as multiple files that happen to have the same contents. This means on a cache hit we end up with a package that has duplicated files that were intended to be hardlinks.

Here we record the hardlinks in the install_dir in #incremental as they are being added, and add that information as a json blob in the comment of the build cache entry.

Later we use that recording in #restore_from_cache to restore the observed hardlinks.

Closes #827


Maintainers

Please ensure that you check for:

  • [] If this change impacts git cache validity, it bumps the git cache
    serial number
  • [] If this change impacts compatibility with omnibus-software, the
    corresponding change is reviewed and there is a release plan
  • [] If this change impacts compatibility with the omnibus cookbook, the
    corresponding change is reviewed and there is a release plan

@richardc richardc requested a review from a team as a code owner March 13, 2018 17:43
@richardc
Copy link
Contributor Author

Very WIP; potential fix for #827

@richardc richardc force-pushed the rc-spike-hardlink-recording branch 4 times, most recently from a74a99c to bd35ed7 Compare March 14, 2018 09:54
@richardc richardc changed the title SPIKE: Record the hardlinks in the cache commit message, so we can restore them WIP:: Record the hardlinks in the cache commit message, so we can restore them Mar 14, 2018
@richardc richardc force-pushed the rc-spike-hardlink-recording branch from 70e6746 to 7b9160c Compare March 14, 2018 10:40
Code isn't updated for latest version.  Works around travis failures

Signed-off-by: Richard Clamp <[email protected]>
The tests in terms of shellout! were slightly at the wrong level, as it
was also having to test what git_cmd passed onto shellout!

Signed-off-by: Richard Clamp <[email protected]>
Allows, for example, the commit message to be more interestingly
generated.

Signed-off-by: Richard Clamp <[email protected]>
@richardc richardc force-pushed the rc-spike-hardlink-recording branch from 7b9160c to 19ce149 Compare March 14, 2018 11:03
git doesn't care about hardlinks; when it does the checkout it creates
different files.

Here we record the hardlinks in the install_dir as a json blob in the
commit message, then use that to re-hardlink after cache restore.

Signed-off-by: Richard Clamp <[email protected]>
@richardc richardc force-pushed the rc-spike-hardlink-recording branch from 92707fb to 29dee9e Compare March 16, 2018 17:17
@richardc richardc changed the title WIP:: Record the hardlinks in the cache commit message, so we can restore them Record the hardlinks in the cache commit message, so we can restore them Mar 26, 2018
@richardc
Copy link
Contributor Author

I think this is now in a solid enough state to be considered. Thank you maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant