aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexvru <alexvru@ydb.tech>2023-01-17 21:45:10 +0300
committeralexvru <alexvru@ydb.tech>2023-01-17 21:45:10 +0300
commit6efc847340941a8a32f22ed3cb076a39794b94b7 (patch)
treea8da57ac268b74f2d265d40b91e676546e0f6c8a
parentc4c2cdbbda0d92a4adfb40515374132e1180a725 (diff)
downloadydb-6efc847340941a8a32f22ed3cb076a39794b94b7.tar.gz
Introduce ExternalDataChannel setting
-rw-r--r--library/cpp/actors/interconnect/interconnect_common.h1
-rw-r--r--library/cpp/actors/interconnect/interconnect_handshake.cpp6
-rw-r--r--library/cpp/actors/interconnect/interconnect_mon.cpp3
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp1
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_proxy.h1
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_session.cpp1
-rw-r--r--library/cpp/actors/interconnect/types.h1
-rw-r--r--library/cpp/actors/protos/interconnect.proto2
-rw-r--r--ydb/core/driver_lib/run/kikimr_services_initializers.cpp3
-rw-r--r--ydb/core/protos/config.proto1
10 files changed, 19 insertions, 1 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_common.h b/library/cpp/actors/interconnect/interconnect_common.h
index ea6a5310d4e..309c05bfa32 100644
--- a/library/cpp/actors/interconnect/interconnect_common.h
+++ b/library/cpp/actors/interconnect/interconnect_common.h
@@ -48,6 +48,7 @@ namespace NActors {
ui32 MaxSerializedEventSize = NActors::EventMaxByteSize;
ui32 PreallocatedBufferSize = 8 << 10; // 8 KB
ui32 NumPreallocatedBuffers = 16;
+ bool EnableExternalDataChannel = false;
ui32 GetSendBufferSize() const {
ui32 res = 512 * 1024; // 512 kb is the default value for send buffer
diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp
index a9c6b1dd112..76c7010d3ad 100644
--- a/library/cpp/actors/interconnect/interconnect_handshake.cpp
+++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp
@@ -520,6 +520,7 @@ namespace NActors {
request.SetRequestModernFrame(true);
request.SetRequestAuthOnly(Common->Settings.TlsAuthOnly);
request.SetRequestExtendedTraceFmt(true);
+ request.SetRequestExternalDataChannel(Common->Settings.EnableExternalDataChannel);
SendExBlock(request, "ExRequest");
@@ -551,6 +552,7 @@ namespace NActors {
Params.UseModernFrame = success.GetUseModernFrame();
Params.AuthOnly = Params.Encryption && success.GetAuthOnly();
Params.UseExtendedTraceFmt = success.GetUseExtendedTraceFmt();
+ Params.UseExternalDataChannel = success.GetUseExternalDataChannel();
if (success.HasServerScopeId()) {
ParsePeerScopeId(success.GetServerScopeId());
}
@@ -708,6 +710,7 @@ namespace NActors {
Params.UseModernFrame = request.GetRequestModernFrame();
Params.AuthOnly = Params.Encryption && request.GetRequestAuthOnly() && Common->Settings.TlsAuthOnly;
Params.UseExtendedTraceFmt = request.GetRequestExtendedTraceFmt();
+ Params.UseExternalDataChannel = request.GetRequestExternalDataChannel() && Common->Settings.EnableExternalDataChannel;
if (request.HasClientScopeId()) {
ParsePeerScopeId(request.GetClientScopeId());
@@ -734,6 +737,7 @@ namespace NActors {
success.SetUseModernFrame(Params.UseModernFrame);
success.SetAuthOnly(Params.AuthOnly);
success.SetUseExtendedTraceFmt(Params.UseExtendedTraceFmt);
+ success.SetUseExternalDataChannel(Params.UseExternalDataChannel);
SendExBlock(record, "ExReply");
// extract sender actor id (self virtual id)
@@ -877,7 +881,7 @@ namespace NActors {
addresses.emplace_back(r.GetAddress(), static_cast<ui16>(r.GetPort()));
} else {
Y_VERIFY(ev->GetTypeRewrite() == ui32(ENetwork::ResolveError));
- Fail(TEvHandshakeFail::HANDSHAKE_FAIL_PERMANENT, "DNS resolve error: " + ev->Get<TEvResolveError>()->Explain
+ Fail(TEvHandshakeFail::HANDSHAKE_FAIL_PERMANENT, "DNS resolve error: " + ev->Get<TEvResolveError>()->Explain
+ ", Unresolved host# " + ev->Get<TEvResolveError>()->Host, true);
}
diff --git a/library/cpp/actors/interconnect/interconnect_mon.cpp b/library/cpp/actors/interconnect/interconnect_mon.cpp
index cf924ccbf9d..6be0b894b87 100644
--- a/library/cpp/actors/interconnect/interconnect_mon.cpp
+++ b/library/cpp/actors/interconnect/interconnect_mon.cpp
@@ -93,6 +93,7 @@ namespace NInterconnect {
TABLEH() { str << "LastSessionDieTime"; }
TABLEH() { str << "TotalOutputQueueSize"; }
TABLEH() { str << "Connected"; }
+ TABLEH() { str << "XDC"; }
TABLEH() { str << "Host"; }
TABLEH() { str << "Port"; }
TABLEH() { str << "LastErrorTimestamp"; }
@@ -129,6 +130,7 @@ namespace NInterconnect {
}
TABLED() { str << kv.second.TotalOutputQueueSize; }
TABLED() { str << (kv.second.Connected ? "yes" : "<strong>no</strong>"); }
+ TABLED() { str << (kv.second.ExternalDataChannel ? "yes" : "no"); }
TABLED() { str << kv.second.Host; }
TABLED() { str << kv.second.Port; }
TABLED() {
@@ -164,6 +166,7 @@ namespace NInterconnect {
JSON(LastSessionDieTime, toString)
JSON(TotalOutputQueueSize, id)
JSON(Connected, id)
+ JSON(ExternalDataChannel, id)
JSON(Host, id)
JSON(Port, id)
JSON(LastErrorTimestamp, toString)
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
index 7e2d8ccb948..938c3480a8e 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
@@ -887,6 +887,7 @@ namespace NActors {
stats.LastSessionDieTime = LastSessionDieTime;
stats.TotalOutputQueueSize = Session ? Session->TotalOutputQueueSize : 0;
stats.Connected = Session ? (bool)Session->Socket : false;
+ stats.ExternalDataChannel = Session && Session->Params.UseExternalDataChannel;
stats.Host = TechnicalPeerHostName;
stats.Port = 0;
ui32 rep = 0;
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
index 023e5bd1eee..b7c9c3cc8a0 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
+++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
@@ -41,6 +41,7 @@ namespace NActors {
TInstant LastSessionDieTime;
ui64 TotalOutputQueueSize;
bool Connected;
+ bool ExternalDataChannel;
TString Host;
ui16 Port;
TInstant LastErrorTimestamp;
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
index feb55a16ad6..7fae0db16a5 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
@@ -1137,6 +1137,7 @@ namespace NActors {
}
MON_VAR(Created)
+ MON_VAR(Params.UseExternalDataChannel)
MON_VAR(NewConnectionSet)
MON_VAR(ReceiverId)
MON_VAR(MessagesGot)
diff --git a/library/cpp/actors/interconnect/types.h b/library/cpp/actors/interconnect/types.h
index e0965d78079..b1d2e02f49d 100644
--- a/library/cpp/actors/interconnect/types.h
+++ b/library/cpp/actors/interconnect/types.h
@@ -55,6 +55,7 @@ namespace NActors {
bool UseModernFrame = {};
bool AuthOnly = {};
bool UseExtendedTraceFmt = {};
+ bool UseExternalDataChannel = {};
TString AuthCN;
NActors::TScopeId PeerScopeId;
};
diff --git a/library/cpp/actors/protos/interconnect.proto b/library/cpp/actors/protos/interconnect.proto
index 69721b1e065..06899e16502 100644
--- a/library/cpp/actors/protos/interconnect.proto
+++ b/library/cpp/actors/protos/interconnect.proto
@@ -72,6 +72,7 @@ message THandshakeRequest {
optional bool RequestModernFrame = 18;
optional bool RequestAuthOnly = 19;
optional bool RequestExtendedTraceFmt = 20;
+ optional bool RequestExternalDataChannel = 21;
}
message THandshakeSuccess {
@@ -94,6 +95,7 @@ message THandshakeSuccess {
optional bool UseModernFrame = 11;
optional bool AuthOnly = 12;
optional bool UseExtendedTraceFmt = 13;
+ optional bool UseExternalDataChannel = 14;
}
message THandshakeReply {
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
index 9cf6e472ce5..2ea32aefb92 100644
--- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
+++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
@@ -555,6 +555,9 @@ static TInterconnectSettings GetInterconnectSettings(const NKikimrConfig::TInter
if (config.HasNumPreallocatedBuffers()) {
result.NumPreallocatedBuffers = config.GetNumPreallocatedBuffers();
}
+ if (config.HasEnableExternalDataChannel()) {
+ result.EnableExternalDataChannel = config.GetEnableExternalDataChannel();
+ }
return result;
}
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index bcfc2eedbff..e474859d5c8 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -424,6 +424,7 @@ message TInterconnectConfig {
optional bool SuppressConnectivityCheck = 39 [default = false];
optional uint32 PreallocatedBufferSize = 40;
optional uint32 NumPreallocatedBuffers = 41;
+ optional bool EnableExternalDataChannel = 42;
// ballast is added to IC handshake frames to ensure correctness of jumbo frames transmission over network
optional uint32 HandshakeBallastSize = 14;