Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-2.0.7] Fix undefined behavior within load_tile_var_sizes #1749

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Fix Catch2 detection of system install [#1733](https://github.com/TileDB-Inc/TileDB/pull/1733)
* Use libtiledb-detected certificate path for Google Cloud Storage, for better linux binary/wheel portability. [#1741](https://github.com/TileDB-Inc/TileDB/pull/1741)
* Fix compilation on gcc 10.1 for blosc [#1740](https://github.com/TileDB-Inc/TileDB/pull/1740)
* Fixed a rare hang in the usage of `load_tile_var_sizes`. [#1748](https://github.com/TileDB-Inc/TileDB/pull/1748)

# TileDB v2.0.6 Release Notes

Expand Down
23 changes: 11 additions & 12 deletions tiledb/sm/subarray/subarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1636,18 +1636,17 @@ Status Subarray::load_relevant_fragment_tile_var_sizes(
if (var_names.empty())
return Status::Ok();

// Load in parallel all tile var sizes metadata across fragments
auto statuses = parallel_for_2d(
0,
relevant_fragments_.size(),
0,
var_names.size(),
[&](unsigned i, uint64_t j) {
auto f = relevant_fragments_[i];
return meta[f]->load_tile_var_sizes(*encryption_key, var_names[j]);
});
for (auto st : statuses)
RETURN_NOT_OK(st);
// Load all metadata for tile var sizes among fragments.
for (const auto& var_name : var_names) {
const auto statuses =
parallel_for(0, relevant_fragments_.size(), [&](const size_t i) {
auto f = relevant_fragments_[i];
return meta[f]->load_tile_var_sizes(*encryption_key, var_name);
});

for (const auto& st : statuses)
RETURN_NOT_OK(st);
}

return Status::Ok();
}
Expand Down