Skip to content

Commit d8bbb8b

Browse files
authored
Result tile wait_all should block on the async i/o result (#5446)
As @ihnorton has noticed while auditing the code in #5401 , in result tile destructor we were waiting on `data()` instead of `filtered_data()` for the async task to have finished. This was a leftover from the previous version of the code (before the split between part 1 and 2), where we were also unfiltering in an async fashion, so `data()` was also blocking waiting for the unfiltering shared future to be done. This PR fixes this by waiting just for the I/O task to be done. --- TYPE: IMPROVEMENT DESC: Result tile wait_all should block on the async I/O result
1 parent 1d9705d commit d8bbb8b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tiledb/sm/query/readers/result_tile.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,15 @@ void ResultTile::wait_all_tiles(
281281
for (auto& at : tiles) {
282282
const auto& tile_tuple = at.second;
283283
if (tile_tuple.has_value()) {
284-
tile_tuple.value().fixed_tile().data();
284+
// Wait for the fixed tile i/o to be done
285+
tile_tuple.value().fixed_tile().filtered_data();
285286
if (tile_tuple.value().var_tile_opt().has_value()) {
286-
tile_tuple.value().var_tile_opt().value().data();
287+
// Wait for the var tile i/o to be done
288+
tile_tuple.value().var_tile_opt().value().filtered_data();
287289
}
288290
if (tile_tuple.value().validity_tile_opt().has_value()) {
289-
tile_tuple.value().validity_tile_opt().value().data();
291+
// Wait for the validity tile i/o to be done
292+
tile_tuple.value().validity_tile_opt().value().filtered_data();
290293
}
291294
}
292295
}

tiledb/sm/tile/tile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class Tile : public TileBase {
280280
}
281281

282282
/** Returns the buffer that contains the filtered, on-disk format. */
283-
inline char* filtered_data() {
283+
inline char* filtered_data() const {
284284
std::scoped_lock<std::recursive_mutex> lock{filtered_data_io_task_mtx_};
285285
if (filtered_data_io_task_.has_value()) {
286286
if (filtered_data_io_task_.value().valid()) {

0 commit comments

Comments
 (0)