(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

@ -23,7 +23,9 @@ use {
ancestor_iterator::AncestorIterator,
bank_forks_utils,
blockstore::{create_new_ledger, Blockstore, PurgeType},
blockstore_db::{self, AccessType, BlockstoreOptions, BlockstoreRecoveryMode, Database},
blockstore_db::{
self, AccessType, BlockstoreOptions, BlockstoreRecoveryMode, Database, ShredStorageType,
},
blockstore_processor::ProcessOptions,
shred::Shred,
},
@ -1715,6 +1717,7 @@ fn main() {
&genesis_config,
solana_runtime::hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
AccessType::PrimaryOnly,
ShredStorageType::default(),
)
.unwrap_or_else(|err| {
eprintln!("Failed to write genesis config: {:?}", err);