diff options
author | manainen <manainen@yandex-team.com> | 2023-11-20 13:58:03 +0300 |
---|---|---|
committer | manainen <manainen@yandex-team.com> | 2023-11-20 16:19:45 +0300 |
commit | 9356bfd9595eabbbe28f563ecf050735b9a60fd0 (patch) | |
tree | c1b6a50287e3b2ddd5484152ac56bd8b055a75a8 | |
parent | a618c2cdf5e442ab4c8cacf1d2dbddde5226d2e7 (diff) | |
download | ydb-9356bfd9595eabbbe28f563ecf050735b9a60fd0.tar.gz |
Revert commit 744c1831bfbaec79131b5b770963d73aba73ec5f,Enable hardcode of proxies in a hedging client
-rw-r--r-- | yt/yt/client/api/rpc_proxy/config.cpp | 5 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/config.h | 1 | ||||
-rw-r--r-- | yt/yt/client/api/rpc_proxy/connection_impl.cpp | 12 | ||||
-rw-r--r-- | yt/yt/client/cache/rpc.cpp | 6 | ||||
-rw-r--r-- | yt/yt_proto/yt/client/cache/proto/config.proto | 3 |
5 files changed, 5 insertions, 22 deletions
diff --git a/yt/yt/client/api/rpc_proxy/config.cpp b/yt/yt/client/api/rpc_proxy/config.cpp index 1fbd8eb1f6..ced3029902 100644 --- a/yt/yt/client/api/rpc_proxy/config.cpp +++ b/yt/yt/client/api/rpc_proxy/config.cpp @@ -37,8 +37,6 @@ void TConnectionConfig::Register(TRegistrar registrar) .Optional(); registrar.Parameter("proxy_unix_domain_socket", &TThis::ProxyUnixDomainSocket) .Optional(); - registrar.Parameter("enable_proxy_discovery", &TThis::EnableProxyDiscovery) - .Default(true); registrar.Parameter("dynamic_channel_pool", &TThis::DynamicChannelPool) .DefaultNew(); @@ -122,9 +120,6 @@ void TConnectionConfig::Register(TRegistrar registrar) if (config->ProxyAddresses && config->ProxyAddresses->empty()) { THROW_ERROR_EXCEPTION("\"proxy_addresses\" must not be empty"); } - if (!config->EnableProxyDiscovery && !config->ProxyAddresses) { - THROW_ERROR_EXCEPTION("If proxy discovery is disabled, \"proxy_addresses\" should be specified"); - } if (!config->ClusterName && config->ClusterUrl) { config->ClusterName = InferYTClusterFromClusterUrl(*config->ClusterUrl); diff --git a/yt/yt/client/api/rpc_proxy/config.h b/yt/yt/client/api/rpc_proxy/config.h index fd92333c39..3f3de07185 100644 --- a/yt/yt/client/api/rpc_proxy/config.h +++ b/yt/yt/client/api/rpc_proxy/config.h @@ -31,7 +31,6 @@ public: std::optional<std::vector<TString>> ProxyAddresses; NRpc::TServiceDiscoveryEndpointsConfigPtr ProxyEndpoints; std::optional<TString> ProxyUnixDomainSocket; - bool EnableProxyDiscovery; NRpc::TDynamicChannelPoolConfigPtr DynamicChannelPool; diff --git a/yt/yt/client/api/rpc_proxy/connection_impl.cpp b/yt/yt/client/api/rpc_proxy/connection_impl.cpp index 11a7347bae..11621ea707 100644 --- a/yt/yt/client/api/rpc_proxy/connection_impl.cpp +++ b/yt/yt/client/api/rpc_proxy/connection_impl.cpp @@ -252,14 +252,12 @@ TConnection::TConnection(TConnectionConfigPtr config, TConnectionOptions options ConnectionInvoker_ = ActionQueue_->GetInvoker(); } - if (Config_->EnableProxyDiscovery) { - UpdateProxyListExecutor_ = New<TPeriodicExecutor>( - GetInvoker(), - BIND(&TConnection::OnProxyListUpdate, MakeWeak(this)), - TPeriodicExecutorOptions::WithJitter(Config_->ProxyListUpdatePeriod)); - } + UpdateProxyListExecutor_ = New<TPeriodicExecutor>( + GetInvoker(), + BIND(&TConnection::OnProxyListUpdate, MakeWeak(this)), + TPeriodicExecutorOptions::WithJitter(Config_->ProxyListUpdatePeriod)); - if (Config_->EnableProxyDiscovery && Config_->ProxyEndpoints) { + if (Config_->ProxyEndpoints) { ServiceDiscovery_ = NRpc::TDispatcher::Get()->GetServiceDiscovery(); if (!ServiceDiscovery_) { ChannelPool_->SetPeerDiscoveryError(TError("No Service Discovery is configured")); diff --git a/yt/yt/client/cache/rpc.cpp b/yt/yt/client/cache/rpc.cpp index e4cd222d06..1af59b48c9 100644 --- a/yt/yt/client/cache/rpc.cpp +++ b/yt/yt/client/cache/rpc.cpp @@ -45,12 +45,6 @@ NApi::NRpcProxy::TConnectionConfigPtr GetConnectionConfig(const TConfig& config) if (config.GetModifyRowsBatchCapacity() != 0) { connectionConfig->ModifyRowsBatchCapacity = config.GetModifyRowsBatchCapacity(); } - if (config.HasEnableProxyDiscovery()) { - connectionConfig->EnableProxyDiscovery = config.GetEnableProxyDiscovery(); - } - if (!config.GetProxyAddresses().empty()) { - connectionConfig->ProxyAddresses = std::vector<TString>(config.GetProxyAddresses().begin(), config.GetProxyAddresses().end()); - } #define SET_TIMEOUT_OPTION(name) \ if (config.Get##name() != 0) connectionConfig->name = TDuration::MilliSeconds(config.Get ## name()) diff --git a/yt/yt_proto/yt/client/cache/proto/config.proto b/yt/yt_proto/yt/client/cache/proto/config.proto index cbaf674a54..cbaf804ce8 100644 --- a/yt/yt_proto/yt/client/cache/proto/config.proto +++ b/yt/yt_proto/yt/client/cache/proto/config.proto @@ -34,9 +34,6 @@ message TConfig optional uint32 RetryBackoffTime = 14; optional uint32 RetryAttempts = 15; optional uint32 RetryTimeout = 16; - - repeated string ProxyAddresses = 17; - optional bool EnableProxyDiscovery = 18; } message TClustersConfig |