mirage / irmin

Irmin is a distributed database that follows the same design principles as Git
https://irmin.org
ISC License
1.83k stars 154 forks source link

irmin-pack: support out-of-order objects in GC reachability analysis #2244

Closed art-w closed 1 year ago

art-w commented 1 year ago

Legacy archive node can contain "out of order" objects, caused by a buggy tree export, where parent nodes can have a smaller offset than their children... This then trigger an issue when the sparse prefix file is created, as it detects the out-of-order live range.

Since we don't expect a lot of out-of-order ranges (compared to in-order ranges), this PR handle them in a separate list that is merged at the end with the bulk of in-order ranges.

codecov-commenter commented 1 year ago

Codecov Report

Merging #2244 (df720e0) into main (4c38a4b) will increase coverage by 0.14%. The diff coverage is 71.21%.

:exclamation: Current head df720e0 differs from pull request most recent head 057c8d1. Consider uploading reports for the commit 057c8d1 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #2244      +/-   ##
==========================================
+ Coverage   67.93%   68.08%   +0.14%     
==========================================
  Files         136      137       +1     
  Lines       16603    16636      +33     
==========================================
+ Hits        11279    11326      +47     
+ Misses       5324     5310      -14     
Impacted Files Coverage Δ
src/irmin-pack/unix/gc.ml 69.79% <0.00%> (-3.62%) :arrow_down:
src/irmin-pack/unix/gc_worker.ml 3.77% <0.00%> (+0.53%) :arrow_up:
src/irmin-pack/unix/ranges.ml 82.45% <82.45%> (ø)

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more