diff options
author | osidorkin <osidorkin@yandex-team.com> | 2024-09-25 18:27:23 +0300 |
---|---|---|
committer | osidorkin <osidorkin@yandex-team.com> | 2024-09-25 18:37:38 +0300 |
commit | 987226d30e6d8c573eb8af0b4cba2216bca4457f (patch) | |
tree | 726cc377e9ff871d2cb3805507016617f655d926 | |
parent | c9d7dbfe7496e368fdac64fa36ef1bd24745cfc5 (diff) | |
download | ydb-987226d30e6d8c573eb8af0b4cba2216bca4457f.tar.gz |
YT-22894: Add ability to change chaos replica path with alter_table_replica command
commit_hash:9aa80e83e2d18edfb322de5f0591b324aaf93024
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.cpp | 8 | ||||
-rw-r--r-- | yt/yt/client/api/table_client.h | 1 | ||||
-rw-r--r-- | yt/yt/client/driver/table_commands.cpp | 8 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto | 1 |
4 files changed, 18 insertions, 0 deletions
diff --git a/yt/yt/client/api/rpc_proxy/client_impl.cpp b/yt/yt/client/api/rpc_proxy/client_impl.cpp index cc9e093381..b9e4944381 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp @@ -471,19 +471,27 @@ TFuture<void> TClient::AlterTableReplica( if (options.Enabled) { req->set_enabled(*options.Enabled); } + if (options.Mode) { req->set_mode(static_cast<NProto::ETableReplicaMode>(*options.Mode)); } + if (options.PreserveTimestamps) { req->set_preserve_timestamps(*options.PreserveTimestamps); } + if (options.Atomicity) { req->set_atomicity(static_cast<NProto::EAtomicity>(*options.Atomicity)); } + if (options.EnableReplicatedTableTracker) { req->set_enable_replicated_table_tracker(*options.EnableReplicatedTableTracker); } + if (options.ReplicaPath) { + req->set_replica_path(*options.ReplicaPath); + } + ToProto(req->mutable_mutating_options(), options); return req->Invoke().As<void>(); diff --git a/yt/yt/client/api/table_client.h b/yt/yt/client/api/table_client.h index f577d4a4b4..581412eba7 100644 --- a/yt/yt/client/api/table_client.h +++ b/yt/yt/client/api/table_client.h @@ -135,6 +135,7 @@ struct TAlterTableReplicaOptions std::optional<bool> PreserveTimestamps; std::optional<NTransactionClient::EAtomicity> Atomicity; std::optional<bool> EnableReplicatedTableTracker; + std::optional<TString> ReplicaPath; }; struct TGetTablePivotKeysOptions diff --git a/yt/yt/client/driver/table_commands.cpp b/yt/yt/client/driver/table_commands.cpp index 9b5d7cae49..0ff27ef95f 100644 --- a/yt/yt/client/driver/table_commands.cpp +++ b/yt/yt/client/driver/table_commands.cpp @@ -1564,6 +1564,14 @@ void TAlterTableReplicaCommand::Register(TRegistrar registrar) return command->Options.EnableReplicatedTableTracker; }) .Optional(/*init*/ false); + + registrar.ParameterWithUniversalAccessor<std::optional<TString>>( + "replica_path", + [] (TThis* command) -> auto& { + return command->Options.ReplicaPath; + }) + .Optional(/*init*/ false); + } void TAlterTableReplicaCommand::DoExecute(ICommandContextPtr context) 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 784f7c7da0..6ea6f097d5 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 @@ -1986,6 +1986,7 @@ message TReqAlterTableReplica optional bool preserve_timestamps = 4; optional EAtomicity atomicity = 5; optional bool enable_replicated_table_tracker = 6; + optional string replica_path = 7; optional TMutatingOptions mutating_options = 100; } |