Add log for missing start_slot in blockstore_processor (#26566)

blockstore_processor can do nothing in this case; the log might help
user realize that their snapshot and ledger are disjoint.
This commit is contained in:
steviez 2022-07-11 19:11:16 -04:00 committed by GitHub
parent 8e8c6e60ff
commit 26ad45e723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -770,7 +770,7 @@ pub(crate) fn process_blockstore_for_bank_0(
bank0.set_compute_budget(opts.runtime_config.compute_budget); bank0.set_compute_budget(opts.runtime_config.compute_budget);
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank0))); let bank_forks = Arc::new(RwLock::new(BankForks::new(bank0)));
info!("processing ledger for slot 0..."); info!("Processing ledger for slot 0...");
process_bank_0( process_bank_0(
&bank_forks.read().unwrap().root_bank(), &bank_forks.read().unwrap().root_bank(),
blockstore, blockstore,
@ -798,7 +798,7 @@ pub fn process_blockstore_from_root(
assert!(bank.parent().is_none()); assert!(bank.parent().is_none());
let start_slot = bank.slot(); let start_slot = bank.slot();
info!("processing ledger from slot {}...", start_slot); info!("Processing ledger from slot {}...", start_slot);
let now = Instant::now(); let now = Instant::now();
// ensure start_slot is rooted for correct replay // ensure start_slot is rooted for correct replay
@ -842,9 +842,15 @@ pub fn process_blockstore_from_root(
accounts_background_request_sender, accounts_background_request_sender,
)?; )?;
} else { } else {
// If there's no meta for the input `start_slot`, then we started from a snapshot // If there's no meta in the blockstore for the input `start_slot`,
// and there's no point in processing the rest of blockstore and implies blockstore // then we started from a snapshot and are unable to process anything.
// should be empty past this point. //
// If the ledger has any data at all, the snapshot was likely taken at
// a slot that is not within the range of ledger min/max slot(s).
warn!(
"Starting slot {} is not in Blockstore, unable to process",
start_slot
);
}; };
let processing_time = now.elapsed(); let processing_time = now.elapsed();