aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver-test/hub-tests.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-04-22 12:37:08 +0200
committerGitHub Enterprise <[email protected]>2026-04-22 12:37:08 +0200
commit4081fc5f231bc8450952f94c505ccb987d8eb65c (patch)
tree6e37fb5845cfae5edcbd96f8be5107e0df31484b /src/zenserver-test/hub-tests.cpp
parentZen-style trace log events (#1006) (diff)
downloadarchived-zen-4081fc5f231bc8450952f94c505ccb987d8eb65c.tar.xz
archived-zen-4081fc5f231bc8450952f94c505ccb987d8eb65c.zip
BlockStore: fix correctness issues in block storage layer (#996)
1. **Assert invariant in `RemoveActiveWriteBlock`** — `erase(std::find(...))` was UB if the invariant ever broke. Now asserts the iterator before erasing. 2. **Single atomic delta in `SetMetaData`** — was `+= new; -= old` as two atomic ops, briefly inflating `TotalSize()` for concurrent readers. Collapsed into one `fetch_add`. 3. **Consistent `IncludeBlocks` / `IncludeBlock`** — `IncludeBlocks` asserted on duplicate keys while `IncludeBlock` silently skipped. Made both tolerant; also made the `reserve` call additive so a second call can't shrink the capacity request. 4. **Replace `operator[]` reads with `find` on `m_ChunkBlocks`** — `tsl::robin_map::operator[]` default-inserts; several read-intent lookups could produce ghost null entries if invariants broke (especially on compaction rollback paths). 5. **Bound `GetChunk` against actual file size** — `m_IoBuffer.GetSize()` is the mapped capacity (block size, e.g. 256 MiB), not written bytes. Requests inside the mapped region but past the real EOF returned views over zero-filled memory. Now bounds against `FileSize()`.
Diffstat (limited to 'src/zenserver-test/hub-tests.cpp')
0 files changed, 0 insertions, 0 deletions