default_random_engine's result_type is `unsigned int`, so we need to
pass an `unsigned int` as its seed.
Fixes: http://tracker.ceph.com/issues/26890
Signed-off-by: Kefu Chai <kchai@redhat.com>
Conflicts:
src/osd/OSD.cc: this breaks the build with clang. and in master
we are not using std::default_random_engine for setting the scrub
interval. so this change is not cherry-picked from master.
{
// vary +/- 5% to avoid scrub scheduling livelocks
constexpr auto delta = 0.05;
- std::default_random_engine rng{whoami};
+ std::default_random_engine rng{static_cast<unsigned>(whoami)};
return (OSD_TICK_INTERVAL *
std::uniform_real_distribution<>{1.0 - delta, 1.0 + delta}(rng));
}