aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkruall <kruall@ydb.tech>2023-08-08 14:57:27 +0300
committerkruall <kruall@ydb.tech>2023-08-08 16:11:26 +0300
commit8e2e7a6e1ee0f7270005732dad71064239f4488b (patch)
treeb61fa6247bbc886368143a04f5df7f5f1ef4848b
parentbb8073a5a1994fcfc7cd2cb73278326d27eba481 (diff)
downloadydb-8e2e7a6e1ee0f7270005732dad71064239f4488b.tar.gz
Add shuffling candidates, KIKIMR-18973
-rw-r--r--ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3of4.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3of4.h b/ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3of4.h
index 818b4ed062..92f3092bf3 100644
--- a/ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3of4.h
+++ b/ydb/core/blobstorage/dsproxy/dsproxy_strategy_get_m3of4.h
@@ -3,6 +3,8 @@
#include "defs.h"
#include "dsproxy_strategy_m3of4_base.h"
+#include <util/random/shuffle.h>
+
namespace NKikimr {
class TMirror3of4GetStrategy : public TMirror3of4StrategyBase {
@@ -95,6 +97,7 @@ namespace NKikimr {
}
// leave the slow group for the last query
auto pred = [](const auto *x, const auto *y) { return x->NumSlowDisks < y->NumSlowDisks; };
+ Shuffle(candidates.begin(), candidates.end());
std::stable_sort(candidates.begin(), candidates.end(), pred);
// pick the first candidate
Y_VERIFY(candidates);