diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenstore/filecas.cpp | 7 |
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) |