Skip to content

Commit 8b95d53

Browse files
committed
Moved commit "ydb_topic write session: lower log level for retryable errors" from ydb repo
1 parent 4b10051 commit 8b95d53

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/client/persqueue_public/impl/write_session_impl.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
9393
LOG_LAZY(DbDriverState->Log, TLOG_DEBUG, LogPrefix() << "Write session is aborting and will not restart");
9494
return result;
9595
}
96-
LOG_LAZY(DbDriverState->Log, TLOG_ERR,
97-
LogPrefix() << "Got error. Status: " << status.Status
98-
<< ". Description: " << IssuesSingleLineString(status.Issues)
99-
);
96+
10097
SessionEstablished = false;
10198
if (!RetryState) {
10299
RetryState = Settings.RetryPolicy_->CreateRetryState();
@@ -106,13 +103,11 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
106103
if (nextDelay) {
107104
result.StartDelay = *nextDelay;
108105
result.DoRestart = true;
109-
LOG_LAZY(DbDriverState->Log,
110-
TLOG_DEBUG,
111-
LogPrefix() << "Write session will restart in " << result.StartDelay.MilliSeconds() << " ms"
112-
);
106+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Got error. " << status.ToDebugString());
107+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Write session will restart in " << result.StartDelay);
113108
ResetForRetryImpl();
114-
115109
} else {
110+
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
116111
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Write session will not restart after a fatal error");
117112
result.DoStop = true;
118113
CheckHandleResultImpl(result);

src/client/topic/impl/write_session_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
171171
LOG_LAZY(DbDriverState->Log, TLOG_DEBUG, LogPrefix() << "Write session is aborting and will not restart");
172172
return result;
173173
}
174-
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
175174
SessionEstablished = false;
176175

177176
// Keep DirectWriteToPartitionId value on temporary errors.
@@ -192,10 +191,11 @@ TWriteSessionImpl::THandleResult TWriteSessionImpl::RestartImpl(const TPlainStat
192191
if (nextDelay) {
193192
result.StartDelay = *nextDelay;
194193
result.DoRestart = true;
195-
LOG_LAZY(DbDriverState->Log, TLOG_WARNING, LogPrefix() << "Write session will restart in " << result.StartDelay);
194+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Got error. " << status.ToDebugString());
195+
LOG_LAZY(DbDriverState->Log, TLOG_INFO, LogPrefix() << "Write session will restart in " << result.StartDelay);
196196
ResetForRetryImpl();
197-
198197
} else {
198+
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Got error. " << status.ToDebugString());
199199
LOG_LAZY(DbDriverState->Log, TLOG_ERR, LogPrefix() << "Write session will not restart after a fatal error");
200200
result.DoStop = true;
201201
CheckHandleResultImpl(result);

0 commit comments

Comments
 (0)