diff options
author | osidorkin <[email protected]> | 2025-04-15 10:17:59 +0300 |
---|---|---|
committer | osidorkin <[email protected]> | 2025-04-15 10:45:03 +0300 |
commit | 36c27f7bdb94e40d0a35d620f175d45d4a0f0911 (patch) | |
tree | 219353d7248f969a13faa7e200e06f4f4b00ba2c | |
parent | 10831e8ed09878b40b32cdc8a87b448a892ce7cd (diff) |
YT-24781: Forbid decreasing sync queues count below configured threshold
commit_hash:d4574d543aa7fac828f045a14f957088a8e67fb6
-rw-r--r-- | yt/yt/client/api/rpc_proxy/client_impl.cpp | 4 | ||||
-rw-r--r-- | yt/yt/client/api/table_client.h | 1 | ||||
-rw-r--r-- | yt/yt/client/driver/table_commands.cpp | 7 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto | 1 |
4 files changed, 13 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 8612fe53a28..0d0f478a6da 100644 --- a/yt/yt/client/api/rpc_proxy/client_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/client_impl.cpp @@ -487,6 +487,10 @@ TFuture<void> TClient::AlterTableReplica( YT_OPTIONAL_SET_PROTO(req, enable_replicated_table_tracker, options.EnableReplicatedTableTracker); YT_OPTIONAL_TO_PROTO(req, replica_path, options.ReplicaPath); + if (options.Force) { + req->set_force(true); + } + 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 bbff942011b..aacd69795c0 100644 --- a/yt/yt/client/api/table_client.h +++ b/yt/yt/client/api/table_client.h @@ -141,6 +141,7 @@ struct TAlterTableReplicaOptions std::optional<NTransactionClient::EAtomicity> Atomicity; std::optional<bool> EnableReplicatedTableTracker; std::optional<NYPath::TYPath> ReplicaPath; + bool Force = false; }; struct TGetTablePivotKeysOptions diff --git a/yt/yt/client/driver/table_commands.cpp b/yt/yt/client/driver/table_commands.cpp index e31b6e43f24..ad441ab80f3 100644 --- a/yt/yt/client/driver/table_commands.cpp +++ b/yt/yt/client/driver/table_commands.cpp @@ -1669,6 +1669,13 @@ void TAlterTableReplicaCommand::Register(TRegistrar registrar) }) .Optional(/*init*/ false); + registrar.ParameterWithUniversalAccessor<bool>( + "force", + [] (TThis* command) -> auto& { + return command->Options.Force; + }) + .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 f4df45769b9..910f80de78c 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 @@ -2006,6 +2006,7 @@ message TReqAlterTableReplica optional EAtomicity atomicity = 5; optional bool enable_replicated_table_tracker = 6; optional bytes replica_path = 7; // YPath + optional bool force = 8; optional TMutatingOptions mutating_options = 100; } |