Skip to content

Commit

Permalink
Upgrade rocksdb crate (MystenLabs#17813)
Browse files Browse the repository at this point in the history
## Description 

The upgrades the underlying rocksdb library as well.

## Test plan 

CI
Private testnet: no visible performance change

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
mwtian authored May 18, 2024
1 parent 2770de5 commit 1a51faa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
23 changes: 8 additions & 15 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 @@ -421,7 +421,7 @@ reqwest = { version = "0.11.20", default_features = false, features = [
"rustls-tls",
] }
roaring = "0.10.1"
rocksdb = { version = "0.21.0", features = [
rocksdb = { version = "0.22.0", features = [
"snappy",
"lz4",
"zstd",
Expand Down
15 changes: 4 additions & 11 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<I, K>(
pub fn batched_multi_get_cf_opt<'a, I, K>(
&self,
cf: &impl AsColumnFamilyRef,
keys: I,
sorted_input: bool,
readopts: &ReadOptions,
) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
where
I: IntoIterator<Item = K>,
K: AsRef<[u8]>,
K: AsRef<[u8]> + 'a + ?Sized,
I: IntoIterator<Item = &'a K>,
{
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,13 +2372,6 @@ 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 1a51faa

Please sign in to comment.