Skip to content

Commit

Permalink
cheery pick ydb commit to fix problem with unconditional configs load…
Browse files Browse the repository at this point in the history
…ing (#2192)
  • Loading branch information
yegorskii authored Oct 1, 2024
1 parent 7dbbbc0 commit a66f80f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions contrib/ydb/core/cms/console/configs_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ void TConfigsDispatcher::Handle(TEvConsole::TEvConfigSubscriptionNotification::T
if (subscription->Yaml && YamlConfigEnabled) {
ReplaceConfigItems(YamlProtoConfig, trunc, FilterKinds(subscription->Kinds), BaseConfig);
} else {
Y_FOR_EACH_BIT(kind, kinds) {
Y_FOR_EACH_BIT(kind, FilterKinds(kinds)) {
if (affectedKinds.contains(kind)) {
hasAffectedKinds = true;
}
Expand All @@ -785,15 +785,15 @@ void TConfigsDispatcher::Handle(TEvConsole::TEvConfigSubscriptionNotification::T
ReplaceConfigItems(ev->Get()->Record.GetConfig(), trunc, FilterKinds(kinds), BaseConfig);
}

if (hasAffectedKinds || !CompareConfigs(subscription->CurrentConfig.Config, trunc) || CurrentStateFunc() == &TThis::StateInit) {
if (hasAffectedKinds || !CompareConfigs(subscription->CurrentConfig.Config, trunc, FilterKinds(kinds)) || CurrentStateFunc() == &TThis::StateInit) {
subscription->UpdateInProcess = MakeHolder<TEvConsole::TEvConfigNotificationRequest>();
subscription->UpdateInProcess->Record.MutableConfig()->CopyFrom(trunc);
subscription->UpdateInProcess->Record.SetLocal(true);
Y_FOR_EACH_BIT(kind, kinds) {
Y_FOR_EACH_BIT(kind, FilterKinds(kinds)) {
subscription->UpdateInProcess->Record.AddItemKinds(kind);
}
subscription->UpdateInProcessCookie = ++NextRequestCookie;
subscription->UpdateInProcessConfigVersion = FilterVersion(ev->Get()->Record.GetConfig().GetVersion(), kinds);
subscription->UpdateInProcessConfigVersion = FilterVersion(ev->Get()->Record.GetConfig().GetVersion(), FilterKinds(kinds));

if (YamlConfigEnabled) {
UpdateYamlVersion(subscription);
Expand Down Expand Up @@ -890,6 +890,12 @@ void TConfigsDispatcher::Handle(TEvConfigsDispatcher::TEvSetConfigSubscriptionRe
"SetConfigSubscriptionRequest handler");
Y_UNUSED(nonYamlKinds);
auto kinds = KindsToBitMap(ev->Get()->ConfigItemKinds);

auto truncKinds = FilterKinds(kinds);
if (truncKinds.Empty() && !kinds.Empty()) {
return;
}

auto subscriberActor = ev->Get()->Subscriber ? ev->Get()->Subscriber : ev->Sender;

auto subscription = FindSubscription(kinds);
Expand Down

0 comments on commit a66f80f

Please sign in to comment.