Skip to content

Commit

Permalink
ydb_topic: Fallback to "indirect" write if the server doesn't support…
Browse files Browse the repository at this point in the history
… direct write (#6759)
  • Loading branch information
qyryq authored Jul 17, 2024
1 parent 9e9d0fd commit c172aa1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ydb/public/sdk/cpp/client/ydb_topic/impl/write_session_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,15 @@ void TWriteSessionImpl::OnDescribePartition(const TStatus& status, const Ydb::To

if (!status.IsSuccess()) {
with_lock (Lock) {
handleResult = OnErrorImpl({status.GetStatus(), MakeIssueWithSubIssues("Failed to get partition location", status.GetIssues())});
if (status.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED) {
Settings.DirectWriteToPartition_ = false;
handleResult = OnErrorImpl({
EStatus::UNAVAILABLE,
MakeIssueWithSubIssues("The server does not support direct write, fallback to in-direct write", status.GetIssues())
});
} else {
handleResult = OnErrorImpl({status.GetStatus(), MakeIssueWithSubIssues("Failed to get partition location", status.GetIssues())});
}
}
ProcessHandleResult(handleResult);
return;
Expand Down

0 comments on commit c172aa1

Please sign in to comment.