Skip to content

Commit

Permalink
feat: replace risingwave lru cache with foyer lru cache for sst cache
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Mar 1, 2024
1 parent 321626d commit 83784e2
Show file tree
Hide file tree
Showing 33 changed files with 374 additions and 327 deletions.
71 changes: 39 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ license = "Apache-2.0"
repository = "https://github.com/risingwavelabs/risingwave"

[workspace.dependencies]
foyer = { git = "https://github.com/mrcroxx/foyer", rev = "cd4319d" }
await-tree = "0.1.1"
aws-config = { version = "1", default-features = false, features = [
"behavior-version-latest",
Expand Down Expand Up @@ -111,11 +112,7 @@ hytra = "0.1"
rdkafka = { package = "madsim-rdkafka", version = "0.3.1", features = [
"cmake-build",
] }
hashbrown = { version = "0.14.0", features = [
"ahash",
"inline-more",
"nightly",
] }
hashbrown = { version = "0.14", features = ["ahash", "inline-more", "nightly"] }
criterion = { version = "0.5", features = ["async_futures"] }
tonic = { package = "madsim-tonic", version = "0.4.1" }
tonic-build = { package = "madsim-tonic-build", version = "0.4.2" }
Expand Down
1 change: 1 addition & 0 deletions src/batch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ assert_matches = "1"
async-recursion = "1"
async-trait = "0.1"
either = "1"
foyer = { workspace = true }
futures = { version = "0.3", default-features = false, features = ["alloc"] }
futures-async-stream = { workspace = true }
futures-util = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions src/batch/src/executor/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ mod tests {
use std::sync::Arc;

use assert_matches::assert_matches;
use foyer::memory::eviction::lru::LruContext;
use futures::StreamExt;
use itertools::Itertools;
use risingwave_common::array::{Array, ArrayImpl, I32Array, StructArray};
use risingwave_common::cache::CachePriority;
use risingwave_common::catalog::{
schema_test_utils, ColumnDesc, ColumnId, INITIAL_TABLE_VERSION_ID,
};
Expand Down Expand Up @@ -400,7 +400,7 @@ mod tests {
epoch,
None,
ReadOptions {
cache_policy: CachePolicy::Fill(CachePriority::High),
cache_policy: CachePolicy::Fill(LruContext::HighPriority),
..Default::default()
},
)
Expand Down
3 changes: 2 additions & 1 deletion src/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ignored = ["workspace-hack"]
normal = ["workspace-hack"]

[dependencies]
ahash = "0.8"
anyhow = "1"
arc-swap = "1"
async-trait = "0.1"
Expand All @@ -26,7 +27,7 @@ dyn-clone = "1.0.14"
either = "1"
enum-as-inner = "0.6"
fail = "0.5"
foyer = { git = "https://github.com/mrcroxx/foyer.git", rev = "2968b21" }
foyer = { workspace = true }
futures = { version = "0.3", default-features = false, features = ["alloc"] }
futures-async-stream = { workspace = true }
hex = "0.4"
Expand Down
Loading

0 comments on commit 83784e2

Please sign in to comment.