Skip to content

Commit 3a543ec

Browse files
authored
Merge 1712a96 into de5cc2a
2 parents de5cc2a + 1712a96 commit 3a543ec

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ydb/core/protos/feature_flags.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ message TFeatureFlags {
118118
optional bool SuppressCompatibilityCheck = 103 [default = false];
119119
optional bool EnableUniqConstraint = 104 [default = true];
120120
optional bool EnableChangefeedDebeziumJsonFormat = 105 [default = false];
121-
optional bool EnableStatistics = 106 [default = false];
121+
optional bool EnableStatistics = 106 [default = true];
122122
optional bool EnableUuidAsPrimaryKey = 107 [default = true];
123123
optional bool EnableTablePgTypes = 108 [default = false];
124124
optional bool EnableLocalDBBtreeIndex = 109 [default = false];

ydb/core/statistics/stat_service.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
298298
request.StatType = ev->Get()->StatType;
299299
request.StatRequests.swap(ev->Get()->StatRequests);
300300

301-
if (!EnableStatistics) {
301+
if (!EnableStatistics || IsStatisticsDisabledInSA) {
302302
ReplyFailed(requestId, true);
303303
return;
304304
}
@@ -463,6 +463,8 @@ class TStatService : public TActorBootstrapped<TStatService> {
463463

464464
Send(ev->Sender, new TEvStatistics::TEvPropagateStatisticsResponse);
465465

466+
IsStatisticsDisabledInSA = false;
467+
466468
auto* record = ev->Get()->MutableRecord();
467469
for (const auto& entry : record->GetEntries()) {
468470
ui64 schemeShardId = entry.GetSchemeShardId();
@@ -547,6 +549,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
547549
<< ", status = " << ev->Get()->Status);
548550

549551
if (ev->Get()->Status != NKikimrProto::OK) {
552+
IsStatisticsDisabledInSA = false;
550553
SAPipeClientId = TActorId();
551554
ConnectToSA();
552555
SyncNode();
@@ -560,12 +563,14 @@ class TStatService : public TActorBootstrapped<TStatService> {
560563
<< ", client id = " << ev->Get()->ClientId
561564
<< ", server id = " << ev->Get()->ServerId);
562565

566+
IsStatisticsDisabledInSA = false;
563567
SAPipeClientId = TActorId();
564568
ConnectToSA();
565569
SyncNode();
566570
}
567571

568572
void Handle(TEvStatistics::TEvStatisticsIsDisabled::TPtr&) {
573+
IsStatisticsDisabledInSA = true;
569574
ReplyAllFailed();
570575
}
571576

@@ -839,6 +844,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
839844
private:
840845
bool EnableStatistics = false;
841846
bool EnableColumnStatistics = false;
847+
bool IsStatisticsDisabledInSA = false;
842848

843849
static constexpr size_t StatFanOut = 10;
844850

0 commit comments

Comments
 (0)