From a799a90a62958dcf91080671eb0bc70862f60433 Mon Sep 17 00:00:00 2001 From: steviez Date: Thu, 26 Oct 2023 10:34:07 +0200 Subject: [PATCH] Update upload_confirmed_blocks() return value when no blocks to upload (#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. --- ledger/src/bigtable_upload.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/src/bigtable_upload.rs b/ledger/src/bigtable_upload.rs index 3db5f8eeb..be28ee8a0 100644 --- a/ledger/src/bigtable_upload.rs +++ b/ledger/src/bigtable_upload.rs @@ -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!(