rustic_core icon indicating copy to clipboard operation
rustic_core copied to clipboard

refactor: separate backend operations

Open aawsome opened this issue 7 months ago • 1 comments

This PR refactors indexer and packer into a version which is completely independent from I/O and concurrency but simply provides the functionality. This can then be separated into real "core" functionality.

As a side effect, this PR solves the following topics:

  • Ensure that really no duplicate blobs are saved (closes #146)
  • Solves potential race conditions (which in theory could lead to data loss) between finalizing packer/indexed and file_saver by using self in the finalize methods.

aawsome avatar May 31 '25 15:05 aawsome

Codecov Report

:x: Patch coverage is 61.81102% with 97 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 44.0%. Comparing base (6d3577d) to head (9555d5b).

Files with missing lines Patch % Lines
crates/core/src/blob/repopacker.rs 60.1% 53 Missing :warning:
crates/core/src/commands/prune.rs 56.6% 13 Missing :warning:
crates/core/src/blob/pack_sizer.rs 65.0% 7 Missing :warning:
crates/core/src/blob/packer.rs 73.9% 6 Missing :warning:
crates/core/src/commands/repair/index.rs 0.0% 6 Missing :warning:
crates/core/src/index/indexer.rs 89.2% 3 Missing :warning:
crates/core/src/backend/decrypt.rs 33.3% 2 Missing :warning:
crates/core/src/commands/copy.rs 0.0% 2 Missing :warning:
crates/core/src/commands/merge.rs 0.0% 2 Missing :warning:
crates/core/src/commands/repair/snapshots.rs 0.0% 2 Missing :warning:
... and 1 more
Additional details and impacted files
Files with missing lines Coverage Δ
crates/core/src/archiver/file_archiver.rs 63.1% <100.0%> (ø)
crates/core/src/archiver/tree_archiver.rs 69.7% <100.0%> (ø)
crates/core/src/blob.rs 72.7% <ø> (-7.3%) :arrow_down:
crates/core/src/chunker.rs 50.5% <ø> (-1.2%) :arrow_down:
crates/core/src/archiver.rs 58.9% <66.6%> (-0.8%) :arrow_down:
crates/core/src/backend/decrypt.rs 48.1% <33.3%> (+0.2%) :arrow_up:
crates/core/src/commands/copy.rs 0.0% <0.0%> (ø)
crates/core/src/commands/merge.rs 0.0% <0.0%> (ø)
crates/core/src/commands/repair/snapshots.rs 0.0% <0.0%> (ø)
crates/core/src/index/indexer.rs 91.6% <89.2%> (+45.5%) :arrow_up:
... and 5 more

... and 19 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 04 '25 07:06 codecov[bot]