From 50eaa6f50f5d2aa0fdf6b9b52849de51f225bc82 Mon Sep 17 00:00:00 2001 From: Steven Czabaniuk Date: Wed, 25 Oct 2023 14:29:59 +0200 Subject: [PATCH] Update upload_confirmed_blocks() return value when no blocks to upload 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 with a fetched snapshot that causes a gap, 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 3db5f8eebbe863..be28ee8a0703d8 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!(