Skip to content

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 into
eclipse-daanse:mainfrom
stbischof:fix/segment-store-in-flight
Dec 1, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
stbischof:fix/segment-store-in-flight

Conversation

@stbischof

Copy link
Copy Markdown
Contributor

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 VirtualCubeTest on 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), ConcurrentCellFormatTest reads one result per connection on eight threads, formats the cells concurrently and checks values and texts apart.

Tests. SequencedStoreOpsTest covers the future of the operations in flight; ConcurrentCellFormatTest the texts of cells formatted in parallel.

…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>
@stbischof
stbischof merged commit 8ab4145 into eclipse-daanse:main Dec 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant