@@ -298,7 +298,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
298
298
request.StatType = ev->Get ()->StatType ;
299
299
request.StatRequests .swap (ev->Get ()->StatRequests );
300
300
301
- if (!EnableStatistics) {
301
+ if (!EnableStatistics || IsStatisticsDisabledInSA ) {
302
302
ReplyFailed (requestId, true );
303
303
return ;
304
304
}
@@ -463,6 +463,8 @@ class TStatService : public TActorBootstrapped<TStatService> {
463
463
464
464
Send (ev->Sender , new TEvStatistics::TEvPropagateStatisticsResponse);
465
465
466
+ IsStatisticsDisabledInSA = false ;
467
+
466
468
auto * record = ev->Get ()->MutableRecord ();
467
469
for (const auto & entry : record->GetEntries ()) {
468
470
ui64 schemeShardId = entry.GetSchemeShardId ();
@@ -547,6 +549,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
547
549
<< " , status = " << ev->Get ()->Status );
548
550
549
551
if (ev->Get ()->Status != NKikimrProto::OK) {
552
+ IsStatisticsDisabledInSA = false ;
550
553
SAPipeClientId = TActorId ();
551
554
ConnectToSA ();
552
555
SyncNode ();
@@ -560,12 +563,14 @@ class TStatService : public TActorBootstrapped<TStatService> {
560
563
<< " , client id = " << ev->Get ()->ClientId
561
564
<< " , server id = " << ev->Get ()->ServerId );
562
565
566
+ IsStatisticsDisabledInSA = false ;
563
567
SAPipeClientId = TActorId ();
564
568
ConnectToSA ();
565
569
SyncNode ();
566
570
}
567
571
568
572
void Handle (TEvStatistics::TEvStatisticsIsDisabled::TPtr&) {
573
+ IsStatisticsDisabledInSA = true ;
569
574
ReplyAllFailed ();
570
575
}
571
576
@@ -839,6 +844,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
839
844
private:
840
845
bool EnableStatistics = false ;
841
846
bool EnableColumnStatistics = false ;
847
+ bool IsStatisticsDisabledInSA = false ;
842
848
843
849
static constexpr size_t StatFanOut = 10 ;
844
850
0 commit comments