From 287aeba8eb81bf52d70246a43adf302ed01af533 Mon Sep 17 00:00:00 2001 From: Ilya Golshtein Date: Wed, 20 Nov 2024 23:51:23 +0300 Subject: [PATCH] mv_dependencies: get rid of random_device --- src/Storages/StorageMaterializedView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Storages/StorageMaterializedView.cpp b/src/Storages/StorageMaterializedView.cpp index 5afbe9da65d..458eed70de5 100644 --- a/src/Storages/StorageMaterializedView.cpp +++ b/src/Storages/StorageMaterializedView.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -765,8 +766,8 @@ void StorageMaterializedView::startup() { if (const auto configured_delay_ms = getContext()->getServerSettings()[ServerSetting::startup_mv_delay_ms]; configured_delay_ms) { - std::random_device rd; - const auto delay_ms = std::uniform_int_distribution<>(0, 1)(rd) ? configured_delay_ms : 0UL; + pcg64_fast gen{randomSeed()}; + const auto delay_ms = std::uniform_int_distribution<>(0, 1)(gen) ? configured_delay_ms : 0UL; if (delay_ms) { LOG_DEBUG(&Poco::Logger::get("StorageMaterializedView"), "sleeping in startup of {}", getStorageID().table_name);