summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssmike <[email protected]>2023-07-07 14:58:32 +0300
committerssmike <[email protected]>2023-07-07 14:58:32 +0300
commitc5ccc633c947ff122b6870e13cbf96a009669f62 (patch)
treec966ba83371803b1fa59acaf2333f424374473ae
parent0f52499671337d7b2d9ef71964f68c0df797a078 (diff)
Make retry settings configurable
-rw-r--r--library/cpp/threading/CMakeLists.txt1
-rw-r--r--library/cpp/threading/hot_swap/CMakeLists.darwin-x86_64.txt18
-rw-r--r--library/cpp/threading/hot_swap/CMakeLists.linux-aarch64.txt19
-rw-r--r--library/cpp/threading/hot_swap/CMakeLists.linux-x86_64.txt19
-rw-r--r--library/cpp/threading/hot_swap/CMakeLists.txt17
-rw-r--r--library/cpp/threading/hot_swap/CMakeLists.windows-x86_64.txt18
-rw-r--r--ydb/core/kqp/node_service/kqp_node_service.cpp31
-rw-r--r--ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt1
-rw-r--r--ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt1
-rw-r--r--ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt1
-rw-r--r--ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt1
-rw-r--r--ydb/core/kqp/runtime/kqp_read_actor.cpp76
-rw-r--r--ydb/core/kqp/runtime/kqp_read_actor.h30
-rw-r--r--ydb/core/kqp/runtime/ya.make1
-rw-r--r--ydb/core/kqp/ut/scan/kqp_split_ut.cpp7
-rw-r--r--ydb/core/protos/config.proto13
16 files changed, 235 insertions, 19 deletions
diff --git a/library/cpp/threading/CMakeLists.txt b/library/cpp/threading/CMakeLists.txt
index b42430ff77c..681ef6b24e3 100644
--- a/library/cpp/threading/CMakeLists.txt
+++ b/library/cpp/threading/CMakeLists.txt
@@ -10,6 +10,7 @@ add_subdirectory(atomic)
add_subdirectory(chunk_queue)
add_subdirectory(equeue)
add_subdirectory(future)
+add_subdirectory(hot_swap)
add_subdirectory(light_rw_lock)
add_subdirectory(local_executor)
add_subdirectory(poor_man_openmp)
diff --git a/library/cpp/threading/hot_swap/CMakeLists.darwin-x86_64.txt b/library/cpp/threading/hot_swap/CMakeLists.darwin-x86_64.txt
new file mode 100644
index 00000000000..7ec6e7f8b0d
--- /dev/null
+++ b/library/cpp/threading/hot_swap/CMakeLists.darwin-x86_64.txt
@@ -0,0 +1,18 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-threading-hot_swap)
+target_link_libraries(cpp-threading-hot_swap PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ cpp-deprecated-atomic
+)
+target_sources(cpp-threading-hot_swap PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/threading/hot_swap/hot_swap.cpp
+)
diff --git a/library/cpp/threading/hot_swap/CMakeLists.linux-aarch64.txt b/library/cpp/threading/hot_swap/CMakeLists.linux-aarch64.txt
new file mode 100644
index 00000000000..af861b6b248
--- /dev/null
+++ b/library/cpp/threading/hot_swap/CMakeLists.linux-aarch64.txt
@@ -0,0 +1,19 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-threading-hot_swap)
+target_link_libraries(cpp-threading-hot_swap PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+ cpp-deprecated-atomic
+)
+target_sources(cpp-threading-hot_swap PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/threading/hot_swap/hot_swap.cpp
+)
diff --git a/library/cpp/threading/hot_swap/CMakeLists.linux-x86_64.txt b/library/cpp/threading/hot_swap/CMakeLists.linux-x86_64.txt
new file mode 100644
index 00000000000..af861b6b248
--- /dev/null
+++ b/library/cpp/threading/hot_swap/CMakeLists.linux-x86_64.txt
@@ -0,0 +1,19 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-threading-hot_swap)
+target_link_libraries(cpp-threading-hot_swap PUBLIC
+ contrib-libs-linux-headers
+ contrib-libs-cxxsupp
+ yutil
+ cpp-deprecated-atomic
+)
+target_sources(cpp-threading-hot_swap PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/threading/hot_swap/hot_swap.cpp
+)
diff --git a/library/cpp/threading/hot_swap/CMakeLists.txt b/library/cpp/threading/hot_swap/CMakeLists.txt
new file mode 100644
index 00000000000..f8b31df0c11
--- /dev/null
+++ b/library/cpp/threading/hot_swap/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-aarch64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ include(CMakeLists.darwin-x86_64.txt)
+elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA)
+ include(CMakeLists.windows-x86_64.txt)
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
+ include(CMakeLists.linux-x86_64.txt)
+endif()
diff --git a/library/cpp/threading/hot_swap/CMakeLists.windows-x86_64.txt b/library/cpp/threading/hot_swap/CMakeLists.windows-x86_64.txt
new file mode 100644
index 00000000000..7ec6e7f8b0d
--- /dev/null
+++ b/library/cpp/threading/hot_swap/CMakeLists.windows-x86_64.txt
@@ -0,0 +1,18 @@
+
+# This file was generated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(cpp-threading-hot_swap)
+target_link_libraries(cpp-threading-hot_swap PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ cpp-deprecated-atomic
+)
+target_sources(cpp-threading-hot_swap PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/threading/hot_swap/hot_swap.cpp
+)
diff --git a/ydb/core/kqp/node_service/kqp_node_service.cpp b/ydb/core/kqp/node_service/kqp_node_service.cpp
index 4843b7ab228..6e70cfdfc50 100644
--- a/ydb/core/kqp/node_service/kqp_node_service.cpp
+++ b/ydb/core/kqp/node_service/kqp_node_service.cpp
@@ -11,6 +11,7 @@
#include <ydb/core/kqp/compute_actor/kqp_compute_actor.h>
#include <ydb/core/kqp/rm_service/kqp_resource_estimation.h>
#include <ydb/core/kqp/rm_service/kqp_rm_service.h>
+#include <ydb/core/kqp/runtime/kqp_read_actor.h>
#include <ydb/core/kqp/common/kqp_resolve.h>
#include <ydb/core/base/wilson.h>
@@ -75,7 +76,7 @@ struct TMemoryQuotaManager : public NYql::NDq::TGuaranteeQuotaManager {
, ui64 txId
, ui64 taskId
, ui64 limit
- , bool instantAlloc)
+ , bool instantAlloc)
: NYql::NDq::TGuaranteeQuotaManager(limit, limit)
, ResourceManager(std::move(resourceManager))
, MemoryPool(memoryPool)
@@ -96,7 +97,7 @@ struct TMemoryQuotaManager : public NYql::NDq::TGuaranteeQuotaManager {
return false;
}
- if (!ResourceManager->AllocateResources(TxId, TaskId,
+ if (!ResourceManager->AllocateResources(TxId, TaskId,
NRm::TKqpResourcesRequest{.MemoryPool = MemoryPool, .Memory = extraSize})) {
LOG_W("Can not allocate memory. TxId: " << TxId << ", taskId: " << TaskId << ", memory: +" << extraSize);
return false;
@@ -106,7 +107,7 @@ struct TMemoryQuotaManager : public NYql::NDq::TGuaranteeQuotaManager {
}
void FreeExtraQuota(ui64 extraSize) override {
- ResourceManager->FreeResources(TxId, TaskId,
+ ResourceManager->FreeResources(TxId, TaskId,
NRm::TKqpResourcesRequest{.MemoryPool = MemoryPool, .Memory = extraSize}
);
}
@@ -142,6 +143,9 @@ public:
, AsyncIoFactory(std::move(asyncIoFactory))
{
Buckets = std::make_shared<TBucketArray>();
+ if (config.HasIteratorReadsRetrySettings()) {
+ SetIteratorReadsRetrySettings(config.GetIteratorReadsRetrySettings());
+ }
}
void Bootstrap() {
@@ -578,10 +582,31 @@ private:
LOG_I("Updated table service config: " << Config.DebugString());
}
+ if (event.GetConfig().GetTableServiceConfig().HasIteratorReadsRetrySettings()) {
+ SetIteratorReadsRetrySettings(event.GetConfig().GetTableServiceConfig().GetIteratorReadsRetrySettings());
+ }
+
auto responseEv = MakeHolder<NConsole::TEvConsole::TEvConfigNotificationResponse>(event);
Send(ev->Sender, responseEv.Release(), IEventHandle::FlagTrackDelivery, ev->Cookie);
}
+ void SetIteratorReadsRetrySettings(const NKikimrConfig::TTableServiceConfig::TIteratorReadsRetrySettings& settings) {
+ auto ptr = MakeIntrusive<NKikimr::NKqp::TIteratorReadBackoffSettings>();
+ ptr->StartRetryDelay = TDuration::MilliSeconds(settings.GetStartDelayMs());
+ ptr->MaxShardAttempts = settings.GetMaxShardRetries();
+ ptr->MaxShardResolves = settings.GetMaxShardResolves();
+ ptr->UnsertaintyRatio = settings.GetUnsertaintyRatio();
+ ptr->Multiplier = settings.GetMultiplier();
+ if (settings.GetMaxTotalRetries()) {
+ ptr->MaxTotalRetries = settings.GetMaxTotalRetries();
+ }
+ if (settings.GetIteratorResponseTimeoutMs()) {
+ ptr->ReadResponseTimeout = TDuration::MilliSeconds(settings.GetIteratorResponseTimeoutMs());
+ }
+ ptr->MaxRetryDelay = TDuration::MilliSeconds(settings.GetMaxDelayMs());
+ SetReadIteratorBackoffSettings(ptr);
+ }
+
void HandleWork(TEvents::TEvUndelivered::TPtr& ev) {
switch (ev->Get()->SourceType) {
case TEvKqpNode::TEvStartKqpTasksResponse::EventType: {
diff --git a/ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt b/ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt
index 02e0d962816..78dfb6918e4 100644
--- a/ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt
+++ b/ydb/core/kqp/runtime/CMakeLists.darwin-x86_64.txt
@@ -36,6 +36,7 @@ target_link_libraries(core-kqp-runtime PUBLIC
dq-actors-protos
yql-dq-common
yql-dq-runtime
+ cpp-threading-hot_swap
tools-enum_parser-enum_serialization_runtime
)
target_sources(core-kqp-runtime PRIVATE
diff --git a/ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt b/ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt
index 9962998778a..94a3bb9722b 100644
--- a/ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt
+++ b/ydb/core/kqp/runtime/CMakeLists.linux-aarch64.txt
@@ -37,6 +37,7 @@ target_link_libraries(core-kqp-runtime PUBLIC
dq-actors-protos
yql-dq-common
yql-dq-runtime
+ cpp-threading-hot_swap
tools-enum_parser-enum_serialization_runtime
)
target_sources(core-kqp-runtime PRIVATE
diff --git a/ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt b/ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt
index 9962998778a..94a3bb9722b 100644
--- a/ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt
+++ b/ydb/core/kqp/runtime/CMakeLists.linux-x86_64.txt
@@ -37,6 +37,7 @@ target_link_libraries(core-kqp-runtime PUBLIC
dq-actors-protos
yql-dq-common
yql-dq-runtime
+ cpp-threading-hot_swap
tools-enum_parser-enum_serialization_runtime
)
target_sources(core-kqp-runtime PRIVATE
diff --git a/ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt b/ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt
index 02e0d962816..78dfb6918e4 100644
--- a/ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt
+++ b/ydb/core/kqp/runtime/CMakeLists.windows-x86_64.txt
@@ -36,6 +36,7 @@ target_link_libraries(core-kqp-runtime PUBLIC
dq-actors-protos
yql-dq-common
yql-dq-runtime
+ cpp-threading-hot_swap
tools-enum_parser-enum_serialization_runtime
)
target_sources(core-kqp-runtime PRIVATE
diff --git a/ydb/core/kqp/runtime/kqp_read_actor.cpp b/ydb/core/kqp/runtime/kqp_read_actor.cpp
index 4f9a32475c9..3267aa6d45c 100644
--- a/ydb/core/kqp/runtime/kqp_read_actor.cpp
+++ b/ydb/core/kqp/runtime/kqp_read_actor.cpp
@@ -14,6 +14,7 @@
#include <ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h>
+#include <library/cpp/threading/hot_swap/hot_swap.h>
#include <library/cpp/actors/core/interconnect.h>
#include <library/cpp/actors/core/actorsystem.h>
@@ -21,9 +22,6 @@
namespace {
-static constexpr ui64 MAX_SHARD_RETRIES = 5;
-static constexpr ui64 MAX_SHARD_RESOLVES = 3;
-
bool IsDebugLogEnabled(const NActors::TActorSystem* actorSystem, NActors::NLog::EComponent component) {
auto* settings = actorSystem->LoggerSettings();
return settings && settings->Satisfies(NActors::NLog::EPriority::PRI_DEBUG, component);
@@ -64,7 +62,33 @@ THolder<NKikimr::TEvDataShard::TEvReadAck> DefaultAckSettings() {
NActors::TActorId MainPipeCacheId = NKikimr::MakePipePeNodeCacheID(false);
NActors::TActorId FollowersPipeCacheId = NKikimr::MakePipePeNodeCacheID(true);
-TDuration StartRetryDelay = TDuration::MilliSeconds(250);
+struct TBackoffStorage {
+ THotSwap<NKikimr::NKqp::TIteratorReadBackoffSettings> SettingsPtr;
+
+ TBackoffStorage() {
+ SettingsPtr.AtomicStore(new NKikimr::NKqp::TIteratorReadBackoffSettings());
+ }
+};
+
+TDuration CalcDelay(size_t attempt, bool allowInstantRetry) {
+ return Singleton<::TBackoffStorage>()->SettingsPtr.AtomicLoad()->CalcShardDelay(attempt, allowInstantRetry);
+}
+
+size_t MaxShardResolves() {
+ return Singleton<::TBackoffStorage>()->SettingsPtr.AtomicLoad()->MaxShardResolves;
+}
+
+size_t MaxShardRetries() {
+ return Singleton<::TBackoffStorage>()->SettingsPtr.AtomicLoad()->MaxShardAttempts;
+}
+
+TMaybe<size_t> MaxTotalRetries() {
+ return Singleton<::TBackoffStorage>()->SettingsPtr.AtomicLoad()->MaxTotalRetries;
+}
+
+TMaybe<TDuration> ShardTimeout() {
+ return Singleton<::TBackoffStorage>()->SettingsPtr.AtomicLoad()->ReadResponseTimeout;
+}
}
@@ -446,6 +470,7 @@ public:
state.AddRange(TSerializedTableRange(range));
}
} else {
+ YQL_ENSURE(Settings.GetRanges().KeyPointsSize() > 0);
for (const auto& point : Settings.GetRanges().GetKeyPoints()) {
state.AddPoint(TSerializedCellVec(point));
}
@@ -491,7 +516,7 @@ public:
}
void ResolveShard(TShardState* state) {
- if (state->ResolveAttempt >= MAX_SHARD_RESOLVES) {
+ if (state->ResolveAttempt >= ::MaxShardResolves()) {
RuntimeError(TStringBuilder() << "Table '" << Settings.GetTable().GetTablePath() << "' resolve limit exceeded",
NDqProto::StatusIds::UNAVAILABLE);
return;
@@ -730,12 +755,23 @@ public:
}
auto state = Reads[id].Shard;
- if (state->RetryAttempt == 0 && allowInstantRetry) { // instant retry
- return DoRetryRead(id);
+
+ TotalRetries += 1;
+ auto limit = ::MaxTotalRetries();
+ if (limit && TotalRetries > *limit) {
+ return RuntimeError(TStringBuilder() << "Table '" << Settings.GetTable().GetTablePath() << "' retry limit exceeded",
+ NDqProto::StatusIds::UNAVAILABLE);
+ }
+
+ state->RetryAttempt += 1;
+ if (state->RetryAttempt > ::MaxShardRetries()) {
+ ResetRead(id);
+ return ResolveShard(state);
}
- auto delay = ::StartRetryDelay;
- for (size_t i = 0; i < state->RetryAttempt; ++i) {
- delay *= 2;
+
+ auto delay = ::CalcDelay(state->RetryAttempt, allowInstantRetry);
+ if (delay == TDuration::Zero()) {
+ return DoRetryRead(id);
}
CA_LOG_D("schedule retry #" << id << " after " << delay);
@@ -748,12 +784,6 @@ public:
}
auto state = Reads[id].Shard;
-
- state->RetryAttempt += 1;
- if (state->RetryAttempt >= MAX_SHARD_RETRIES) {
- ResetRead(id);
- return ResolveShard(state);
- }
CA_LOG_D("Retrying read #" << id);
ResetRead(id);
@@ -843,6 +873,10 @@ public:
ReadIdByTabletId[state->TabletId].push_back(id);
Send(PipeCacheId, new TEvPipeCache::TEvForward(ev.Release(), state->TabletId, true),
IEventHandle::FlagTrackDelivery);
+
+ if (auto delay = ShardTimeout()) {
+ TlsActivationContext->Schedule(*delay, new IEventHandle(SelfId(), SelfId(), new TEvRetryShard(id, Reads[id].LastSeqNo)));
+ }
}
void NotifyCA() {
@@ -1176,6 +1210,10 @@ public:
CA_LOG_D("sending ack for read #" << id << " limit " << limit << " seqno = " << record.GetSeqNo());
Send(PipeCacheId, new TEvPipeCache::TEvForward(request.Release(), Reads[id].Shard->TabletId, true),
IEventHandle::FlagTrackDelivery);
+
+ if (auto delay = ShardTimeout()) {
+ TlsActivationContext->Schedule(*delay, new IEventHandle(SelfId(), SelfId(), new TEvRetryShard(id, Reads[id].LastSeqNo)));
+ }
} else {
Reads[id].Finished = true;
}
@@ -1361,6 +1399,8 @@ private:
TIntrusivePtr<TKqpCounters> Counters;
bool UseFollowers;
NActors::TActorId PipeCacheId;
+
+ size_t TotalRetries = 0;
};
@@ -1385,5 +1425,9 @@ void InterceptReadActorPipeCache(NActors::TActorId id) {
::MainPipeCacheId = id;
}
+void SetReadIteratorBackoffSettings(TIntrusivePtr<TIteratorReadBackoffSettings> ptr) {
+ Singleton<::TBackoffStorage>()->SettingsPtr.AtomicStore(ptr);
+}
+
} // namespace NKqp
} // namespace NKikimr
diff --git a/ydb/core/kqp/runtime/kqp_read_actor.h b/ydb/core/kqp/runtime/kqp_read_actor.h
index 22c4e05d5c2..12da2c844c6 100644
--- a/ydb/core/kqp/runtime/kqp_read_actor.h
+++ b/ydb/core/kqp/runtime/kqp_read_actor.h
@@ -12,6 +12,36 @@ class TEvReadAck;
namespace NKikimr {
namespace NKqp {
+struct TIteratorReadBackoffSettings : TAtomicRefCount<TIteratorReadBackoffSettings> {
+ TDuration StartRetryDelay = TDuration::MilliSeconds(5);
+ size_t MaxShardAttempts = 10;
+ size_t MaxShardResolves = 3;
+ double UnsertaintyRatio = 0.5;
+ double Multiplier = 2.0;
+ TDuration MaxRetryDelay = TDuration::Seconds(1);
+
+ TMaybe<size_t> MaxTotalRetries;
+ TMaybe<TDuration> ReadResponseTimeout;
+
+ TDuration CalcShardDelay(size_t attempt, bool allowInstantRetry) {
+ if (allowInstantRetry && attempt == 1) {
+ return TDuration::Zero();
+ }
+
+ auto delay = StartRetryDelay;
+ for (size_t i = 0; i < attempt; ++i) {
+ delay *= Multiplier;
+ delay = Min(delay, MaxRetryDelay);
+ }
+
+ delay *= (1 - UnsertaintyRatio * RandomNumber<double>());
+
+ return delay;
+ }
+};
+
+void SetReadIteratorBackoffSettings(TIntrusivePtr<TIteratorReadBackoffSettings>);
+
void RegisterKqpReadActor(NYql::NDq::TDqAsyncIoFactory&, TIntrusivePtr<TKqpCounters>);
void InjectRangeEvReadSettings(const NKikimrTxDataShard::TEvRead&);
diff --git a/ydb/core/kqp/runtime/ya.make b/ydb/core/kqp/runtime/ya.make
index 71c0fde7911..5922f0ef0d4 100644
--- a/ydb/core/kqp/runtime/ya.make
+++ b/ydb/core/kqp/runtime/ya.make
@@ -36,6 +36,7 @@ PEERDIR(
ydb/library/yql/dq/actors/protos
ydb/library/yql/dq/common
ydb/library/yql/dq/runtime
+ library/cpp/threading/hot_swap
)
YQL_LAST_ABI_VERSION()
diff --git a/ydb/core/kqp/ut/scan/kqp_split_ut.cpp b/ydb/core/kqp/ut/scan/kqp_split_ut.cpp
index 8368a9dd499..a04b3aaf2b9 100644
--- a/ydb/core/kqp/ut/scan/kqp_split_ut.cpp
+++ b/ydb/core/kqp/ut/scan/kqp_split_ut.cpp
@@ -362,6 +362,13 @@ Y_UNIT_TEST_SUITE(KqpSplit) {
Runtime = Server->GetRuntime();
KqpProxy = MakeKqpProxyID(Runtime->GetNodeId(0));
+ {
+ auto settings = MakeIntrusive<TIteratorReadBackoffSettings>();
+ settings->StartRetryDelay = TDuration::MilliSeconds(250);
+ settings->MaxShardAttempts = 4;
+ SetReadIteratorBackoffSettings(settings);
+ }
+
Sender = Runtime->AllocateEdgeActor();
CollectKeysTo(&CollectedKeys, Runtime, Sender);
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index dcd6d3d1c2e..9689aed58dc 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -1256,6 +1256,18 @@ message TTableServiceConfig {
optional uint32 MaxRetryNumber = 3 [default = 10];
}
+ message TIteratorReadsRetrySettings {
+ optional uint32 StartDelayMs = 1;
+ optional uint32 MaxDelayMs = 8;
+
+ optional uint32 MaxShardRetries = 2;
+ optional uint32 MaxShardResolves = 3;
+ optional double UnsertaintyRatio = 4;
+ optional double Multiplier = 5;
+ optional uint32 IteratorResponseTimeoutMs = 6;
+ optional uint32 MaxTotalRetries = 7;
+ }
+
optional uint32 QueryLimitBytes = 1;
optional uint32 ParametersLimitBytes = 2;
optional uint32 SessionsLimitPerNode = 3;
@@ -1305,6 +1317,7 @@ message TTableServiceConfig {
}
optional EBindingsMode BindingsMode = 40 [default = BM_ENABLED];
+ optional TIteratorReadsRetrySettings IteratorReadsRetrySettings = 41;
};
// Config describes immediate controls and allows