@@ -25,7 +25,7 @@ void TKafkaFindCoordinatorActor::Bootstrap(const NActors::TActorContext& ctx) {
25
25
26
26
bool withProxy = Context->Config .HasProxy () && !Context->Config .GetProxy ().GetHostname ().Empty ();
27
27
if (withProxy) {
28
- SendResponseOkAndDie (Context->Config .GetProxy ().GetHostname (), Context->Config .GetProxy ().GetPort (), - 1 , ctx);
28
+ SendResponseOkAndDie (Context->Config .GetProxy ().GetHostname (), Context->Config .GetProxy ().GetPort (), NKafka::ProxyNodeId , ctx);
29
29
return ;
30
30
}
31
31
@@ -54,6 +54,8 @@ void TKafkaFindCoordinatorActor::SendResponseOkAndDie(const TString& host, i32 p
54
54
response->Port = port;
55
55
response->NodeId = nodeId;
56
56
57
+ KAFKA_LOG_D (" FIND_COORDINATOR response. Host#: " << host << " , Port#: " << port << " , NodeId# " << nodeId);
58
+
57
59
Send (Context->ConnectionId , new TEvKafka::TEvResponse (CorrelationId, response, static_cast <EKafkaErrors>(response->ErrorCode )));
58
60
Die (ctx);
59
61
}
@@ -71,15 +73,21 @@ void TKafkaFindCoordinatorActor::SendResponseFailAndDie(EKafkaErrors error, cons
71
73
72
74
response->Coordinators .push_back (coordinator);
73
75
}
74
-
76
+
77
+ response->ErrorCode = error;
78
+
75
79
Send (Context->ConnectionId , new TEvKafka::TEvResponse (CorrelationId, response, static_cast <EKafkaErrors>(response->ErrorCode )));
76
80
Die (ctx);
77
81
}
78
82
79
83
void TKafkaFindCoordinatorActor::Handle (NKikimr::NIcNodeCache::TEvICNodesInfoCache::TEvGetAllNodesInfoResponse::TPtr& ev, const NActors::TActorContext& ctx) {
80
84
auto iter = ev->Get ()->NodeIdsMapping ->find (ctx.SelfID .NodeId ());
81
85
Y_ABORT_UNLESS (!iter.IsEnd ());
86
+
82
87
auto host = (*ev->Get ()->Nodes )[iter->second ].Host ;
88
+ if (host.StartsWith (UnderlayPrefix)) {
89
+ host = host.substr (sizeof (UnderlayPrefix) - 1 );
90
+ }
83
91
KAFKA_LOG_D (" FIND_COORDINATOR incoming TEvGetAllNodesInfoResponse. Host#: " << host);
84
92
SendResponseOkAndDie (host, Context->Config .GetListeningPort (), ctx.SelfID .NodeId (), ctx);
85
93
}
0 commit comments