diff options
author | kvk1920 <kvk1920@yandex-team.com> | 2024-05-23 13:33:56 +0300 |
---|---|---|
committer | kvk1920 <kvk1920@yandex-team.com> | 2024-05-23 13:47:07 +0300 |
commit | 9f108c885d4431f62dc2c5fdc61f1f16caa16566 (patch) | |
tree | 4d40e062c989a8470d69bf3ea864c203ef2fe0d9 /yt | |
parent | b94816f2468c7644ab4c92ad7d3e0e7fa113968b (diff) | |
download | ydb-9f108c885d4431f62dc2c5fdc61f1f16caa16566.tar.gz |
Use mirrored Cypress tx in tests
447630a98133ef6f60263ea998721a86e0affead
Diffstat (limited to 'yt')
-rw-r--r-- | yt/python/yt/common.py | 14 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/api_service_proxy.h | 2 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.cpp | 22 | ||||
-rw-r--r-- | yt/yt/client/object_client/helpers.cpp | 19 | ||||
-rw-r--r-- | yt/yt/client/object_client/helpers.h | 3 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto | 20 |
6 files changed, 61 insertions, 19 deletions
diff --git a/yt/python/yt/common.py b/yt/python/yt/common.py index 6b1730720a..e2c96a80ff 100644 --- a/yt/python/yt/common.py +++ b/yt/python/yt/common.py @@ -336,31 +336,31 @@ class YtError(Exception): return self.find_matching_error(predicate=pred_new) or self.find_matching_error(predicate=pred_old) def is_row_is_blocked(self): - """Row is blocked""" + """Row is blocked.""" return self.contains_code(1712) def is_blocked_row_wait_timeout(self): - """Timed out waiting on blocked row""" + """Timed out waiting on blocked row.""" return self.contains_code(1713) def is_chunk_not_preloaded(self): - """Chunk data is not preloaded yet""" + """Chunk data is not preloaded yet.""" return self.contains_code(1735) def is_no_in_sync_replicas(self): - """No in-sync replicas found""" + """No in-sync replicas found.""" return self.contains_code(1736) def is_already_present_in_group(self): - """Member is already present in group""" + """Member is already present in group.""" return self.contains_code(908) def is_prohibited_cross_cell_copy(self): - """Cross-cell "copy"/"move" command is explicitly disabled""" + """Cross-cell "copy"/"move" command is explicitly disabled.""" return self.contains_code(1002) def is_sequoia_retriable_error(self): - """Probably lock conflict in Sequoia tables""" + """Probably lock conflict in Sequoia tables.""" return self.contains_code(6002) diff --git a/yt/yt/client/api/rpc_proxy/api_service_proxy.h b/yt/yt/client/api/rpc_proxy/api_service_proxy.h index d90e1ede0a..219c823f91 100644 --- a/yt/yt/client/api/rpc_proxy/api_service_proxy.h +++ b/yt/yt/client/api/rpc_proxy/api_service_proxy.h @@ -159,6 +159,8 @@ public: DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, MigrateReplicationCards); DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, SuspendChaosCells); DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, ResumeChaosCells); + DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, SuspendTabletCells); + DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, ResumeTabletCells); DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, AddMaintenance); DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, RemoveMaintenance); DEFINE_RPC_PROXY_METHOD(NRpcProxy::NProto, DisableChunkLocations); diff --git a/yt/yt/client/api/rpc_proxy/client_impl.cpp b/yt/yt/client/api/rpc_proxy/client_impl.cpp index 176b6f5294..58f5d5db70 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp @@ -1948,7 +1948,7 @@ TFuture<void> TClient::SuspendChaosCells( auto req = proxy.SuspendChaosCells(); ToProto(req->mutable_cell_ids(), cellIds); - return req->Invoke().As<void>(); + return req->Invoke().AsVoid(); } TFuture<void> TClient::ResumeChaosCells( @@ -1960,21 +1960,31 @@ TFuture<void> TClient::ResumeChaosCells( auto req = proxy.ResumeChaosCells(); ToProto(req->mutable_cell_ids(), cellIds); - return req->Invoke().As<void>(); + return req->Invoke().AsVoid(); } TFuture<void> TClient::SuspendTabletCells( - const std::vector<TCellId>& /*cellIds*/, + const std::vector<TCellId>& cellIds, const TSuspendTabletCellsOptions& /*options*/) { - ThrowUnimplemented("SuspendTabletCells"); + auto proxy = CreateApiServiceProxy(); + + auto req = proxy.SuspendTabletCells(); + ToProto(req->mutable_cell_ids(), cellIds); + + return req->Invoke().AsVoid(); } TFuture<void> TClient::ResumeTabletCells( - const std::vector<TCellId>& /*cellIds*/, + const std::vector<TCellId>& cellIds, const TResumeTabletCellsOptions& /*options*/) { - ThrowUnimplemented("ResumeTabletCells"); + auto proxy = CreateApiServiceProxy(); + + auto req = proxy.ResumeTabletCells(); + ToProto(req->mutable_cell_ids(), cellIds); + + return req->Invoke().AsVoid(); } TFuture<TDisableChunkLocationsResult> TClient::DisableChunkLocations( diff --git a/yt/yt/client/object_client/helpers.cpp b/yt/yt/client/object_client/helpers.cpp index 04d5e7e647..1adac1a241 100644 --- a/yt/yt/client/object_client/helpers.cpp +++ b/yt/yt/client/object_client/helpers.cpp @@ -263,18 +263,25 @@ bool IsCypressTransactionType(EObjectType type) { return type == EObjectType::Transaction || - type == EObjectType::NestedTransaction || - type == EObjectType::ExternalizedTransaction || - type == EObjectType::ExternalizedNestedTransaction || - type == EObjectType::UploadTransaction || - type == EObjectType::UploadNestedTransaction; + type == EObjectType::NestedTransaction; } bool IsSystemTransactionType(EObjectType type) { return type == EObjectType::SystemTransaction || - type == EObjectType::SystemNestedTransaction; + type == EObjectType::SystemNestedTransaction || + type == EObjectType::UploadTransaction || + type == EObjectType::UploadNestedTransaction || + type == EObjectType::ExternalizedTransaction || + type == EObjectType::ExternalizedNestedTransaction; +} + +bool IsUploadTransactionType(EObjectType type) +{ + return + type == EObjectType::UploadTransaction || + type == EObjectType::UploadNestedTransaction; } bool HasSchema(EObjectType type) diff --git a/yt/yt/client/object_client/helpers.h b/yt/yt/client/object_client/helpers.h index d172d8b45c..d3077bec60 100644 --- a/yt/yt/client/object_client/helpers.h +++ b/yt/yt/client/object_client/helpers.h @@ -75,6 +75,9 @@ bool IsCypressTransactionType(EObjectType type); //! Checks if the given type is a system transaction. bool IsSystemTransactionType(EObjectType type); +//! Checks if the given type if an upload transaction. +bool IsUploadTransactionType(EObjectType type); + //! Extracts the type component from #id. EObjectType TypeFromId(TObjectId id); diff --git a/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto b/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto index e58f18c04a..789f83cb99 100644 --- a/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto +++ b/yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto @@ -1064,6 +1064,26 @@ message TRspResumeChaosCells //////////////////////////////////////////////////////////////////////////////// +message TReqSuspendTabletCells +{ + repeated NYT.NProto.TGuid cell_ids = 1; +} + +message TRspSuspendTabletCells +{ } + +//////////////////////////////////////////////////////////////////////////////// + +message TReqResumeTabletCells +{ + repeated NYT.NProto.TGuid cell_ids = 1; +} + +message TRspResumeTabletCells +{ } + +//////////////////////////////////////////////////////////////////////////////// + message TReqAddMaintenance { required EMaintenanceComponent component = 1; |