aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zenremotestore/projectstore/remoteprojectstore.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp
index f4c0a79b3..75fe6e668 100644
--- a/src/zenremotestore/projectstore/remoteprojectstore.cpp
+++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp
@@ -378,7 +378,7 @@ namespace remotestore_impl {
CurrentOpRawHashes.erase(CurrentOpRawHashes.begin(), CurrentOpRawHashes.begin() + AddedChunkCount);
CurrentOpChunkSizes.erase(CurrentOpChunkSizes.begin(), CurrentOpChunkSizes.begin() + AddedChunkCount);
CurrentOpAttachmentsSize -= AddedChunkSize;
- };
+ }
}
}
if (!PendingChunkHashes.empty())
@@ -2764,13 +2764,12 @@ BuildContainer(CidStore& ChunkStore,
}
else
{
- remotestore_impl::ReportMessage(
- OptionalContext,
- fmt::format("Resolving {} attachments from {} ops ({} ({}%) found in existing blocks)",
- UploadAttachments.size(),
- TotalOpCount,
- ReusedAttachmentCount,
- UploadAttachments.size() == 0 ? 100 : (100 * ReusedAttachmentCount) / UploadAttachments.size()));
+ remotestore_impl::ReportMessage(OptionalContext,
+ fmt::format("Resolving {} attachments from {} ops ({} ({:1f}%) found in existing blocks)",
+ UploadAttachments.size(),
+ TotalOpCount,
+ ReusedAttachmentCount,
+ (1000.f * ReusedAttachmentCount) / UploadAttachments.size()));
ResolveAttachments(ChunkStore,
WorkerPool,
@@ -3531,7 +3530,7 @@ SaveOplog(CidStore& ChunkStore,
throw std::runtime_error(
fmt::format("Giving up finalize oplog container {} after {} retries, still getting reports of missing attachments",
ContainerSaveResult.RawHash,
- ContainerFinalizeResult.Needs.size()));
+ Try));
}
remotestore_impl::ReportMessage(
@@ -3618,7 +3617,7 @@ ParseOplogContainer(
return RemoteProjectStore::Result{gsl::narrow<int>(HttpResponseCode::BadRequest),
Timer.GetElapsedTimeMs() / 1000.0,
"Section has unexpected data type",
- "Failed to save oplog container"};
+ "Failed to read oplog container"};
}
std::unordered_set<IoHash, IoHash::Hasher> NeededAttachments;
{
@@ -4048,6 +4047,7 @@ LoadOplog(LoadOplogContext&& Context)
else
{
// Not a requested block? Ignore it
+ FindIt++;
}
}
}
@@ -4378,14 +4378,17 @@ LoadOplog(LoadOplogContext&& Context)
CompressedBuffer Compressed =
CompressedBuffer::FromCompressed(SharedBuffer(std::move(Chunk)), RawHash, RawSize);
- if (RawHash != ChunkHash)
+ if (RawHash != ChunkHash || !Compressed)
{
- remotestore_impl::ReportMessage(
- Context.OptionalJobContext,
- fmt::format("Mismatching raw hash {} for chunk {} for chunked attachment {}",
- RawHash,
- ChunkHash,
- Chunked.RawHash));
+ std::string Message =
+ Compressed ? fmt::format("Mismatching raw hash {} for chunk {} for chunked attachment {}",
+ RawHash,
+ ChunkHash,
+ Chunked.RawHash)
+ : fmt::format("Malformed data for chunk {} for chunked attachment {}",
+ ChunkHash,
+ Chunked.RawHash);
+ remotestore_impl::ReportMessage(Context.OptionalJobContext, Message);
// We only add 1 as the resulting missing count will be 1 for the dechunked file
Info.MissingAttachmentCount.fetch_add(1);
@@ -4394,10 +4397,7 @@ LoadOplog(LoadOplogContext&& Context)
RemoteResult.SetError(
gsl::narrow<int>(HttpResponseCode::NotFound),
"Missing chunk",
- fmt::format("Mismatching raw hash {} for chunk {} for chunked attachment {}",
- RawHash,
- ChunkHash,
- Chunked.RawHash));
+ Message;
}
return;
}