Skip to content

Commit

Permalink
key_distribution to throw plan_exception on unrecoverable errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kuron99 committed Dec 18, 2024
1 parent 7bbc9b9 commit e498937
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/jogasaki/dist/key_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class key_distribution {
* @param range the range on index
* @return a sequence of pivots, must be <= max_count
* @return empty list if the range is not splittable
* @throw plan::plan_exception if the computation fails with unrecoverable errors
* @note the returned pivots may not be the actual keys on the index,
* and ill-formed from the actual keys
* @post individual pivots are within the range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ std::vector<std::shared_ptr<impl::scan_range>> operator_builder::create_scan_ran
const jogasaki::dist::key_range range(
begin.key(), begin.endpointkind(), end.key(), end.endpointkind());
const auto pivot_count = scan_parallel_count - 1;
auto pivots = distribution->compute_pivots(pivot_count, range);
auto pivots = distribution->compute_pivots(pivot_count, range); // possibly throws plan_exception
scan_ranges.reserve(pivots.size() + 1);
if (pivots.empty()) {
scan_ranges.emplace_back(
Expand Down

0 comments on commit e498937

Please sign in to comment.