diff options
author | Pisarenko Grigoriy <grigoriypisar@ydb.tech> | 2025-02-11 14:40:33 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-11 12:40:33 +0300 |
commit | 30f1c6cba1ad3d7d93d31f91c01e6516c4e610ad (patch) | |
tree | 9aa9082b96379d6eb1f103387ea83430b8c7c427 | |
parent | 045e4e6cbc1c455a87f223a98aec9dcadd773f8f (diff) | |
download | ydb-30f1c6cba1ad3d7d93d31f91c01e6516c4e610ad.tar.gz |
YQ-4103 fixed overflow in kqp write actor CalculateNextAttemptDelay (#14415)
-rw-r--r-- | ydb/core/kqp/runtime/kqp_write_actor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ydb/core/kqp/runtime/kqp_write_actor.cpp b/ydb/core/kqp/runtime/kqp_write_actor.cpp index a6e5fd0ea3..8646dc0dbb 100644 --- a/ydb/core/kqp/runtime/kqp_write_actor.cpp +++ b/ydb/core/kqp/runtime/kqp_write_actor.cpp @@ -32,7 +32,7 @@ namespace { TDuration CalculateNextAttemptDelay(const NKikimr::NKqp::TWriteActorSettings& settings, ui64 attempt) { auto delay = settings.StartRetryDelay; - for (ui64 index = 0; index < attempt; ++index) { + for (ui64 index = 0; index < attempt && delay * (1 - settings.UnsertaintyRatio) <= settings.MaxRetryDelay; ++index) { delay *= settings.Multiplier; } @@ -214,7 +214,8 @@ public: const TActorId sessionActorId, TIntrusivePtr<TKqpCounters> counters, NWilson::TTraceId traceId) - : TypeEnv(typeEnv) + : MessageSettings(GetWriteActorSettings()) + , TypeEnv(typeEnv) , Alloc(alloc) , MvccSnapshot(mvccSnapshot) , LockMode(lockMode) |