Skip to content

Commit a21ef5d

Browse files
committed
Moved commit "ydb_topic: Fallback to "indirect" write if the server doesn't support direct write" from ydb repo
1 parent 5c359a3 commit a21ef5d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/client/topic/impl/write_session_impl.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,15 @@ void TWriteSessionImpl::OnDescribePartition(const TStatus& status, const Ydb::To
301301

302302
if (!status.IsSuccess()) {
303303
with_lock(Lock) {
304-
handleResult = OnErrorImpl({status.GetStatus(), MakeIssueWithSubIssues("Failed to get partition location", status.GetIssues())});
304+
if (status.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED) {
305+
Settings.DirectWriteToPartition_ = false;
306+
handleResult = OnErrorImpl({
307+
EStatus::UNAVAILABLE,
308+
MakeIssueWithSubIssues("The server does not support direct write, fallback to in-direct write", status.GetIssues())
309+
});
310+
} else {
311+
handleResult = OnErrorImpl({status.GetStatus(), MakeIssueWithSubIssues("Failed to get partition location", status.GetIssues())});
312+
}
305313
}
306314
ProcessHandleResult(handleResult);
307315
return;

0 commit comments

Comments
 (0)