@peter/fix upload (#378)

* record error message when uploading segments
This commit is contained in:
0g-peterzhb 2025-07-03 19:42:06 +08:00 committed by GitHub
parent 3de0dc5ba3
commit 28654efde1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,8 +77,19 @@ impl RpcServer for RpcServerImpl {
let maybe_tx = self.ctx.log_store.get_tx_by_seq_number(tx_seq).await?;
for segment in segments.into_iter() {
self.put_segment_with_maybe_tx(segment, maybe_tx.clone())
.await?;
match self
.put_segment_with_maybe_tx(segment, maybe_tx.clone())
.await
{
Ok(()) => {} // success
Err(e)
if e.to_string()
.contains("segment has already been uploaded or is being uploaded") =>
{
debug!(?e, "duplicate segment - skipping");
}
Err(e) => return Err(e),
}
}
Ok(())