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

irmin-pack: add gc cleanup for lower layer #2222

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

metanivek
Copy link
Member

This PR adds the cleanup code for the lower layer in the situation where GC fails, either in the worker or during finalization. I also did some light refactoring to co-locate the swap and cleanup functions in the Lower module.

Update to use volume identifier instead of root string (even though they
are in practice the same thing) and move swap code into the Lower module
for future usage with cleanup.
@metanivek metanivek added the no-changelog-needed No changelog is needed here label Mar 21, 2023
@metanivek metanivek requested review from Firobe and art-w March 22, 2023 13:49
Comment on lines +147 to +148
| [ "volume"; g; "control" ] when is_number g ->
`Control_tmp (int_of_string g)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! It seems I forgot to do it earlier.

src/irmin-pack/unix/lower.ml Outdated Show resolved Hide resolved
Handles the appendable volume control file from a GC:
1. If a control file matches the generation of the upper layer control
file, it is renamed to become the current control file.
2. Otherwise, it is unlinked.
@metanivek metanivek merged commit efb17d2 into mirage:main Mar 24, 2023
@metanivek metanivek deleted the lower_gc_cleanup branch March 24, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog-needed No changelog is needed here
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants