aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenstore/blockstore.cpp14
2 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 610e61b12..a49c19505 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
##
- Bugfix: Parsing of `zen oplog-import` `--oidctoken-exe-path` option fixed
+- Bugfix: Fixed race condition when checking cas store block size causing chunks to be incorrectly reported as missing
## 5.7.4
- Bugfix: Parsing of `zen builds` `--log-progress` option fixed
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index ec7924553..77d21834a 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -113,12 +113,14 @@ BlockStoreFile::Create(uint64_t InitialSize)
uint64_t
BlockStoreFile::FileSize() const
{
- if (m_CachedFileSize == 0)
+ uint64_t CachedSize = m_CachedFileSize;
+ if (CachedSize == 0)
{
std::error_code Ec;
uint64_t Size = m_File.FileSize(Ec);
if (Ec)
{
+ ZEN_WARN("Failed to get file size of block {}. Reason: {}", m_Path, Ec.message());
return 0;
}
uint64_t Expected = 0;
@@ -129,7 +131,7 @@ BlockStoreFile::FileSize() const
}
return Size;
}
- return m_CachedFileSize;
+ return CachedSize;
}
void
@@ -725,6 +727,14 @@ BlockStore::HasChunk(const BlockStoreLocation& Location) const
{
return true;
}
+ else
+ {
+ ZEN_WARN("BlockLocation: Block {}, Offset {}, Size {} is outside block size {}",
+ Location.BlockIndex,
+ Location.Offset,
+ Location.Size,
+ BlockSize);
+ }
}
}
return false;