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: Fix failure when computing summary in tree benchmark #1968

Merged
merged 1 commit into from Jul 7, 2022

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Jul 6, 2022

This PR makes it so ./bench/irmin-pack/tree.exe runs successfully and is able to produce a summary.

Fixes #1965

@zshipko zshipko added the no-changelog-needed No changelog is needed here label Jul 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 6, 2022

Codecov Report

Merging #1968 (eb6e11b) into main (abeee12) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1968   +/-   ##
=======================================
  Coverage   63.95%   63.95%           
=======================================
  Files         130      130           
  Lines       15479    15479           
=======================================
  Hits         9900     9900           
  Misses       5579     5579           
Impacted Files Coverage Δ
src/irmin-test/store.ml 94.82% <0.00%> (-0.06%) ⬇️
src/irmin-fs/unix/irmin_fs_unix.ml 68.38% <0.00%> (+0.64%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@metanivek
Copy link
Member

I don't have enough context on broader implications, but either the flag also needs to change in octez (see here and here) or the fix for this bug is somewhere deeper in the gc code.

@zshipko
Copy link
Contributor Author

zshipko commented Jul 6, 2022

Yeah, it's very likely that there is some deeper issue but this at least gets us some usable output from the tree benchmark.

@samoht
Copy link
Member

samoht commented Jul 6, 2022

That's a great insight but I am not convinced by the fix :-)

Could you try to trace when an empty tree is generated/written on disk? This is never supposed to happen. I also think we should remove that option and always fail hard when this happens as this is almost always due to a bug - unless I am missing something.

@zshipko zshipko closed this Jul 6, 2022
@zshipko
Copy link
Contributor Author

zshipko commented Jul 6, 2022

Right after closing this I figured out the actual issue - sorry for the noise!

It looks like the store was being initialized with an empty tree in tree.ml: https://github.com/mirage/irmin/pull/1968/files#diff-ac9a848ef33f94ac0d84a06ad3b528d96a7b45df4ce2c699c8617f0f36154a3dL89

This PR now removes that initial empty commit and everything seems to be working - luckily this means this issue does not come from the tezos trace.

@samoht
Copy link
Member

samoht commented Jul 7, 2022

Saving an empty root actually seems a valid use case. I would just make it a no-op so that empty trees are actually never persisted on disk.

@samoht
Copy link
Member

samoht commented Jul 7, 2022

Tracked in #1969 ; your fix is great for now :-)

@samoht samoht merged commit 45d55cd into mirage:main Jul 7, 2022
@zshipko zshipko deleted the fix-bench-tree branch July 18, 2022 18:31
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.

irmin-pack: Failure("Persisting an empty node is forbidden by the configuration of the irmin-pack store")
4 participants