@@ -664,7 +664,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
664
664
request.StatType = ev->Get ()->StatType ;
665
665
request.StatRequests .swap (ev->Get ()->StatRequests );
666
666
667
- if (!EnableStatistics) {
667
+ if (!EnableStatistics || IsStatisticsDisabledInSA ) {
668
668
ReplyFailed (requestId, true );
669
669
return ;
670
670
}
@@ -842,6 +842,8 @@ class TStatService : public TActorBootstrapped<TStatService> {
842
842
843
843
Send (ev->Sender , new TEvStatistics::TEvPropagateStatisticsResponse);
844
844
845
+ IsStatisticsDisabledInSA = false ;
846
+
845
847
auto * record = ev->Get ()->MutableRecord ();
846
848
for (const auto & entry : record->GetEntries ()) {
847
849
ui64 schemeShardId = entry.GetSchemeShardId ();
@@ -994,6 +996,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
994
996
<< " , status = " << ev->Get ()->Status );
995
997
996
998
if (clientId == SAPipeClientId) {
999
+ IsStatisticsDisabledInSA = false ;
997
1000
if (ev->Get ()->Status != NKikimrProto::OK) {
998
1001
SAPipeClientId = TActorId ();
999
1002
ConnectToSA ();
@@ -1030,6 +1033,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
1030
1033
<< " , tablet id = " << tabletId);
1031
1034
1032
1035
if (clientId == SAPipeClientId) {
1036
+ IsStatisticsDisabledInSA = false ;
1033
1037
SAPipeClientId = TActorId ();
1034
1038
ConnectToSA ();
1035
1039
SyncNode ();
@@ -1049,6 +1053,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
1049
1053
}
1050
1054
1051
1055
void Handle (TEvStatistics::TEvStatisticsIsDisabled::TPtr&) {
1056
+ IsStatisticsDisabledInSA = true ;
1052
1057
ReplyAllFailed ();
1053
1058
}
1054
1059
@@ -1527,6 +1532,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
1527
1532
1528
1533
bool EnableStatistics = false ;
1529
1534
bool EnableColumnStatistics = false ;
1535
+ bool IsStatisticsDisabledInSA = false ;
1530
1536
1531
1537
static constexpr size_t StatFanOut = 10 ;
1532
1538
0 commit comments