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

reef: common/weighted_shuffle: don't feed std::discrete_distribution with all-zero weights #55153

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

rzarzynski
Copy link
Contributor

backport tracker: https://tracker.ceph.com/issues/64005


backport of #53228
parent tracker: https://tracker.ceph.com/issues/62645

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

…ll-zero weights

This flaw results is the assertions like the following one:

```
/usr/include/c++/11/bits/random.tcc:2667: void std::discrete_distribution<_IntType>::param_type::_M_initialize() [with _IntType = int]: Assertion '__sum > 0' failed.
Aborted (core dumped)
```

The reason behind is that `std::discrete_distribution` sums
the weights and uses the result as a divisor.

Fixes: https://tracker.ceph.com/issues/62645
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
(cherry picked from commit 1b7a7a8)
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
(cherry picked from commit d02b17f)
@rzarzynski rzarzynski added this to the reef milestone Jan 11, 2024
@github-actions github-actions bot added the tests label Jan 11, 2024
@rzarzynski rzarzynski added needs-qa and removed tests labels Jan 11, 2024
@yuriw yuriw merged commit d3f6278 into ceph:reef Jan 17, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants