Skip to content

Commit

Permalink
Update upload_confirmed_blocks() return value when no blocks to upload (
Browse files Browse the repository at this point in the history
solana-labs#33861)

upload_confirmed_blocks() states that it will return the passed in
ending_slot when there are no blocks to upload. This is enforced in one
early return but not the other. The result is that BigTableUploadService
could potentially get stuck in a loop of trying to upload the same slot.

While this case seems to be caused when an operator restarts their node
without --no-snapshot-fetch (which can cause a gap in blockstore), we
can still be friendly and allow them to break out of this loop.
  • Loading branch information
steviez authored Oct 26, 2023
1 parent 70107e2 commit a799a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ledger/src/bigtable_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub async fn upload_confirmed_blocks(
"No blocks between {} and {} need to be uploaded to bigtable",
starting_slot, ending_slot
);
return Ok(last_blockstore_slot);
return Ok(ending_slot);
}
let last_slot = *blocks_to_upload.last().unwrap();
info!(
Expand Down

0 comments on commit a799a90

Please sign in to comment.