Repository navigation
fix(cache): a reader that misses a body waits for the store operations on its segment still in flight - #211
Merged
stbischof merged 1 commit intoDec 1, 2026
Conversation
…s on its segment still in flight A loaded segment's header reaches the index before its body reaches the stores: the load publishes the header, which releases the queries waiting for it, and queues the put of the body. A request right after it, such as a rollup of the segment just loaded, could find the header and miss the body. The reader then took the body for gone, forgot the header and asked again, until the cell reader gave up with "Cache round-trip did not resolve any cell requests". A reader that misses a body now waits for the store operations on that segment still in flight, the last operation of the segment's chain with its failure absorbed, and asks the stores again; only a body missing then is gone, and only then the header is forgotten. The wait is cancel-checked in one-second slices. A load and a store hit cost nothing more; a miss costs one map lookup and, while an operation is in flight, a wait of at most that operation. Cells of a measure without a format string are formatted through one format shared by all threads. A test reads one result per connection on eight threads and formats the cells concurrently, checking values and texts apart, now that olap gives each thread a number formatter of its own. Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What went wrong. A loaded segment's header reaches the index before its body reaches the stores: the load publishes the header, which releases the queries waiting for it, and queues the put of the body. A request right after it, such as a rollup of the segment just loaded, could find the header and miss the body. The reader then took the body for gone, forgot the header and asked again, until the cell reader gave up with "Cache round-trip did not resolve any cell requests". Under parallel tests this showed now and then, most recently in
VirtualCubeTeston main.The fix. A reader that misses a body (
BatchingCellReader, both places that asked the stores) waits for the store operations on that segment still in flight (SegmentCacheManager.storeOpsInFlight,SequencedStoreOps.inFlight: the last operation of the segment's chain, its failure absorbed) and asks the stores again; only a body missing then is gone, and only then the header is forgotten. The wait is cancel-checked in one-second slices. A load and a store hit cost nothing more; a miss costs one map lookup and, while an operation is in flight, a wait of at most that operation.Cells formatted on parallel threads. Cells of a measure without a format string are formatted through one format shared by all threads. Now that olap gives each thread a number formatter of its own (eclipse-daanse/org.eclipse.daanse.olap#204),
ConcurrentCellFormatTestreads one result per connection on eight threads, formats the cells concurrently and checks values and texts apart.Tests.
SequencedStoreOpsTestcovers the future of the operations in flight;ConcurrentCellFormatTestthe texts of cells formatted in parallel.