diff options
| author | Dan Engelbrecht <[email protected]> | 2026-02-03 16:31:40 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-02-03 16:31:40 +0100 |
| commit | 932b15e7318ed65973373aa3c4a94714cd688d7b (patch) | |
| tree | fce75256111f07469cd34b2381b89aa9a0a491b7 /src/zenstore/compactcas.cpp | |
| parent | add command line option for scrub timeslice (#742) (diff) | |
| download | zen-932b15e7318ed65973373aa3c4a94714cd688d7b.tar.xz zen-932b15e7318ed65973373aa3c4a94714cd688d7b.zip | |
reduce blocking in scrub (#743)
* reduce held locks while performing scrub operation
Diffstat (limited to 'src/zenstore/compactcas.cpp')
| -rw-r--r-- | src/zenstore/compactcas.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp index 37a8c36b8..097102a1d 100644 --- a/src/zenstore/compactcas.cpp +++ b/src/zenstore/compactcas.cpp @@ -565,20 +565,21 @@ CasContainerStrategy::ScrubStorage(ScrubContext& Ctx) try { - RwLock::SharedLockScope _(m_LocationMapLock); - - uint64_t TotalChunkCount = m_LocationMap.size(); - ChunkLocations.reserve(TotalChunkCount); - ChunkIndexToChunkHash.reserve(TotalChunkCount); { - for (const auto& Entry : m_LocationMap) + uint64_t TotalChunkCount = m_LocationMap.size(); + ChunkLocations.reserve(TotalChunkCount); + ChunkIndexToChunkHash.reserve(TotalChunkCount); + RwLock::SharedLockScope _(m_LocationMapLock); { - const IoHash& ChunkHash = Entry.first; - const BlockStoreDiskLocation& DiskLocation = m_Locations[Entry.second]; - BlockStoreLocation Location = DiskLocation.Get(m_PayloadAlignment); + for (const auto& Entry : m_LocationMap) + { + const IoHash& ChunkHash = Entry.first; + const BlockStoreDiskLocation& DiskLocation = m_Locations[Entry.second]; + BlockStoreLocation Location = DiskLocation.Get(m_PayloadAlignment); - ChunkLocations.push_back(Location); - ChunkIndexToChunkHash.push_back(ChunkHash); + ChunkLocations.push_back(Location); + ChunkIndexToChunkHash.push_back(ChunkHash); + } } } |