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: archive only reachable objects #2215

Merged
merged 1 commit into from
Mar 27, 2023
Merged

Conversation

art-w
Copy link
Contributor

@art-w art-w commented Mar 14, 2023

Update the GC step "copy deleted data to lower volume" to not include the (orphaned) unreachable commits (and their tree).

@codecov-commenter
Copy link

Codecov Report

Merging #2215 (4eb6118) into main (0ffa990) will decrease coverage by 0.11%.
The diff coverage is 0.00%.

❗ Current head 4eb6118 differs from pull request most recent head 9e4e537. Consider uploading reports for the commit 9e4e537 to get more accurate results

📣 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    #2215      +/-   ##
==========================================
- Coverage   68.07%   67.96%   -0.11%     
==========================================
  Files         135      135              
  Lines       16458    16478      +20     
==========================================
- Hits        11203    11199       -4     
- Misses       5255     5279      +24     
Impacted Files Coverage Δ
src/irmin-pack/unix/errors.ml 28.88% <ø> (ø)
src/irmin-pack/unix/gc_worker.ml 3.82% <0.00%> (-0.44%) ⬇️
src/irmin-pack/unix/io_errors.ml 58.33% <ø> (ø)
src/irmin-pack/unix/lower.ml 60.28% <0.00%> (-1.77%) ⬇️

... and 1 file with indirect coverage changes

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

Copy link
Member

@Firobe Firobe left a comment

Choose a reason for hiding this comment

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

The new reachability algorithm looks right to me :)

src/irmin-pack/unix/lower.ml Outdated Show resolved Hide resolved
Copy link
Member

@metanivek metanivek left a comment

Choose a reason for hiding this comment

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

I think the core algorithm change is correct. Left some thoughts, questions, comments for consideration, as usual. 😄

src/irmin-pack/unix/gc_worker.ml Outdated Show resolved Hide resolved
src/irmin-pack/unix/gc_worker.ml Outdated Show resolved Hide resolved
src/irmin-pack/unix/lower.ml Outdated Show resolved Hide resolved
test/irmin-pack/test_gc.ml Outdated Show resolved Hide resolved
Copy link
Member

@metanivek metanivek left a comment

Choose a reason for hiding this comment

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

LGTM! (just one small cleanup from your refactor that I spotted)

src/irmin-pack/unix/gc_worker.ml Outdated Show resolved Hide resolved
src/irmin-pack/unix/lower.ml Outdated Show resolved Hide resolved
src/irmin-pack/unix/gc_worker.ml Outdated Show resolved Hide resolved
test/irmin-pack/test_gc.ml Outdated Show resolved Hide resolved
@metanivek metanivek merged commit 796fa5d into mirage:main Mar 27, 2023
3 of 4 checks passed
metanivek added a commit to metanivek/opam-repository that referenced this pull request Apr 21, 2023
…min-pack, irmin-pack-tools, irmin-mirage, irmin-mirage-graphql, irmin-mirage-git, irmin-http, irmin-graphql, irmin-git, irmin-fs, irmin-containers, irmin-cli, irmin-chunk and irmin-bench (3.7.0)

CHANGES:

### Added

- **irmin**
  - Add `Conf.pp` and `Conf.equal` to print and compare configuration values
    (mirage/irmin#2227, @samoht)
  - Add a `clear` optional arguments to all function that adds a new commit:
    `Commit.v`, `set`, `set_tree`, `remove`, `test_and_set`,
    `test_and_set_tree`, `test_set_and_get`, `test_set_and_get_tree`, `merge`,
    `merge_tree` and `with_tree`. This new argument allows to control whether
    the tree caches are cleared up after objects are exported to disk during
    the commit. (mirage/irmin#2225, @samoht)

- **irmin-pack**
  - Add configuration option, `lower_root`, to specify a path for archiving data
    during a GC. (mirage/irmin#2177, @metanivek)
  - Add `is_split_allowed` to check if a store allows split. (mirage/irmin#2175, @metanivek)
  - Add `add_volume` to allow creating new empty volume in lower layer. (mirage/irmin#2188,
    @metanivek)
  - Add a `behaviour` function to the GC to check wether the GC will archive or
    delete data. (mirage/irmin#2190, @Firobe)
  - Add a migration on `open_rw` to move the data to the `lower_root` if
    the configuration was enabled (mirage/irmin#2205, @art-w)

### Changed

- **irmin**
  - Expose type equality for `Schema.Info` to avoid defining the `info` function
    multiple times when using similar stores (mirage/irmin#2189, mirage/irmin#2193, @samoht)
- **irmin-pack**
  - GC now changes its behaviour depending on the presence of a lower layer.
    (mirage/irmin#2190, @Firobe)
  - Split now raises an exception if it is not allowed. It is not allowed on
    stores that do not allow GC. (mirage/irmin#2175, @metanivek)
  - GC now supports stores imported V1/V2 stores, in presence of a lower layer
    only. (mirage/irmin#2190, @art-w, @Firobe)
  - Upgrade on-disk format to version 5. (mirage/irmin#2184, @metanivek)
  - Archive to lower volume does not copy orphaned commits. (mirage/irmin#2215, @art-w)

### Fixed
- **irmin-pack**
  - Unhandled exceptions in GC worker process are now reported as a failure
    (mirage/irmin#2163, @metanivek)
  - Fix the silent mode for the integrity checks. (mirage/irmin#2179, @icristescu)
  - Fix file descriptor leak caused by `mmap`. (mirage/irmin#2232, @art-w)
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.

None yet

4 participants