diff options
author | snaury <snaury@ydb.tech> | 2023-01-17 12:32:12 +0300 |
---|---|---|
committer | snaury <snaury@ydb.tech> | 2023-01-17 12:32:12 +0300 |
commit | 25516d10609b216606c74865144b46ad15c1e54b (patch) | |
tree | 79f4496cac960bc2018236863040bc76cd8f43eb | |
parent | 851f4bde27aba22a2461a1c23a8960d1cee78069 (diff) | |
download | ydb-25516d10609b216606c74865144b46ad15c1e54b.tar.gz |
Include initial configs in merged runtime shared cache configuration
-rw-r--r-- | ydb/core/base/appdata.h | 1 | ||||
-rw-r--r-- | ydb/core/cms/console/shared_cache_configurator.cpp | 13 | ||||
-rw-r--r-- | ydb/core/driver_lib/run/run.cpp | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/ydb/core/base/appdata.h b/ydb/core/base/appdata.h index f7b64137e9..d71dbedd5e 100644 --- a/ydb/core/base/appdata.h +++ b/ydb/core/base/appdata.h @@ -141,6 +141,7 @@ struct TAppData { NKikimrConfig::TCompactionConfig CompactionConfig; NKikimrConfig::TDomainsConfig DomainsConfig; NKikimrConfig::TBootstrap BootstrapConfig; + std::optional<NKikimrSharedCache::TSharedCacheConfig> SharedCacheConfig; bool EnforceUserTokenRequirement = false; bool AllowHugeKeyValueDeletes = true; // delete when all clients limit deletes per request bool EnableKqpSpilling = false; diff --git a/ydb/core/cms/console/shared_cache_configurator.cpp b/ydb/core/cms/console/shared_cache_configurator.cpp index 7228b4d422..60f40191c2 100644 --- a/ydb/core/cms/console/shared_cache_configurator.cpp +++ b/ydb/core/cms/console/shared_cache_configurator.cpp @@ -2,6 +2,7 @@ #include "configs_dispatcher.h" #include "console.h" +#include <ydb/core/base/appdata.h> #include <ydb/core/tablet_flat/shared_sausagecache.h> #include <library/cpp/actors/core/actor_bootstrapped.h> @@ -32,12 +33,20 @@ public: LOG_INFO_S(ctx, NKikimrServices::CMS_CONFIGS, "TSharedCacheConfigurator: got new config: " << record.GetConfig().ShortDebugString()); + auto* appData = AppData(ctx); + NKikimrSharedCache::TSharedCacheConfig cfg; - if (record.GetConfig().HasBootstrapConfig() && record.GetConfig().GetBootstrapConfig().HasSharedCacheConfig()) { - cfg.MergeFrom(record.GetConfig().GetBootstrapConfig().GetSharedCacheConfig()); + if (record.GetConfig().HasBootstrapConfig()) { + if (record.GetConfig().GetBootstrapConfig().HasSharedCacheConfig()) { + cfg.MergeFrom(record.GetConfig().GetBootstrapConfig().GetSharedCacheConfig()); + } + } else if (appData->BootstrapConfig.HasSharedCacheConfig()) { + cfg.MergeFrom(appData->BootstrapConfig.GetSharedCacheConfig()); } if (record.GetConfig().HasSharedCacheConfig()) { cfg.MergeFrom(record.GetConfig().GetSharedCacheConfig()); + } else if (appData->SharedCacheConfig) { + cfg.MergeFrom(*appData->SharedCacheConfig); } ApplyConfig(std::move(cfg), ctx); diff --git a/ydb/core/driver_lib/run/run.cpp b/ydb/core/driver_lib/run/run.cpp index bf343a76a1..bb1bbfb197 100644 --- a/ydb/core/driver_lib/run/run.cpp +++ b/ydb/core/driver_lib/run/run.cpp @@ -1052,6 +1052,10 @@ void TKikimrRunner::InitializeAppData(const TKikimrRunConfig& runConfig) AppData->BootstrapConfig = runConfig.AppConfig.GetBootstrapConfig(); } + if (runConfig.AppConfig.HasSharedCacheConfig()) { + AppData->SharedCacheConfig = runConfig.AppConfig.GetSharedCacheConfig(); + } + // setup resource profiles AppData->ResourceProfiles = new TResourceProfiles; if (runConfig.AppConfig.GetBootstrapConfig().ResourceProfilesSize()) |