(LedgerStore) Use different path for different blockstore storage type. (#23236)

#### Summary of Changes
To avoid mixing the use of different shred storage types, each shred storage type
will have its blockstore in a different directory.

This PR still keeps the RocksFifo setting hidden.  The default ShredStorageType and
blockstore directory are still RocksLevel and `rocksdb`.

Will follow-up with PRs on making FIFO option public in ledger-tool and validator.

#### Test Plan
* Added a new test to verify the existence of `rocksdb-fifo` directory when FIFO compaction is used.
* Updated existing test to verify the current setting still store ledger under `rocksdb` directory.
* Manually ran ledger_cleanup_test with both level and fifo compaction and verified the resulting ledger.
* Ran a validator with this PR.
This commit is contained in:
Yueh-Hsuan Chiang
2022-03-02 18:30:22 -08:00
committed by GitHub
parent 39387e8446
commit 634f4eb37d
6 changed files with 161 additions and 16 deletions

View File

@ -13,7 +13,10 @@ use {
},
solana_entry::poh::compute_hashes_per_tick,
solana_genesis::{genesis_accounts::add_genesis_accounts, Base64Account},
solana_ledger::{blockstore::create_new_ledger, blockstore_db::AccessType},
solana_ledger::{
blockstore::create_new_ledger,
blockstore_db::{AccessType, ShredStorageType},
},
solana_runtime::hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
solana_sdk::{
account::{Account, AccountSharedData, ReadableAccount, WritableAccount},
@ -630,6 +633,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
&genesis_config,
max_genesis_archive_unpacked_size,
AccessType::PrimaryOnly,
ShredStorageType::default(),
)?;
println!("{}", genesis_config);