Skip to content

Commit

Permalink
Block on merge and try again if insufficient memory to re-create tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
rroelke committed Jan 31, 2025
1 parent b23205b commit 6fa51ba
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tiledb/sm/query/readers/sparse_global_order_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,20 @@ void SparseGlobalOrderReader<BitmapType>::create_result_tiles_using_preprocess(

// this is a tile which qualified for the subarray and was
// a created result tile, we must continue processing it
const auto budget_exceeded = add_result_tile(
num_dims, f, rt.tile_idx_, *fragment_metadata_[f], result_tiles);
bool budget_exceeded;
while ((budget_exceeded = add_result_tile(
num_dims,
f,
rt.tile_idx_,
*fragment_metadata_[f],
result_tiles)) &&
merge_future.has_value()) {
// try to free some memory by waiting for merge if it is ongoing
if (merge_future.has_value()) {
merge_future->block();
merge_future.reset();
}
}

// all these tiles were created in a previous iteration, so we *had*
// the memory budget - and must not any more. Can a user change
Expand Down

0 comments on commit 6fa51ba

Please sign in to comment.