From 7f34ec4c3c7c098adefc6f556367e561ffac3cac Mon Sep 17 00:00:00 2001 From: achains Date: Mon, 23 Feb 2026 19:41:41 +0300 Subject: YT-26837: do not log at Error level if error is expected * Changelog entry Type: fix Component: cpp-sdk Introduce TExpectedErrorGuard that prevents logging expected error at Error level in the scope. commit_hash:e11ec54f57024002d18c26edd3fdfc9a9bf1e3a7 --- yt/cpp/mapreduce/client/client.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'yt/cpp/mapreduce/client/client.cpp') diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp index 0fdcf8b4ccf..fa17cf5230c 100644 --- a/yt/cpp/mapreduce/client/client.cpp +++ b/yt/cpp/mapreduce/client/client.cpp @@ -16,6 +16,7 @@ #include "transaction_pinger.h" #include "yt_poller.h" +#include #include #include @@ -77,6 +78,11 @@ void ApplyProxyUrlAliasingRules( } } +bool IsCrossCellDisabledError(const TErrorResponse& e) +{ + return e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath); +} + //////////////////////////////////////////////////////////////////////////////// } // namespace @@ -209,6 +215,8 @@ TNodeId TClientBase::Copy( const TYPath& destinationPath, const TCopyOptions& options) { + TExpectedErrorGuard guard(IsCrossCellDisabledError); + try { return RequestWithRetry( ClientRetryPolicy_->CreatePolicyForGenericRequest(), @@ -216,7 +224,7 @@ TNodeId TClientBase::Copy( return RawClient_->CopyInsideMasterCell(mutationId, TransactionId_, sourcePath, destinationPath, options); }); } catch (const TErrorResponse& e) { - if (e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath)) { + if (IsCrossCellDisabledError(e)) { // Do transaction for cross cell copying. return RequestWithRetry( ClientRetryPolicy_->CreatePolicyForGenericRequest(), -- cgit v1.3