aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zenremotestore/projectstore/remoteprojectstore.cpp80
1 files changed, 38 insertions, 42 deletions
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp
index 16c108092..ed803e708 100644
--- a/src/zenremotestore/projectstore/remoteprojectstore.cpp
+++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp
@@ -1238,7 +1238,7 @@ namespace remotestore_impl {
RemoteResult.GetError(),
RemoteResult.GetErrorReason()));
Info.MissingAttachmentCount.fetch_add(1);
- if (Context.IgnoreMissingAttachments)
+ if (!Context.IgnoreMissingAttachments)
{
RemoteResult.SetError(Result.ErrorCode, Result.Reason, Result.Text);
}
@@ -3457,12 +3457,10 @@ SaveOplog(CidStore& ChunkStore,
TransferWallTimeMS += SaveContainerTimer.GetElapsedTimeMs();
if (ContainerSaveResult.ErrorCode)
{
- throw RemoteStoreError(fmt::format("Failed to save oplog container for oplog '{}': {}",
- RemoteStoreInfo.ContainerName,
- ContainerSaveResult.RawHash,
- ContainerSaveResult.Reason),
- ContainerSaveResult.ErrorCode,
- ContainerSaveResult.Text);
+ throw RemoteStoreError(
+ fmt::format("Failed to save oplog container for oplog '{}': {}", RemoteStoreInfo.ContainerName, ContainerSaveResult.Reason),
+ ContainerSaveResult.ErrorCode,
+ ContainerSaveResult.Text);
}
else
{
@@ -3532,47 +3530,45 @@ SaveOplog(CidStore& ChunkStore,
return;
}
- if (Try < MaxTries)
- {
- Try++;
+ Try++;
- remotestore_impl::ReportMessage(
- OptionalContext,
- fmt::format("Finalize of container '{}' reported {} missing attachments. Uploading missing attachements. Try {}",
- RemoteStoreInfo.ContainerName,
- ContainerFinalizeResult.Needs.size(),
- Try));
-
- Stopwatch RetryUploadAttachmentsTimer;
- UploadAttachments(NetworkWorkerPool,
- ChunkStore,
- RemoteStore,
- LargeAttachments,
- BlockChunks,
- CreatedBlocks,
- LooseLargeFiles,
- ContainerFinalizeResult.Needs,
- false,
- Info,
- RemoteResult,
- OptionalContext);
- TransferWallTimeMS += RetryUploadAttachmentsTimer.GetElapsedTimeMs();
- if (RemoteResult.IsError())
- {
- throw RemoteStoreError(fmt::format("Failed to upload attachments for oplog '{}': {}",
- RemoteStoreInfo.ContainerName,
- RemoteResult.GetErrorReason()),
- RemoteResult.GetError(),
- RemoteResult.GetErrorText());
- }
- }
- else
+ if (Try == MaxTries)
{
throw std::runtime_error(
fmt::format("Giving up finalize oplog container {} after {} retries, still getting reports of missing attachments",
ContainerSaveResult.RawHash,
ContainerFinalizeResult.Needs.size()));
}
+
+ remotestore_impl::ReportMessage(
+ OptionalContext,
+ fmt::format("Finalize of container '{}' reported {} missing attachments. Uploading missing attachements. Try {}",
+ RemoteStoreInfo.ContainerName,
+ ContainerFinalizeResult.Needs.size(),
+ Try));
+
+ Stopwatch RetryUploadAttachmentsTimer;
+ UploadAttachments(NetworkWorkerPool,
+ ChunkStore,
+ RemoteStore,
+ LargeAttachments,
+ BlockChunks,
+ CreatedBlocks,
+ LooseLargeFiles,
+ ContainerFinalizeResult.Needs,
+ false,
+ Info,
+ RemoteResult,
+ OptionalContext);
+ TransferWallTimeMS += RetryUploadAttachmentsTimer.GetElapsedTimeMs();
+ if (RemoteResult.IsError())
+ {
+ throw RemoteStoreError(fmt::format("Failed to upload attachments for oplog '{}': {}",
+ RemoteStoreInfo.ContainerName,
+ RemoteResult.GetErrorReason()),
+ RemoteResult.GetError(),
+ RemoteResult.GetErrorText());
+ }
}
}
@@ -3621,7 +3617,7 @@ ParseOplogContainer(
CbValidateError ValidateResult = CbValidateError::None;
if (CbObject SectionObject = ValidateAndReadCompactBinaryObject(std::move(SectionPayload), ValidateResult);
- ValidateResult == CbValidateError::None && ContainerObject)
+ ValidateResult == CbValidateError::None && SectionObject)
{
OutOplogSection = SectionObject;
}