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.
This commit is contained in:
steviez 2023-10-26 10:34:07 +02:00 committed by GitHub
parent 70107e2196
commit a799a90a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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!(