diff options
author | ermolovd <ermolovd@yandex-team.com> | 2023-11-22 23:37:11 +0300 |
---|---|---|
committer | ermolovd <ermolovd@yandex-team.com> | 2023-11-23 02:07:12 +0300 |
commit | d88984d1343cb5913257268b9373736fd9526889 (patch) | |
tree | c11124926988880381f110b03fd085df29a6e2e4 | |
parent | 2d8373b4ce7dc12b02078b05dd8b530850891aee (diff) | |
download | ydb-d88984d1343cb5913257268b9373736fd9526889.tar.gz |
Revert "YT-20315: Support retries of cross cell copying"
This reverts commit 9b45f88f366c2a170ab826922dd6eeaa64ea4192, reversing
changes made to d6dc5a658da5b61fd71e72f1a60479989c5c64c5.
-rw-r--r-- | yt/cpp/mapreduce/client/client.cpp | 39 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/client_method_options.h | 1 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/error_codes.h | 1 | ||||
-rw-r--r-- | yt/cpp/mapreduce/raw_client/raw_requests.cpp | 42 | ||||
-rw-r--r-- | yt/cpp/mapreduce/raw_client/raw_requests.h | 18 |
5 files changed, 8 insertions, 93 deletions
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp index 601206744b..62eb1e0139 100644 --- a/yt/cpp/mapreduce/client/client.cpp +++ b/yt/cpp/mapreduce/client/client.cpp @@ -25,7 +25,6 @@ #include <yt/cpp/mapreduce/interface/config.h> #include <yt/cpp/mapreduce/interface/client.h> -#include <yt/cpp/mapreduce/interface/error_codes.h> #include <yt/cpp/mapreduce/interface/fluent.h> #include <yt/cpp/mapreduce/interface/logging/yt_log.h> #include <yt/cpp/mapreduce/interface/skiff_row.h> @@ -133,24 +132,7 @@ TNodeId TClientBase::Copy( const TYPath& destinationPath, const TCopyOptions& options) { - try { - return NRawClient::CopyInsideMasterCell(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, sourcePath, destinationPath, options); - } catch (const TErrorResponse& e) { - if (e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath)) { - // Do transaction for cross cell copying. - - std::function<TNodeId(ITransactionPtr)> lambda = [this, &sourcePath, &destinationPath](ITransactionPtr transaction) { - return NRawClient::CopyWithoutRetries(Context_, transaction->GetId(), sourcePath, destinationPath); - }; - return RetryTransactionWithPolicy<TNodeId>( - this, - lambda, - ClientRetryPolicy_->CreatePolicyForGenericRequest() - ); - } else { - throw; - } - } + return NRawClient::Copy(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, sourcePath, destinationPath, options); } TNodeId TClientBase::Move( @@ -158,24 +140,7 @@ TNodeId TClientBase::Move( const TYPath& destinationPath, const TMoveOptions& options) { - try { - return NRawClient::MoveInsideMasterCell(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, sourcePath, destinationPath, options); - } catch (const TErrorResponse& e) { - if (e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath)) { - // Do transaction for cross cell moving. - - std::function<TNodeId(ITransactionPtr)> lambda = [this, &sourcePath, &destinationPath](ITransactionPtr transaction) { - return NRawClient::MoveWithoutRetries(Context_, transaction->GetId(), sourcePath, destinationPath); - }; - return RetryTransactionWithPolicy<TNodeId>( - this, - lambda, - ClientRetryPolicy_->CreatePolicyForGenericRequest() - ); - } else { - throw; - } - } + return NRawClient::Move(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, sourcePath, destinationPath, options); } TNodeId TClientBase::Link( diff --git a/yt/cpp/mapreduce/interface/client_method_options.h b/yt/cpp/mapreduce/interface/client_method_options.h index b5f0f1e34e..80be6e35e7 100644 --- a/yt/cpp/mapreduce/interface/client_method_options.h +++ b/yt/cpp/mapreduce/interface/client_method_options.h @@ -36,7 +36,6 @@ enum ENodeType : int NT_SCHEDULER_POOL /* "scheduler_pool" */, NT_LINK /* "link" */, NT_GROUP /* "group" */, - NT_PORTAL /* "portal_entrance" */, }; /// diff --git a/yt/cpp/mapreduce/interface/error_codes.h b/yt/cpp/mapreduce/interface/error_codes.h index e784e3ee88..d8d76e04fd 100644 --- a/yt/cpp/mapreduce/interface/error_codes.h +++ b/yt/cpp/mapreduce/interface/error_codes.h @@ -236,7 +236,6 @@ namespace NObjectClient { //////////////////////////////////////////////////////////////////////////////// constexpr int PrerequisiteCheckFailed = 1000; - constexpr int CrossCellAdditionalPath = 1002; //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/cpp/mapreduce/raw_client/raw_requests.cpp b/yt/cpp/mapreduce/raw_client/raw_requests.cpp index 6426ccecf4..a1bcf5989b 100644 --- a/yt/cpp/mapreduce/raw_client/raw_requests.cpp +++ b/yt/cpp/mapreduce/raw_client/raw_requests.cpp @@ -165,20 +165,7 @@ TNodeId Create( return ParseGuidFromResponse(RetryRequestWithPolicy(retryPolicy, context, header).Response); } -TNodeId CopyWithoutRetries( - const TClientContext& context, - const TTransactionId& transactionId, - const TYPath& sourcePath, - const TYPath& destinationPath, - const TCopyOptions& options) -{ - THttpHeader header("POST", "copy"); - header.AddMutationId(); - header.MergeParameters(SerializeParamsForCopy(transactionId, context.Config->Prefix, sourcePath, destinationPath, options)); - return ParseGuidFromResponse(RequestWithoutRetry(context, header).Response); -} - -TNodeId CopyInsideMasterCell( +TNodeId Copy( const IRequestRetryPolicyPtr& retryPolicy, const TClientContext& context, const TTransactionId& transactionId, @@ -188,28 +175,11 @@ TNodeId CopyInsideMasterCell( { THttpHeader header("POST", "copy"); header.AddMutationId(); - auto params = SerializeParamsForCopy(transactionId, context.Config->Prefix, sourcePath, destinationPath, options); - - // Make cross cell copying disable. - params["enable_cross_cell_copying"] = false; - header.MergeParameters(params); + header.MergeParameters(SerializeParamsForCopy(transactionId, context.Config->Prefix, sourcePath, destinationPath, options)); return ParseGuidFromResponse(RetryRequestWithPolicy(retryPolicy, context, header).Response); } -TNodeId MoveWithoutRetries( - const TClientContext& context, - const TTransactionId& transactionId, - const TYPath& sourcePath, - const TYPath& destinationPath, - const TMoveOptions& options) -{ - THttpHeader header("POST", "move"); - header.AddMutationId(); - header.MergeParameters(SerializeParamsForMove(transactionId, context.Config->Prefix, sourcePath, destinationPath, options)); - return ParseGuidFromResponse(RequestWithoutRetry( context, header).Response); -} - -TNodeId MoveInsideMasterCell( +TNodeId Move( const IRequestRetryPolicyPtr& retryPolicy, const TClientContext& context, const TTransactionId& transactionId, @@ -219,11 +189,7 @@ TNodeId MoveInsideMasterCell( { THttpHeader header("POST", "move"); header.AddMutationId(); - auto params = SerializeParamsForMove(transactionId, context.Config->Prefix, sourcePath, destinationPath, options); - - // Make cross cell copying disable. - params["enable_cross_cell_copying"] = false; - header.MergeParameters(params); + header.MergeParameters(NRawClient::SerializeParamsForMove(transactionId, context.Config->Prefix, sourcePath, destinationPath, options)); return ParseGuidFromResponse(RetryRequestWithPolicy(retryPolicy, context, header).Response); } diff --git a/yt/cpp/mapreduce/raw_client/raw_requests.h b/yt/cpp/mapreduce/raw_client/raw_requests.h index c2d1a53b51..e872431088 100644 --- a/yt/cpp/mapreduce/raw_client/raw_requests.h +++ b/yt/cpp/mapreduce/raw_client/raw_requests.h @@ -84,14 +84,7 @@ TNodeId Create( const ENodeType& type, const TCreateOptions& options = TCreateOptions()); -TNodeId CopyWithoutRetries( - const TClientContext& context, - const TTransactionId& transactionId, - const TYPath& sourcePath, - const TYPath& destinationPath, - const TCopyOptions& options = TCopyOptions()); - -TNodeId CopyInsideMasterCell( +TNodeId Copy( const IRequestRetryPolicyPtr& retryPolicy, const TClientContext& context, const TTransactionId& transactionId, @@ -99,14 +92,7 @@ TNodeId CopyInsideMasterCell( const TYPath& destinationPath, const TCopyOptions& options = TCopyOptions()); -TNodeId MoveWithoutRetries( - const TClientContext& context, - const TTransactionId& transactionId, - const TYPath& sourcePath, - const TYPath& destinationPath, - const TMoveOptions& options = TMoveOptions()); - -TNodeId MoveInsideMasterCell( +TNodeId Move( const IRequestRetryPolicyPtr& retryPolicy, const TClientContext& context, const TTransactionId& transactionId, |