* Purge expired BlockHeight data from blockstore (#17634)
* Purge expired BlockHeight data from blockstore
* Also call compact_storage and add comment....
(cherry picked from commit 96cdbfdcc0
)
# Conflicts:
# ledger/src/blockstore_db.rs
* Fix conflict
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
@ -165,6 +165,10 @@ impl Blockstore {
|
|||||||
& self
|
& self
|
||||||
.db
|
.db
|
||||||
.delete_range_cf::<cf::PerfSamples>(&mut write_batch, from_slot, to_slot)
|
.delete_range_cf::<cf::PerfSamples>(&mut write_batch, from_slot, to_slot)
|
||||||
|
.is_ok()
|
||||||
|
& self
|
||||||
|
.db
|
||||||
|
.delete_range_cf::<cf::BlockHeight>(&mut write_batch, from_slot, to_slot)
|
||||||
.is_ok();
|
.is_ok();
|
||||||
let mut w_active_transaction_status_index =
|
let mut w_active_transaction_status_index =
|
||||||
self.active_transaction_status_index.write().unwrap();
|
self.active_transaction_status_index.write().unwrap();
|
||||||
@ -263,6 +267,10 @@ impl Blockstore {
|
|||||||
&& self
|
&& self
|
||||||
.perf_samples_cf
|
.perf_samples_cf
|
||||||
.compact_range(from_slot, to_slot)
|
.compact_range(from_slot, to_slot)
|
||||||
|
.unwrap_or(false)
|
||||||
|
&& self
|
||||||
|
.block_height_cf
|
||||||
|
.compact_range(from_slot, to_slot)
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
compact_timer.stop();
|
compact_timer.stop();
|
||||||
if !result {
|
if !result {
|
||||||
|
@ -267,6 +267,8 @@ impl Rocks {
|
|||||||
ColumnFamilyDescriptor::new(PerfSamples::NAME, get_cf_options(&access_type));
|
ColumnFamilyDescriptor::new(PerfSamples::NAME, get_cf_options(&access_type));
|
||||||
let block_height_cf_descriptor =
|
let block_height_cf_descriptor =
|
||||||
ColumnFamilyDescriptor::new(BlockHeight::NAME, get_cf_options(&access_type));
|
ColumnFamilyDescriptor::new(BlockHeight::NAME, get_cf_options(&access_type));
|
||||||
|
// Don't forget to add to both run_purge_with_stats() and
|
||||||
|
// compact_storage() in ledger/src/blockstore/blockstore_purge.rs!!
|
||||||
|
|
||||||
let cfs = vec![
|
let cfs = vec![
|
||||||
(SlotMeta::NAME, meta_cf_descriptor),
|
(SlotMeta::NAME, meta_cf_descriptor),
|
||||||
|
Reference in New Issue
Block a user