Skip to content

Commit 4a5c678

Browse files
authored
YQ-4091 Fix log message size in coordinator (#14261)
1 parent 4ebe857 commit 4a5c678

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ struct TEvPrivate {
5151
class TActorCoordinator : public TActorBootstrapped<TActorCoordinator> {
5252

5353
const ui64 PrintStatePeriodSec = 300;
54+
const ui64 PrintStateToLogSplitSize = 64000;
5455

5556
struct TTopicKey {
5657
TString Endpoint;
@@ -219,6 +220,7 @@ class TActorCoordinator : public TActorBootstrapped<TActorCoordinator> {
219220
bool ComputeCoordinatorRequest(TActorId readActorId, const TCoordinatorRequest& request);
220221
void UpdatePendingReadActors();
221222
void UpdateInterconnectSessions(const NActors::TActorId& interconnectSession);
223+
TString GetInternalState();
222224
};
223225

224226
TActorCoordinator::TActorCoordinator(
@@ -296,7 +298,7 @@ void TActorCoordinator::Handle(NActors::TEvents::TEvPing::TPtr& ev) {
296298
Send(ev->Sender, new NActors::TEvents::TEvPong(), IEventHandle::FlagTrackDelivery);
297299
}
298300

299-
void TActorCoordinator::PrintInternalState() {
301+
TString TActorCoordinator::GetInternalState() {
300302
TStringStream str;
301303
str << "Known row dispatchers:\n";
302304

@@ -313,8 +315,15 @@ void TActorCoordinator::PrintInternalState() {
313315
for (const auto& [topic, topicInfo] : TopicsInfo) {
314316
str << " " << topic.TopicName << " (" << topic.Endpoint << "), pending partitions: " << topicInfo.PendingPartitions.size() << "\n";
315317
}
318+
return str.Str();
319+
}
316320

317-
LOG_ROW_DISPATCHER_DEBUG(str.Str());
321+
void TActorCoordinator::PrintInternalState() {
322+
auto str = GetInternalState();
323+
auto buf = TStringBuf(str);
324+
for (ui64 offset = 0; offset < buf.size(); offset += PrintStateToLogSplitSize) {
325+
LOG_ROW_DISPATCHER_DEBUG(buf.SubString(offset, PrintStateToLogSplitSize));
326+
}
318327
}
319328

320329
void TActorCoordinator::HandleConnected(TEvInterconnect::TEvNodeConnected::TPtr& ev) {

0 commit comments

Comments
 (0)