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

feat: impl eviction-time disk cache insertion #830

Merged
merged 7 commits into from
Jan 10, 2025
Merged

feat: impl eviction-time disk cache insertion #830

merged 7 commits into from
Jan 10, 2025

Conversation

MrCroxx
Copy link
Collaborator

@MrCroxx MrCroxx commented Jan 8, 2025

What's changed and what's your intention?

Please explain IN DETAIL what the changes are in this PR and why they are needed. :D

Delay the disk cache insertion from insertion time to eviction time.

Besides, no longer borrow the in-mem cache as the disk cache in-queue entry index. It is okay to have a gap that may have cache miss between in-mem cache eviction and disk cache insertion. Because after #785 , in-mem cache no longer guarantees that an entry is still available when it is not in the indexer but still in memory.

Changes:

  • Delay the disk cache insertion from insertion time to eviction time.
  • Never double write the disk cache while in-mem cache insertion.
  • Introduce Pipe and Piece as the bridge between in-mem cache and disk cache.
  • Refactors on some implementations.

Checklist

  • I have written the necessary rustdoc comments
  • I have added the necessary unit tests and integration tests
  • I have passed make all (or make fast instead if the old tests are not modified) in my local environment.

Related issues or PRs (optional)

close #818

@MrCroxx MrCroxx added feature New feature or request refactor labels Jan 8, 2025
@MrCroxx MrCroxx added this to the v0.14 milestone Jan 8, 2025
@MrCroxx MrCroxx self-assigned this Jan 8, 2025
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 91.40271% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
foyer-memory/src/raw.rs 57.89% 8 Missing ⚠️
foyer-memory/src/pipe.rs 89.65% 6 Missing ⚠️
foyer-memory/src/cache.rs 88.88% 2 Missing ⚠️
foyer-storage/src/small/batch.rs 83.33% 2 Missing ⚠️
foyer-storage/src/engine.rs 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
foyer-storage/src/large/batch.rs 85.29% <100.00%> (-0.22%) ⬇️
foyer-storage/src/large/flusher.rs 86.31% <100.00%> (ø)
foyer-storage/src/large/generic.rs 90.73% <100.00%> (+0.81%) ⬆️
foyer-storage/src/large/reclaimer.rs 85.36% <100.00%> (-0.12%) ⬇️
foyer-storage/src/large/recover.rs 90.90% <100.00%> (-0.07%) ⬇️
foyer-storage/src/small/flusher.rs 85.29% <100.00%> (-0.71%) ⬇️
foyer-storage/src/small/generic.rs 75.97% <100.00%> (-1.16%) ⬇️
foyer-storage/src/small/set.rs 94.11% <100.00%> (-0.04%) ⬇️
foyer-storage/src/small/set_manager.rs 89.65% <100.00%> (-0.69%) ⬇️
foyer-storage/src/storage/either.rs 40.81% <100.00%> (ø)
... and 10 more

... and 1 file with indirect coverage changes

@MrCroxx
Copy link
Collaborator Author

MrCroxx commented Jan 10, 2025

More details in risingwavelabs/risingwave#20076

@MrCroxx MrCroxx merged commit 170a410 into main Jan 10, 2025
27 checks passed
@MrCroxx MrCroxx deleted the xx/evict branch January 10, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request refactor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

feat: insert disk cache on mem cache eviction
1 participant