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

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

Merged
merged 2 commits into from Jan 22, 2024

Conversation

rzarzynski
Copy link
Contributor

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


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)
Copy link
Contributor

@yuriw yuriw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Nitzan Mordechai nmordech@redhat.com

@yuriw yuriw merged commit 7b84b17 into ceph:pacific Jan 22, 2024
8 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