Fix BigTable upload early return (#29378)
* Change Err when slot range is empty to Ok and log; add method docs * Update var and log to be more correct * Promote log level to warn
This commit is contained in:
parent
892e23ce08
commit
81394cf92c
|
@ -60,7 +60,7 @@ async fn upload(
|
||||||
ending_slot,
|
ending_slot,
|
||||||
starting_slot.saturating_add(config.max_num_slots_to_check as u64 * 2),
|
starting_slot.saturating_add(config.max_num_slots_to_check as u64 * 2),
|
||||||
);
|
);
|
||||||
let last_slot_uploaded = solana_ledger::bigtable_upload::upload_confirmed_blocks(
|
let last_slot_checked = solana_ledger::bigtable_upload::upload_confirmed_blocks(
|
||||||
blockstore.clone(),
|
blockstore.clone(),
|
||||||
bigtable.clone(),
|
bigtable.clone(),
|
||||||
starting_slot,
|
starting_slot,
|
||||||
|
@ -69,8 +69,8 @@ async fn upload(
|
||||||
Arc::new(AtomicBool::new(false)),
|
Arc::new(AtomicBool::new(false)),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
info!("last slot uploaded: {}", last_slot_uploaded);
|
info!("last slot checked: {}", last_slot_checked);
|
||||||
starting_slot = last_slot_uploaded.saturating_add(1);
|
starting_slot = last_slot_checked.saturating_add(1);
|
||||||
}
|
}
|
||||||
info!("No more blocks to upload.");
|
info!("No more blocks to upload.");
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -41,6 +41,9 @@ struct BlockstoreLoadStats {
|
||||||
pub elapsed: Duration,
|
pub elapsed: Duration,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Uploads a range of blocks from a Blockstore to bigtable LedgerStorage
|
||||||
|
/// Returns the Slot of the last block checked. If no blocks in the range `[staring_slot,
|
||||||
|
/// ending_slot]` are found in Blockstore, this value is equal to `ending_slot`.
|
||||||
pub async fn upload_confirmed_blocks(
|
pub async fn upload_confirmed_blocks(
|
||||||
blockstore: Arc<Blockstore>,
|
blockstore: Arc<Blockstore>,
|
||||||
bigtable: solana_storage_bigtable::LedgerStorage,
|
bigtable: solana_storage_bigtable::LedgerStorage,
|
||||||
|
@ -61,7 +64,8 @@ pub async fn upload_confirmed_blocks(
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if blockstore_slots.is_empty() {
|
if blockstore_slots.is_empty() {
|
||||||
return Err(format!("Ledger has no slots from {starting_slot} to {ending_slot:?}").into());
|
warn!("Ledger has no slots from {starting_slot} to {ending_slot:?}");
|
||||||
|
return Ok(ending_slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
let first_blockstore_slot = blockstore_slots.first().unwrap();
|
let first_blockstore_slot = blockstore_slots.first().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue