losfair/mvsqlite

Please update the Cargo.lock for moka cache to v0.9.8

tatsuya6502 opened this issue · 2 comments

Hi. Currently, moka cache version is pinned to v0.9.4 by the Cargo.lock file:

mvsqlite/Cargo.lock

Lines 1178 to 1179 in f2117d3

name = "moka"
version = "0.9.4"

Please upgrade it to v0.9.8 or the latest v0.11.2.

We found a critical bug that will cause a segfault in a corner case: moka-rs/moka#281 (comment). It is fixed for v0.11.0 and then backported to v0.9.8 and v0.10.3.

A pull request is already opened by Renovate: #100

I checked the usage of moka in mvSQLite, and I think it is okay to continue using v0.9.4.

I believe the bug will be triggered only when weigher (doc) is set, and all other timings in different threads are met. I found mvSQLite does not set weigher to any Caches.

nskey_cache: Cache::builder()
.time_to_live(Duration::from_secs(120))
.time_to_idle(Duration::from_secs(5))
.max_capacity(10000)
.build(),
// FDB read versions are valid for 5 seconds.
// We conservatively cache them for only 2 seconds here. If for some reason
// these versions still lived too long, FDB will error and the client will retry.
read_version_cache: Cache::builder()
.time_to_live(Duration::from_secs(2))
.max_capacity(1000)
.build(),
read_version_and_nsid_to_lwv_cache: Cache::builder()
.time_to_idle(Duration::from_secs(2))
.build(),
replica_manager,
ns_metadata_cache: NamespaceMetadataCache::new(),
content_cache: if config.content_cache_size > 0 {
Some(
Cache::builder()
.max_capacity(config.content_cache_size as u64)
.build(),
)

cache: Cache::builder()
.time_to_idle(Duration::from_secs(30))
.max_capacity(1000)
.build(),

Anyway, I would still encourage to upgrade moka to v0.9.8 or the latest v0.11.2 just for sure.