aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/compactcas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/compactcas.cpp')
-rw-r--r--src/zenstore/compactcas.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp
index 95198fd59..c4f9ff2c6 100644
--- a/src/zenstore/compactcas.cpp
+++ b/src/zenstore/compactcas.cpp
@@ -884,9 +884,11 @@ CasContainerStrategy::MakeIndexSnapshot()
// Write the current state of the location map to a new index state
std::vector<CasDiskIndexEntry> Entries;
+ uint64_t IndexLogPosition = 0;
{
RwLock::SharedLockScope ___(m_LocationMapLock);
+ IndexLogPosition = m_CasLog.GetLogCount();
Entries.resize(m_LocationMap.size());
uint64_t EntryIndex = 0;
@@ -901,7 +903,7 @@ CasContainerStrategy::MakeIndexSnapshot()
BasicFile ObjectIndexFile;
ObjectIndexFile.Open(IndexPath, BasicFile::Mode::kTruncate);
CasDiskIndexHeader Header = {.EntryCount = Entries.size(),
- .LogPosition = LogCount,
+ .LogPosition = IndexLogPosition,
.PayloadAlignment = gsl::narrow<uint32_t>(m_PayloadAlignment)};
Header.Checksum = CasDiskIndexHeader::ComputeChecksum(Header);
@@ -911,7 +913,7 @@ CasContainerStrategy::MakeIndexSnapshot()
ObjectIndexFile.Flush();
ObjectIndexFile.Close();
EntryCount = Entries.size();
- m_LogFlushPosition = LogCount;
+ m_LogFlushPosition = IndexLogPosition;
}
catch (std::exception& Err)
{