aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/filecas.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
committerLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
commitd1abc50ee9d4fb72efc646e17decafea741caa34 (patch)
treee4288e00f2f7ca0391b83d986efcb69d3ba66a83 /src/zenstore/filecas.cpp
parentAllow requests with invalid content-types unless specified in command line or... (diff)
parentupdated chunk–block analyser (#818) (diff)
downloadzen-d1abc50ee9d4fb72efc646e17decafea741caa34.tar.xz
zen-d1abc50ee9d4fb72efc646e17decafea741caa34.zip
Merge branch 'main' into lm/restrict-content-type
Diffstat (limited to 'src/zenstore/filecas.cpp')
-rw-r--r--src/zenstore/filecas.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index 31b3a68c4..0088afe6e 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -383,7 +383,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore::
HRESULT WriteRes = PayloadFile.Write(Cursor, Size);
if (FAILED(WriteRes))
{
- ThrowSystemException(hRes, fmt::format("failed to write {} bytes to shard file '{}'", ChunkSize, ChunkPath));
+ ThrowSystemException(WriteRes, fmt::format("failed to write {} bytes to shard file '{}'", ChunkSize, ChunkPath));
}
};
#else
@@ -669,8 +669,8 @@ FileCasStrategy::IterateChunks(std::span<IoHash> ChunkHashes,
return true;
};
- std::atomic<bool> AbortFlag;
- std::atomic<bool> PauseFlag;
+ std::atomic<bool> AbortFlag{false};
+ std::atomic<bool> PauseFlag{false};
ParallelWork Work(AbortFlag, PauseFlag, WorkerThreadPool::EMode::DisableBacklog);
try
{
@@ -823,8 +823,8 @@ FileCasStrategy::ScrubStorage(ScrubContext& Ctx)
ZEN_INFO("discovered {} files @ '{}' ({} not in index), scrubbing", m_Index.size(), m_RootDirectory, DiscoveredFilesNotInIndex);
- std::atomic<bool> Abort;
- std::atomic<bool> Pause;
+ std::atomic<bool> Abort{false};
+ std::atomic<bool> Pause{false};
ParallelWork Work(Abort, Pause, WorkerThreadPool::EMode::DisableBacklog);
try
@@ -1016,7 +1016,7 @@ FileCasStrategy::MakeIndexSnapshot(bool ResetLog)
{
// This is non-critical, it only means that we will replay the events of the log over the snapshot - inefficent but in
// the end it will be the same result
- ZEN_WARN("Snapshot failed to clean log file '{}', reason: '{}'", LogPath, IndexPath, Ec.message());
+ ZEN_WARN("Snapshot failed to clean log file '{}', reason: '{}'", LogPath, Ec.message());
}
m_CasLog.Open(LogPath, CasLogFile::Mode::kWrite);
}
@@ -1052,7 +1052,7 @@ FileCasStrategy::ReadIndexFile(const std::filesystem::path& IndexPath, uint32_t&
uint64_t Size = ObjectIndexFile.FileSize();
if (Size >= sizeof(FileCasIndexHeader))
{
- uint64_t ExpectedEntryCount = (Size - sizeof(sizeof(FileCasIndexHeader))) / sizeof(FileCasIndexEntry);
+ uint64_t ExpectedEntryCount = (Size - sizeof(FileCasIndexHeader)) / sizeof(FileCasIndexEntry);
FileCasIndexHeader Header;
ObjectIndexFile.Read(&Header, sizeof(Header), 0);
if ((Header.Magic == FileCasIndexHeader::ExpectedMagic) && (Header.Version == FileCasIndexHeader::CurrentVersion) &&
@@ -1496,6 +1496,8 @@ FileCasStrategy::CreateReferencePruner(GcCtx& Ctx, GcReferenceStoreStats&)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.filecas");
+
TEST_CASE("cas.chunk.mismatch")
{
}
@@ -1793,6 +1795,8 @@ TEST_CASE("cas.file.move")
# endif
}
+TEST_SUITE_END();
+
#endif
void