Skip to content

Commit 3891cbb

Browse files
authored
Fixes dqrun with enabled row dispatcher (#12068)
1 parent 38350c0 commit 3891cbb

File tree

6 files changed

+33
-17
lines changed

6 files changed

+33
-17
lines changed

ydb/core/fq/libs/init/init.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ void Init(
204204
credentialsFactory,
205205
tenant,
206206
yqCounters->GetSubgroup("subsystem", "row_dispatcher"),
207-
CreatePqNativeGateway(pqServices));
207+
CreatePqNativeGateway(pqServices),
208+
appData->Mon);
208209
actorRegistrator(NFq::RowDispatcherServiceActorId(), rowDispatcher.release());
209210
}
210211

ydb/core/fq/libs/row_dispatcher/row_dispatcher.cpp

+15-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <ydb/library/yql/providers/dq/counters/counters.h>
1111
#include <yql/essentials/public/purecalc/common/interface.h>
1212

13-
#include <ydb/core/base/appdata_fwd.h>
1413
#include <ydb/core/fq/libs/actors/logging/log.h>
1514
#include <ydb/core/fq/libs/events/events.h>
1615
#include <ydb/core/mon/mon.h>
@@ -261,6 +260,7 @@ class TRowDispatcher : public TActorBootstrapped<TRowDispatcher> {
261260
const ::NMonitoring::TDynamicCounterPtr Counters;
262261
TRowDispatcherMetrics Metrics;
263262
NYql::IPqGateway::TPtr PqGateway;
263+
NActors::TMon* Monitoring;
264264
TNodesTracker NodesTracker;
265265
TAggregatedStats AggrStats;
266266

@@ -329,7 +329,8 @@ class TRowDispatcher : public TActorBootstrapped<TRowDispatcher> {
329329
const TString& tenant,
330330
const NFq::NRowDispatcher::IActorFactory::TPtr& actorFactory,
331331
const ::NMonitoring::TDynamicCounterPtr& counters,
332-
const NYql::IPqGateway::TPtr& pqGateway);
332+
const NYql::IPqGateway::TPtr& pqGateway,
333+
NActors::TMon* monitoring = nullptr);
333334

334335
void Bootstrap();
335336

@@ -401,7 +402,8 @@ TRowDispatcher::TRowDispatcher(
401402
const TString& tenant,
402403
const NFq::NRowDispatcher::IActorFactory::TPtr& actorFactory,
403404
const ::NMonitoring::TDynamicCounterPtr& counters,
404-
const NYql::IPqGateway::TPtr& pqGateway)
405+
const NYql::IPqGateway::TPtr& pqGateway,
406+
NActors::TMon* monitoring)
405407
: Config(config)
406408
, CredentialsProviderFactory(credentialsProviderFactory)
407409
, PureCalcProgramFactory(CreatePureCalcProgramFactory())
@@ -412,7 +414,9 @@ TRowDispatcher::TRowDispatcher(
412414
, ActorFactory(actorFactory)
413415
, Counters(counters)
414416
, Metrics(counters)
415-
, PqGateway(pqGateway) {
417+
, PqGateway(pqGateway)
418+
, Monitoring(monitoring)
419+
{
416420
}
417421

418422
void TRowDispatcher::Bootstrap() {
@@ -425,11 +429,9 @@ void TRowDispatcher::Bootstrap() {
425429
Schedule(TDuration::Seconds(CoordinatorPingPeriodSec), new TEvPrivate::TEvCoordinatorPing());
426430
Schedule(TDuration::Seconds(UpdateMetricsPeriodSec), new NFq::TEvPrivate::TEvUpdateMetrics());
427431
Schedule(TDuration::Seconds(PrintStateToLogPeriodSec), new NFq::TEvPrivate::TEvPrintStateToLog());
428-
429-
NActors::TMon* mon = NKikimr::AppData()->Mon;
430-
if (mon) {
431-
::NMonitoring::TIndexMonPage* actorsMonPage = mon->RegisterIndexPage("actors", "Actors");
432-
mon->RegisterActorPage(actorsMonPage, "row_dispatcher", "Row Dispatcher", false,
432+
if (Monitoring) {
433+
::NMonitoring::TIndexMonPage* actorsMonPage = Monitoring->RegisterIndexPage("actors", "Actors");
434+
Monitoring->RegisterActorPage(actorsMonPage, "row_dispatcher", "Row Dispatcher", false,
433435
TlsActivationContext->ExecutorThread.ActorSystem, SelfId());
434436
}
435437
NodesTracker.Init(SelfId());
@@ -964,7 +966,8 @@ std::unique_ptr<NActors::IActor> NewRowDispatcher(
964966
const TString& tenant,
965967
const NFq::NRowDispatcher::IActorFactory::TPtr& actorFactory,
966968
const ::NMonitoring::TDynamicCounterPtr& counters,
967-
const NYql::IPqGateway::TPtr& pqGateway)
969+
const NYql::IPqGateway::TPtr& pqGateway,
970+
NActors::TMon* monitoring)
968971
{
969972
return std::unique_ptr<NActors::IActor>(new TRowDispatcher(
970973
config,
@@ -974,7 +977,8 @@ std::unique_ptr<NActors::IActor> NewRowDispatcher(
974977
tenant,
975978
actorFactory,
976979
counters,
977-
pqGateway));
980+
pqGateway,
981+
monitoring));
978982
}
979983

980984
} // namespace NFq

ydb/core/fq/libs/row_dispatcher/row_dispatcher.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#include <memory>
1515

16+
namespace NActors {
17+
class TMon;
18+
}
19+
1620
namespace NFq {
1721

1822
std::unique_ptr<NActors::IActor> NewRowDispatcher(
@@ -23,6 +27,7 @@ std::unique_ptr<NActors::IActor> NewRowDispatcher(
2327
const TString& tenant,
2428
const NFq::NRowDispatcher::IActorFactory::TPtr& actorFactory,
2529
const ::NMonitoring::TDynamicCounterPtr& counters,
26-
const NYql::IPqGateway::TPtr& pqGateway);
30+
const NYql::IPqGateway::TPtr& pqGateway,
31+
NActors::TMon* monitoring = nullptr);
2732

2833
} // namespace NFq

ydb/core/fq/libs/row_dispatcher/row_dispatcher_service.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ std::unique_ptr<NActors::IActor> NewRowDispatcherService(
1616
NYql::ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory,
1717
const TString& tenant,
1818
const ::NMonitoring::TDynamicCounterPtr& counters,
19-
const NYql::IPqGateway::TPtr& pqGateway)
19+
const NYql::IPqGateway::TPtr& pqGateway,
20+
NActors::TMon* monitoring)
2021
{
2122
return NewRowDispatcher(
2223
config,
@@ -26,7 +27,8 @@ std::unique_ptr<NActors::IActor> NewRowDispatcherService(
2627
tenant,
2728
NFq::NRowDispatcher::CreateActorFactory(),
2829
counters,
29-
pqGateway);
30+
pqGateway,
31+
monitoring);
3032
}
3133

3234
} // namespace NFq

ydb/core/fq/libs/row_dispatcher/row_dispatcher_service.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#include <memory>
1515

16+
namespace NActors {
17+
class TMon;
18+
}
19+
1620
namespace NFq {
1721

1822
std::unique_ptr<NActors::IActor> NewRowDispatcherService(
@@ -22,6 +26,7 @@ std::unique_ptr<NActors::IActor> NewRowDispatcherService(
2226
NYql::ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory,
2327
const TString& tenant,
2428
const ::NMonitoring::TDynamicCounterPtr& counters,
25-
const NYql::IPqGateway::TPtr& pqGateway);
29+
const NYql::IPqGateway::TPtr& pqGateway,
30+
NActors::TMon* monitoring = nullptr);
2631

2732
} // namespace NFq

ydb/core/fq/libs/row_dispatcher/ya.make

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ SRCS(
1515
PEERDIR(
1616
contrib/libs/fmt
1717
contrib/libs/simdjson
18-
ydb/core/base
1918
ydb/core/fq/libs/actors/logging
2019
ydb/core/fq/libs/config/protos
2120
ydb/core/fq/libs/row_dispatcher/events

0 commit comments

Comments
 (0)