Skip to content

fix potential GetStatistics hanging during rolling update; enable statistics by default #9973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/protos/feature_flags.proto
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ message TFeatureFlags {
optional bool SuppressCompatibilityCheck = 103 [default = false];
optional bool EnableUniqConstraint = 104 [default = true];
optional bool EnableChangefeedDebeziumJsonFormat = 105 [default = false];
optional bool EnableStatistics = 106 [default = false];
optional bool EnableStatistics = 106 [default = true];
optional bool EnableUuidAsPrimaryKey = 107 [default = true];
optional bool EnableTablePgTypes = 108 [default = false];
optional bool EnableLocalDBBtreeIndex = 109 [default = false];
Expand Down
8 changes: 7 additions & 1 deletion ydb/core/statistics/stat_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
request.StatType = ev->Get()->StatType;
request.StatRequests.swap(ev->Get()->StatRequests);

if (!EnableStatistics) {
if (!EnableStatistics || IsStatisticsDisabledInSA) {
ReplyFailed(requestId, true);
return;
}
Expand Down Expand Up @@ -463,6 +463,8 @@ class TStatService : public TActorBootstrapped<TStatService> {

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

IsStatisticsDisabledInSA = false;

auto* record = ev->Get()->MutableRecord();
for (const auto& entry : record->GetEntries()) {
ui64 schemeShardId = entry.GetSchemeShardId();
Expand Down Expand Up @@ -547,6 +549,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
<< ", status = " << ev->Get()->Status);

if (ev->Get()->Status != NKikimrProto::OK) {
IsStatisticsDisabledInSA = false;
SAPipeClientId = TActorId();
ConnectToSA();
SyncNode();
Expand All @@ -560,12 +563,14 @@ class TStatService : public TActorBootstrapped<TStatService> {
<< ", client id = " << ev->Get()->ClientId
<< ", server id = " << ev->Get()->ServerId);

IsStatisticsDisabledInSA = false;
SAPipeClientId = TActorId();
ConnectToSA();
SyncNode();
}

void Handle(TEvStatistics::TEvStatisticsIsDisabled::TPtr&) {
IsStatisticsDisabledInSA = true;
ReplyAllFailed();
}

Expand Down Expand Up @@ -839,6 +844,7 @@ class TStatService : public TActorBootstrapped<TStatService> {
private:
bool EnableStatistics = false;
bool EnableColumnStatistics = false;
bool IsStatisticsDisabledInSA = false;

static constexpr size_t StatFanOut = 10;

Expand Down
Loading