Skip to content

Commit

Permalink
Revert "Upgrade rocksdb crate (#17813)"
Browse files Browse the repository at this point in the history
This reverts commit 1a51faa.
  • Loading branch information
mystenmark authored and ebmifa committed Jun 5, 2024
1 parent e106f84 commit f531168
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
23 changes: 15 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ reqwest = { version = "0.11.20", default_features = false, features = [
"rustls-tls",
] }
roaring = "0.10.1"
rocksdb = { version = "0.22.0", features = [
rocksdb = { version = "0.21.0", features = [
"snappy",
"lz4",
"zstd",
Expand Down
15 changes: 11 additions & 4 deletions crates/typed-store/src/rocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,16 @@ impl RocksDB {
delegate_call!(self.multi_get_cf_opt(keys, readopts))
}

pub fn batched_multi_get_cf_opt<'a, I, K>(
pub fn batched_multi_get_cf_opt<I, K>(
&self,
cf: &impl AsColumnFamilyRef,
keys: I,
sorted_input: bool,
readopts: &ReadOptions,
) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
where
K: AsRef<[u8]> + 'a + ?Sized,
I: IntoIterator<Item = &'a K>,
I: IntoIterator<Item = K>,
K: AsRef<[u8]>,
{
delegate_call!(self.batched_multi_get_cf_opt(cf, keys, sorted_input, readopts))
}
Expand Down Expand Up @@ -932,7 +932,7 @@ impl<K, V> DBMap<K, V> {
.rocksdb
.batched_multi_get_cf_opt(
&self.cf(),
&(keys_bytes?),
keys_bytes?,
/*sorted_keys=*/ false,
&self.opts.readopts(),
)
Expand Down Expand Up @@ -2372,6 +2372,13 @@ impl DBOptions {

self
}

// Optimize tables receiving significant deletions.
// TODO: revisit when intra-epoch pruning is enabled.
pub fn optimize_for_pruning(mut self) -> DBOptions {
self.options.set_min_write_buffer_number_to_merge(2);
self
}
}

/// Creates a default RocksDB option, to be used when RocksDB option is unspecified.
Expand Down

0 comments on commit f531168

Please sign in to comment.