aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-11-27 10:04:51 +0100
committerGitHub Enterprise <[email protected]>2024-11-27 10:04:51 +0100
commita5ddba83a7f5858ea72d1fb400dd36724353db21 (patch)
tree498370804dc2ac7f066e076140f4062e2a81386d /src
parent5.5.14-pre3 (diff)
downloadzen-a5ddba83a7f5858ea72d1fb400dd36724353db21.tar.xz
zen-a5ddba83a7f5858ea72d1fb400dd36724353db21.zip
add missing shard lock in filecas compact (#239)
* add missing shardlock during compact in filecas * add warning log when filecas fails to open a file it expects to be present
Diffstat (limited to 'src')
-rw-r--r--src/zenstore/filecas.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index 3cee9f076..f64427807 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -513,6 +513,10 @@ FileCasStrategy::SafeOpenChunk(const IoHash& ChunkHash, uint64 ExpectedSize)
m_CasLog.Append({.Key = ChunkHash, .Flags = FileCasIndexEntry::kTombStone, .Size = ChunkSize});
}
}
+ else
+ {
+ ZEN_WARN("FileCasStrategy::IterateChunks failed to get payload for '{}'", ChunkPath);
+ }
return {};
}
@@ -1232,6 +1236,8 @@ public:
FileCasStrategy::ShardingHelper Name(m_FileCasStrategy.m_RootDirectory, ChunkHash);
const std::filesystem::path ChunkPath = Name.ShardedPath.ToPath();
{
+ RwLock::ExclusiveLockScope HashLock(m_FileCasStrategy.LockForHash(ChunkHash));
+
RwLock::SharedLockScope __(m_FileCasStrategy.m_Lock);
if (auto It = m_FileCasStrategy.m_Index.find(ChunkHash); It != m_FileCasStrategy.m_Index.end())
{
@@ -1263,7 +1269,6 @@ public:
// Target file may be open for read, attempt to move it to a temp file and mark it delete on close
IoBuffer OldChunk;
{
- RwLock::SharedLockScope HashLock(m_FileCasStrategy.LockForHash(ChunkHash));
OldChunk = IoBufferBuilder::MakeFromFile(ChunkPath);
}
if (OldChunk)