Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ledger distribution resync #4013

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ledger/distribution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use mc_ledger_db::{Ledger, LedgerDB};
use mc_util_telemetry::{mark_span_as_active, start_block_span, tracer, Tracer};
use protobuf::Message;
use retry::{delay, retry, OperationResult};
use rusoto_core::{Region, RusotoError};
use rusoto_core::{request::BufferedHttpResponse, Region, RusotoError};
use rusoto_s3::{HeadObjectError, HeadObjectRequest, PutObjectRequest, S3Client, S3};
use serde::{Deserialize, Serialize};
use std::{fs, path::PathBuf};
Expand Down Expand Up @@ -212,6 +212,13 @@ impl BlockHandler for S3BlockWriter {
Err(RusotoError::Service(HeadObjectError::NoSuchKey(_))) => {
nick-mobilecoin marked this conversation as resolved.
Show resolved Hide resolved
OperationResult::Ok(false)
}
// Happens when the bucket itself doesn't exist
// Separate from the above condition for the `status.as_u16()` logic
Err(RusotoError::Unknown(BufferedHttpResponse { status, .. }))
if status.as_u16() == 404 =>
{
OperationResult::Ok(false)
}
Err(e) => {
log::warn!(self.logger, "Failed to talk to S3 {e:?}, retrying...");
OperationResult::Retry(e)
Expand Down
Loading