Skip to content

Commit

Permalink
1.36 index fix (#19947)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## 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:
- [ ] REST API:

---------

Co-authored-by: Eugene Boguslavsky <[email protected]>
  • Loading branch information
bmwill and ebmifa authored Oct 22, 2024
1 parent f4695a9 commit 032ac7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
14 changes: 1 addition & 13 deletions crates/sui-core/src/jsonrpc_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ pub struct IndexStoreTables {

#[default_options_override_fn = "coin_index_table_default_config"]
#[deprecated]
#[allow(unused)]
coin_index: DBMap<CoinIndexKey, CoinInfo>,
#[default_options_override_fn = "coin_index_table_default_config"]
coin_index_2: DBMap<CoinIndexKey2, CoinInfo>,
Expand Down Expand Up @@ -340,19 +341,6 @@ impl IndexStoreTables {
// Commit to the DB that the indexes have been initialized
self.meta.insert(&(), &metadata)?;

// Clear old, deprecated and unused column families
if !self.coin_index.is_empty() {
self.coin_index.unsafe_clear()?;
}

if !self.loaded_child_object_versions.is_empty() {
self.loaded_child_object_versions.unsafe_clear()?;
}

if !self.timestamps.is_empty() {
self.timestamps.unsafe_clear()?;
}

Ok(())
}
}
Expand Down
9 changes: 8 additions & 1 deletion crates/typed-store/src/rocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,14 @@ impl<K, V> DBMap<K, V> {
}

fn report_metrics(rocksdb: &Arc<RocksDB>, cf_name: &str, db_metrics: &Arc<DBMetrics>) {
let cf = rocksdb.cf_handle(cf_name).expect("Failed to get cf");
let Some(cf) = rocksdb.cf_handle(cf_name) else {
tracing::warn!(
"unable to report metrics for cf {cf_name:?} in db {:?}",
rocksdb.db_name()
);
return;
};

db_metrics
.cf_metrics
.rocksdb_total_sst_files_size
Expand Down

0 comments on commit 032ac7d

Please sign in to comment.