Skip to content

Commit d1c65a2

Browse files
VladilenGazizonoki
authored andcommitted
Fix Missing Step in EvReadSetAck (#19424)
1 parent d0f9d45 commit d1c65a2

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6e380d54416c706390bbe2609c7a054de2bf3b89
1+
a01853cb85b51ba9c678dffd9d2c0cda8e7e55f3

include/ydb-cpp-sdk/library/retry/retry_policy.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

33
#include <util/datetime/base.h>
4-
#include <util/generic/maybe.h>
54
#include <util/generic/typetraits.h>
65
#include <util/random/random.h>
76

@@ -42,7 +41,7 @@ struct IRetryPolicy {
4241

4342
//! Calculate delay before next retry if next retry is allowed.
4443
//! Returns empty maybe if retry is not allowed anymore.
45-
[[nodiscard]] virtual TMaybe<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) = 0;
44+
[[nodiscard]] virtual std::optional<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) = 0;
4645
};
4746

4847
virtual ~IRetryPolicy() = default;
@@ -82,8 +81,8 @@ struct TNoRetryPolicy : IRetryPolicy<TArgs...> {
8281
using IRetryState = typename IRetryPolicy<TArgs...>::IRetryState;
8382

8483
struct TNoRetryState : IRetryState {
85-
TMaybe<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam...) override {
86-
return {};
84+
std::optional<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam...) override {
85+
return std::nullopt;
8786
}
8887
};
8988

@@ -124,10 +123,10 @@ struct TExponentialBackoffPolicy : IRetryPolicy<TArgs...> {
124123
{
125124
}
126125

127-
TMaybe<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) override {
126+
std::optional<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) override {
128127
const ERetryErrorClass errorClass = RetryClassFunction(args...);
129128
if (errorClass == ERetryErrorClass::NoRetry || AttemptsDone >= MaxRetries || StartTime && TInstant::Now() - StartTime >= MaxTime) {
130-
return {};
129+
return std::nullopt;
131130
}
132131

133132
if (errorClass == ERetryErrorClass::LongRetry) {
@@ -213,10 +212,10 @@ struct TFixedIntervalPolicy : IRetryPolicy<TArgs...> {
213212
{
214213
}
215214

216-
TMaybe<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) override {
215+
std::optional<TDuration> GetNextRetryDelay(typename TTypeTraits<TArgs>::TFuncParam... args) override {
217216
const ERetryErrorClass errorClass = RetryClassFunction(args...);
218217
if (errorClass == ERetryErrorClass::NoRetry || AttemptsDone >= MaxRetries || StartTime && TInstant::Now() - StartTime >= MaxTime) {
219-
return {};
218+
return std::nullopt;
220219
}
221220

222221
const TDuration delay = NRetryDetails::RandomizeDelay(errorClass == ERetryErrorClass::LongRetry ? LongRetryDelay : Delay);

src/client/topic/ut/topic_to_table_ut.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4021,7 +4021,6 @@ Y_UNIT_TEST_F(Sinks_Oltp_WriteToTopicAndTable_6_Query, TFixtureSinksQuery)
40214021

40224022
void TFixtureSinks::TestSinksOlapWriteToTopicAndTable1()
40234023
{
4024-
return; // https://github.com/ydb-platform/ydb/issues/17271
40254024
CreateTopic("topic_A");
40264025
CreateColumnTable("/Root/table_A");
40274026

@@ -4054,7 +4053,6 @@ Y_UNIT_TEST_F(Sinks_Olap_WriteToTopicAndTable_1_Query, TFixtureSinksQuery)
40544053

40554054
void TFixtureSinks::TestSinksOlapWriteToTopicAndTable2()
40564055
{
4057-
return; // https://github.com/ydb-platform/ydb/issues/17271
40584056
CreateTopic("topic_A");
40594057
CreateTopic("topic_B");
40604058

@@ -4141,7 +4139,6 @@ Y_UNIT_TEST_F(Sinks_Olap_WriteToTopicAndTable_3_Query, TFixtureSinksQuery)
41414139

41424140
void TFixtureSinks::TestSinksOlapWriteToTopicAndTable4()
41434141
{
4144-
return; // https://github.com/ydb-platform/ydb/issues/17271
41454142
CreateTopic("topic_A");
41464143
CreateTopic("topic_B");
41474144

src/library/retry/retry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class TRetryOptionsWithRetCodePolicy : public IRetryPolicy<bool> {
1717
{
1818
}
1919

20-
TMaybe<TDuration> GetNextRetryDelay(bool ret) override {
20+
std::optional<TDuration> GetNextRetryDelay(bool ret) override {
2121
if (ret || Attempt == Opts.RetryCount) {
22-
return {};
22+
return std::nullopt;
2323
}
2424
return Opts.GetTimeToSleep(Attempt++);
2525
}

src/library/retry/retry.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ class TRetryOptionsPolicy : public IRetryPolicy<const TException&> {
104104
{
105105
}
106106

107-
TMaybe<TDuration> GetNextRetryDelay(const TException&) override {
107+
std::optional<TDuration> GetNextRetryDelay(const TException&) override {
108108
if (Attempt == Opts.RetryCount) {
109-
return {};
109+
return std::nullopt;
110110
}
111111
return Opts.GetTimeToSleep(Attempt++);
112112
}
@@ -151,7 +151,7 @@ std::optional<TResult> DoWithRetry(std::function<TResult()> func, const typename
151151
retryState = retryPolicy->CreateRetryState();
152152
}
153153

154-
if (const TMaybe<TDuration> delay = retryState->GetNextRetryDelay(ex)) {
154+
if (const std::optional<TDuration> delay = retryState->GetNextRetryDelay(ex)) {
155155
if (*delay) {
156156
if (sleepFunction) {
157157
sleepFunction(*delay);
@@ -167,7 +167,7 @@ std::optional<TResult> DoWithRetry(std::function<TResult()> func, const typename
167167
}
168168
}
169169
}
170-
return {};
170+
return std::nullopt;
171171
}
172172

173173
template <typename TResult, typename TException = yexception>
@@ -204,7 +204,7 @@ TRetCode DoWithRetryOnRetCode(std::function<TRetCode()> func, const typename IRe
204204
auto retryState = retryPolicy->CreateRetryState();
205205
while (true) {
206206
TRetCode code = func();
207-
if (const TMaybe<TDuration> delay = retryState->GetNextRetryDelay(code)) {
207+
if (const std::optional<TDuration> delay = retryState->GetNextRetryDelay(code)) {
208208
if (*delay) {
209209
if (sleepFunction) {
210210
sleepFunction(*delay);

0 commit comments

Comments
 (0)