aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ydb/core/blobstorage/base/blobstorage_console_events.h16
-rw-r--r--ydb/core/grpc_services/rpc_config.cpp4
-rw-r--r--ydb/core/grpc_services/rpc_config_base.h13
-rw-r--r--ydb/core/mind/bscontroller/bsc.cpp2
-rw-r--r--ydb/core/mind/bscontroller/commit_config.cpp16
-rw-r--r--ydb/core/mind/bscontroller/console_interaction.cpp72
-rw-r--r--ydb/core/mind/bscontroller/console_interaction.h6
-rw-r--r--ydb/core/mind/bscontroller/impl.h4
-rw-r--r--ydb/core/mind/bscontroller/load_everything.cpp17
-rw-r--r--ydb/core/mind/bscontroller/migrate.cpp12
-rw-r--r--ydb/core/mind/bscontroller/scheme.h3
-rw-r--r--ydb/core/protos/blobstorage.proto3
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_dynamic_config.cpp6
-rw-r--r--ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema6
14 files changed, 139 insertions, 41 deletions
diff --git a/ydb/core/blobstorage/base/blobstorage_console_events.h b/ydb/core/blobstorage/base/blobstorage_console_events.h
index fea8a4dd1e..eb6798f35d 100644
--- a/ydb/core/blobstorage/base/blobstorage_console_events.h
+++ b/ydb/core/blobstorage/base/blobstorage_console_events.h
@@ -77,14 +77,9 @@ namespace NKikimr {
NKikimrBlobStorage::TEvControllerReplaceConfigRequest, EvControllerReplaceConfigRequest> {
TEvControllerReplaceConfigRequest() = default;
- TEvControllerReplaceConfigRequest(
- std::optional<TString> clusterYaml,
- std::optional<TString> storageYaml,
- std::optional<bool> switchDedicatedStorageSection,
- bool dedicatedConfigMode,
- bool allowUnknownFields,
- bool bypassMetadataChecks) {
-
+ TEvControllerReplaceConfigRequest(std::optional<TString> clusterYaml, std::optional<TString> storageYaml,
+ std::optional<bool> switchDedicatedStorageSection, bool dedicatedConfigMode, bool allowUnknownFields,
+ bool bypassMetadataChecks, bool enableConfigV2, bool disableConfigV2) {
if (clusterYaml) {
Record.SetClusterYaml(*clusterYaml);
}
@@ -97,6 +92,11 @@ namespace NKikimr {
Record.SetDedicatedConfigMode(dedicatedConfigMode);
Record.SetAllowUnknownFields(allowUnknownFields);
Record.SetBypassMetadataChecks(bypassMetadataChecks);
+ if (enableConfigV2) {
+ Record.SetSwitchEnableConfigV2(true);
+ } else if (disableConfigV2) {
+ Record.SetSwitchEnableConfigV2(false);
+ }
}
TString ToString() const override {
diff --git a/ydb/core/grpc_services/rpc_config.cpp b/ydb/core/grpc_services/rpc_config.cpp
index 6ff65e193f..914356f3a7 100644
--- a/ydb/core/grpc_services/rpc_config.cpp
+++ b/ydb/core/grpc_services/rpc_config.cpp
@@ -232,7 +232,9 @@ public:
shim.SwitchDedicatedStorageSection,
shim.DedicatedConfigMode,
request->allow_unknown_fields() || request->bypass_checks(),
- request->bypass_checks());
+ request->bypass_checks(),
+ false /* TODO: implement */,
+ false /* TODO: implement */);
}
private:
diff --git a/ydb/core/grpc_services/rpc_config_base.h b/ydb/core/grpc_services/rpc_config_base.h
index e6ce4d6706..b72e83a244 100644
--- a/ydb/core/grpc_services/rpc_config_base.h
+++ b/ydb/core/grpc_services/rpc_config_base.h
@@ -284,6 +284,14 @@ protected:
if constexpr (std::is_same_v<TResultRecord, Ydb::Config::FetchConfigResult>) {
TResultRecord result;
const auto& record = ev->Get()->Record;
+ if (record.HasErrorReason()) {
+ const auto status = record.GetDisabledConfigV2()
+ ? Ydb::StatusIds::UNSUPPORTED
+ : Ydb::StatusIds::INTERNAL_ERROR;
+ self->Reply(status, TStringBuilder() << "failed to fetch config: " << record.GetErrorReason(),
+ NKikimrIssues::TIssuesIds::DEFAULT_ERROR, self->ActorContext());
+ return;
+ }
if (record.HasClusterYaml()) {
auto conf = ev->Get()->Record.GetClusterYaml();
auto metadata = NYamlConfig::GetMainMetadata(conf);
@@ -327,7 +335,10 @@ protected:
TResultRecord result;
self->ReplyWithResult(Ydb::StatusIds::SUCCESS, result, self->ActorContext());
} else {
- self->Reply(Ydb::StatusIds::INTERNAL_ERROR, TStringBuilder() << "failed to replace configuration: "
+ const auto status = record.GetDisabledConfigV2()
+ ? Ydb::StatusIds::UNSUPPORTED
+ : Ydb::StatusIds::INTERNAL_ERROR;
+ self->Reply(status, TStringBuilder() << "failed to replace configuration: "
<< NKikimrBlobStorage::TEvControllerReplaceConfigResponse::EStatus_Name(record.GetStatus())
<< ": " << record.GetErrorReason(), NKikimrIssues::TIssuesIds::DEFAULT_ERROR, self->ActorContext());
}
diff --git a/ydb/core/mind/bscontroller/bsc.cpp b/ydb/core/mind/bscontroller/bsc.cpp
index 0a5e2e58fe..3ab5cdc7b1 100644
--- a/ydb/core/mind/bscontroller/bsc.cpp
+++ b/ydb/core/mind/bscontroller/bsc.cpp
@@ -463,7 +463,7 @@ void TBlobStorageController::Handle(TEvBlobStorage::TEvControllerDistconfRequest
// commit it
Execute(CreateTxCommitConfig(std::move(yamlConfig), std::make_optional(std::move(storageYaml)), std::nullopt,
- expectedStorageYamlConfigVersion, std::exchange(h, {})));
+ expectedStorageYamlConfigVersion, std::exchange(h, {}), std::nullopt));
break;
}
diff --git a/ydb/core/mind/bscontroller/commit_config.cpp b/ydb/core/mind/bscontroller/commit_config.cpp
index 6eae3ac61e..fca8960d51 100644
--- a/ydb/core/mind/bscontroller/commit_config.cpp
+++ b/ydb/core/mind/bscontroller/commit_config.cpp
@@ -15,6 +15,7 @@ namespace NKikimr::NBsController {
std::optional<NKikimrBlobStorage::TStorageConfig> StorageConfig;
std::optional<ui64> ExpectedStorageYamlConfigVersion;
std::unique_ptr<IEventHandle> Handle;
+ std::optional<bool> SwitchEnableConfigV2;
ui64 GenerationOnStart = 0;
TString FingerprintOnStart;
@@ -23,13 +24,15 @@ namespace NKikimr::NBsController {
TTxCommitConfig(TBlobStorageController *controller, std::optional<TYamlConfig>&& yamlConfig,
std::optional<std::optional<TString>>&& storageYamlConfig,
std::optional<NKikimrBlobStorage::TStorageConfig>&& storageConfig,
- std::optional<ui64> expectedStorageYamlConfigVersion, std::unique_ptr<IEventHandle> handle)
+ std::optional<ui64> expectedStorageYamlConfigVersion, std::unique_ptr<IEventHandle> handle,
+ std::optional<bool> switchEnableConfigV2)
: TTransactionBase(controller)
, YamlConfig(std::move(yamlConfig))
, StorageYamlConfig(std::move(storageYamlConfig))
, StorageConfig(std::move(storageConfig))
, ExpectedStorageYamlConfigVersion(expectedStorageYamlConfigVersion)
, Handle(std::move(handle))
+ , SwitchEnableConfigV2(switchEnableConfigV2)
{}
TTxType GetTxType() const override { return NBlobStorageController::TXTYPE_COMMIT_CONFIG; }
@@ -53,6 +56,9 @@ namespace NKikimr::NBsController {
if (ExpectedStorageYamlConfigVersion) {
row.Update<Schema::State::ExpectedStorageYamlConfigVersion>(*ExpectedStorageYamlConfigVersion);
}
+ if (SwitchEnableConfigV2) {
+ row.Update<Schema::State::EnableConfigV2>(*SwitchEnableConfigV2);
+ }
return true;
}
@@ -104,6 +110,9 @@ namespace NKikimr::NBsController {
if (update && Self->StorageYamlConfig) {
update->SetStorageConfigVersion(NYamlConfig::GetStorageMetadata(*Self->StorageYamlConfig).Version.value_or(0));
}
+ if (SwitchEnableConfigV2) {
+ Self->EnableConfigV2 = *SwitchEnableConfigV2;
+ }
if (Handle) {
TActivationContext::Send(Handle.release());
@@ -126,9 +135,10 @@ namespace NKikimr::NBsController {
ITransaction* TBlobStorageController::CreateTxCommitConfig(std::optional<TYamlConfig>&& yamlConfig,
std::optional<std::optional<TString>>&& storageYamlConfig,
std::optional<NKikimrBlobStorage::TStorageConfig>&& storageConfig,
- std::optional<ui64> expectedStorageYamlConfigVersion, std::unique_ptr<IEventHandle> handle) {
+ std::optional<ui64> expectedStorageYamlConfigVersion, std::unique_ptr<IEventHandle> handle,
+ std::optional<bool> switchEnableConfigV2) {
return new TTxCommitConfig(this, std::move(yamlConfig), std::move(storageYamlConfig), std::move(storageConfig),
- expectedStorageYamlConfigVersion, std::move(handle));
+ expectedStorageYamlConfigVersion, std::move(handle), switchEnableConfigV2);
}
} // namespace NKikimr::NBsController
diff --git a/ydb/core/mind/bscontroller/console_interaction.cpp b/ydb/core/mind/bscontroller/console_interaction.cpp
index 84c2399d50..4e34916283 100644
--- a/ydb/core/mind/bscontroller/console_interaction.cpp
+++ b/ydb/core/mind/bscontroller/console_interaction.cpp
@@ -75,6 +75,10 @@ namespace NKikimr::NBsController {
auto& record = ev->Get()->Record;
STLOG(PRI_DEBUG, BS_CONTROLLER, BSC19, "Console proposed config response", (Response, record));
+ if (!Self.EnableConfigV2 && !PendingReplaceRequest) {
+ return;
+ }
+
auto overwriteConfig = [&] {
TString yamlReturnedByFetch = record.GetYAML();
if (!yamlReturnedByFetch) {
@@ -101,7 +105,7 @@ namespace NKikimr::NBsController {
TYamlConfig yamlConfig(std::move(yaml), version, std::move(yamlReturnedByFetch));
Self.Execute(Self.CreateTxCommitConfig(std::move(yamlConfig), std::nullopt,
- std::move(storageConfig), std::nullopt, nullptr));
+ std::move(storageConfig), std::nullopt, nullptr, std::nullopt));
CommitInProgress = true;
}
} catch (const std::exception& ex) {
@@ -146,14 +150,17 @@ namespace NKikimr::NBsController {
break;
case NKikimrBlobStorage::TEvControllerProposeConfigResponse::ReverseCommit:
- if (!Self.YamlConfig && !Self.StorageYamlConfig) {
+ if (PendingReplaceRequest) {
+ ExpectedYamlConfigVersion.emplace(record.GetConsoleConfigVersion());
+ Handle(PendingReplaceRequest);
+ PendingReplaceRequest.Reset();
+ } else if (!Self.YamlConfig && !Self.StorageYamlConfig) {
overwriteConfig();
} else {
STLOG(PRI_CRIT, BS_CONTROLLER, BSC29, "ReverseCommit status received when BSC has YamlConfig/StorageYamlConfig",
(YamlConfig, Self.YamlConfig), (StorageYamlConfig, Self.StorageYamlConfig), (Record, record));
Y_DEBUG_ABORT();
}
-
break;
default:
@@ -217,10 +224,15 @@ namespace NKikimr::NBsController {
auto& record = ev->Get()->Record;
- if (!Working || CommitInProgress || ClientId) {
+ const bool reasonOngoingCommit = CommitInProgress || (ClientId && ClientId != ev->Sender);
+ if (reasonOngoingCommit || (!Self.EnableConfigV2 && !record.GetSwitchEnableConfigV2())) {
// reply to newly came query
const TActorId temp = std::exchange(ClientId, ev->Sender);
- IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::OngoingCommit, "ongoing commit");
+ if (reasonOngoingCommit) {
+ IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::OngoingCommit, "ongoing commit");
+ } else {
+ IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::InvalidRequest, "configuration v2 is disabled", true);
+ }
ClientId = temp;
return;
}
@@ -233,6 +245,34 @@ namespace NKikimr::NBsController {
"configuration is locked by distconf");
}
+ SwitchEnableConfigV2 = record.HasSwitchEnableConfigV2()
+ ? std::make_optional(record.GetSwitchEnableConfigV2())
+ : std::nullopt;
+
+ if (!Self.EnableConfigV2 && record.HasSwitchDedicatedStorageSection()) {
+ return IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::InvalidRequest,
+ "can't enable configuration v2 and switch dedicated storage section mode at the same time");
+ }
+
+ if (Self.EnableConfigV2 && SwitchEnableConfigV2 && !*SwitchEnableConfigV2 && Self.StorageYamlConfig) {
+ return IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::InvalidRequest,
+ "can't revert to configuration v1 with dedicated storage section enabled");
+ }
+
+ if (!Self.EnableConfigV2 && !PendingReplaceRequest) {
+ Y_ABORT_UNLESS(SwitchEnableConfigV2);
+ Y_ABORT_UNLESS(*SwitchEnableConfigV2);
+ if (!ConsolePipe) {
+ return IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::SessionClosed,
+ "connection to Console tablet terminated");
+ }
+
+ // just ask console for the latest config
+ NTabletPipe::SendData(Self.SelfId(), ConsolePipe, new TEvBlobStorage::TEvControllerProposeConfigRequest);
+ PendingReplaceRequest = std::move(ev);
+ return;
+ }
+
PendingStorageYamlConfig.reset();
if (Self.StorageYamlConfig.has_value()) { // separate configuration
@@ -290,9 +330,7 @@ namespace NKikimr::NBsController {
}
if (PendingYamlConfig) {
- const ui64 expected = Self.YamlConfig
- ? GetVersion(*Self.YamlConfig) + 1
- : 0;
+ const ui64 expected = ExpectedYamlConfigVersion.value_or(Self.YamlConfig ? GetVersion(*Self.YamlConfig) + 1 : 0);
if (!NYamlConfig::IsMainConfig(*PendingYamlConfig)) {
return IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::InvalidRequest,
@@ -342,7 +380,10 @@ namespace NKikimr::NBsController {
void TBlobStorageController::TConsoleInteraction::Handle(TEvBlobStorage::TEvControllerFetchConfigRequest::TPtr &ev) {
const auto& record = ev->Get()->Record;
auto response = std::make_unique<TEvBlobStorage::TEvControllerFetchConfigResponse>();
- if (!Self.ConfigLock.empty() || Self.SelfManagementEnabled) {
+ if (!Self.EnableConfigV2) {
+ response->Record.SetErrorReason("configuration v2 is disabled");
+ response->Record.SetDisabledConfigV2(true);
+ } else if (!Self.ConfigLock.empty() || Self.SelfManagementEnabled) {
response->Record.SetErrorReason("configuration is locked by distconf");
} else if (Self.StorageYamlConfig) {
if (record.GetDedicatedStorageSection()) {
@@ -455,7 +496,7 @@ namespace NKikimr::NBsController {
}
Self.Execute(Self.CreateTxCommitConfig(std::move(yamlConfig), std::exchange(PendingStorageYamlConfig, {}),
- std::move(storageConfig), expectedStorageYamlConfigVersion, nullptr));
+ std::move(storageConfig), expectedStorageYamlConfigVersion, nullptr, SwitchEnableConfigV2));
CommitInProgress = true;
PendingYamlConfig.reset();
} catch (const TExError& error) {
@@ -498,13 +539,20 @@ namespace NKikimr::NBsController {
}
void TBlobStorageController::TConsoleInteraction::IssueGRpcResponse(
- NKikimrBlobStorage::TEvControllerReplaceConfigResponse::EStatus status, std::optional<TString> errorReason) {
+ NKikimrBlobStorage::TEvControllerReplaceConfigResponse::EStatus status, std::optional<TString> errorReason,
+ bool disabledConfigV2) {
Y_ABORT_UNLESS(ClientId);
- Self.Send(ClientId, new TEvBlobStorage::TEvControllerReplaceConfigResponse(status, std::move(errorReason)));
+ auto resp = std::make_unique<TEvBlobStorage::TEvControllerReplaceConfigResponse>(status, std::move(errorReason));
+ if (disabledConfigV2) {
+ resp->Record.SetDisabledConfigV2(true);
+ }
+ Self.Send(ClientId, resp.release());
ClientId = {};
++ExpectedValidationTimeoutCookie; // spoil validation cookie as incoming GRPC request has expired
PendingYamlConfig.reset();
PendingStorageYamlConfig.reset();
+ ExpectedYamlConfigVersion.reset();
+ PendingReplaceRequest.Reset();
}
}
diff --git a/ydb/core/mind/bscontroller/console_interaction.h b/ydb/core/mind/bscontroller/console_interaction.h
index 5b4d6adbf0..03a0242575 100644
--- a/ydb/core/mind/bscontroller/console_interaction.h
+++ b/ydb/core/mind/bscontroller/console_interaction.h
@@ -47,18 +47,20 @@ namespace NKikimr::NBsController {
bool NeedRetrySession = false;
bool Working = false;
bool CommitInProgress = false;
+ std::optional<bool> SwitchEnableConfigV2;
+ TEvBlobStorage::TEvControllerReplaceConfigRequest::TPtr PendingReplaceRequest;
std::optional<TString> PendingYamlConfig;
bool AllowUnknownFields = false;
-
std::optional<std::optional<TString>> PendingStorageYamlConfig;
+ std::optional<ui64> ExpectedYamlConfigVersion;
void MakeCommitToConsole(TString& config, ui32 configVersion);
void MakeGetBlock();
void MakeRetrySession();
void IssueGRpcResponse(NKikimrBlobStorage::TEvControllerReplaceConfigResponse::EStatus status,
- std::optional<TString> errorReason = std::nullopt);
+ std::optional<TString> errorReason = std::nullopt, bool disabledConfigV2 = false);
};
}
diff --git a/ydb/core/mind/bscontroller/impl.h b/ydb/core/mind/bscontroller/impl.h
index 9dbca01e50..b102e601a4 100644
--- a/ydb/core/mind/bscontroller/impl.h
+++ b/ydb/core/mind/bscontroller/impl.h
@@ -1571,6 +1571,7 @@ private:
bool AllowMultipleRealmsOccupation = true;
bool StorageConfigObtained = false;
bool Loaded = false;
+ bool EnableConfigV2 = false;
std::shared_ptr<TControlWrapper> EnableSelfHealWithDegraded;
struct TLifetimeToken {};
@@ -1989,7 +1990,8 @@ private:
std::optional<std::optional<TString>>&& storageYamlConfig,
std::optional<NKikimrBlobStorage::TStorageConfig>&& storageConfig,
std::optional<ui64> expectedStorageYamlConfigVersion,
- std::unique_ptr<IEventHandle> handle);
+ std::unique_ptr<IEventHandle> handle,
+ std::optional<bool> switchEnableConfigV2);
struct TVDiskAvailabilityTiming {
TVSlotId VSlotId;
diff --git a/ydb/core/mind/bscontroller/load_everything.cpp b/ydb/core/mind/bscontroller/load_everything.cpp
index ef0b79e81d..4b032ea871 100644
--- a/ydb/core/mind/bscontroller/load_everything.cpp
+++ b/ydb/core/mind/bscontroller/load_everything.cpp
@@ -110,6 +110,7 @@ public:
if (state.HaveValue<T::ShredState>()) {
Self->ShredState.OnLoad(state.GetValue<T::ShredState>());
}
+ Self->EnableConfigV2 = state.GetValue<T::EnableConfigV2>();
}
}
@@ -473,14 +474,6 @@ public:
}
}
- // primitive garbage collection for obsolete metrics
- for (const auto& key : pdiskMetricsToDelete) {
- db.Table<Schema::PDiskMetrics>().Key(key).Delete();
- }
- for (const auto& key : vdiskMetricsToDelete) {
- db.Table<Schema::VDiskMetrics>().Key(key).Delete();
- }
-
// apply storage pool stats
std::unordered_map<TBoxStoragePoolId, ui64> allocatedSizeMap;
for (const auto& [vslotId, slot] : Self->VSlots) {
@@ -538,6 +531,14 @@ public:
});
}
+ // primitive garbage collection for obsolete metrics
+ for (const auto& key : pdiskMetricsToDelete) {
+ db.Table<Schema::PDiskMetrics>().Key(key).Delete();
+ }
+ for (const auto& key : vdiskMetricsToDelete) {
+ db.Table<Schema::VDiskMetrics>().Key(key).Delete();
+ }
+
return true;
}
diff --git a/ydb/core/mind/bscontroller/migrate.cpp b/ydb/core/mind/bscontroller/migrate.cpp
index 9c3fc52e7b..8dc26b40c3 100644
--- a/ydb/core/mind/bscontroller/migrate.cpp
+++ b/ydb/core/mind/bscontroller/migrate.cpp
@@ -171,6 +171,14 @@ class TBlobStorageController::TTxMigrate : public TTransactionBase<TBlobStorageC
}
};
+ class TTxUpdateEnableConfigV2 : public TTxBase {
+ public:
+ bool Execute(TTransactionContext& txc) override {
+ NIceDb::TNiceDb(txc.DB).Table<Schema::State>().Key(true).Update<Schema::State::EnableConfigV2>(true);
+ return true;
+ }
+ };
+
TDeque<THolder<TTxBase>> Queue;
public:
@@ -232,6 +240,10 @@ public:
Queue.emplace_back(new TTxUpdateCompatibilityInfo);
+ if (!hasInstanceId) {
+ Queue.emplace_back(new TTxUpdateEnableConfigV2);
+ }
+
return true;
}
diff --git a/ydb/core/mind/bscontroller/scheme.h b/ydb/core/mind/bscontroller/scheme.h
index 980bf8d868..a17a79e027 100644
--- a/ydb/core/mind/bscontroller/scheme.h
+++ b/ydb/core/mind/bscontroller/scheme.h
@@ -114,6 +114,7 @@ struct Schema : NIceDb::Schema {
struct ShredState : Column<26, NScheme::NTypeIds::String> {};
struct StorageYamlConfig : Column<27, NScheme::NTypeIds::String> {};
struct ExpectedStorageYamlConfigVersion : Column<28, NScheme::NTypeIds::Uint64> {};
+ struct EnableConfigV2 : Column<29, NScheme::NTypeIds::Bool> { static constexpr Type Default = false; };
using TKey = TableKey<FixedKey>;
using TColumns = TableColumns<FixedKey, NextGroupID, SchemaVersion, NextOperationLogIndex, DefaultMaxSlots,
@@ -121,7 +122,7 @@ struct Schema : NIceDb::Schema {
PDiskSpaceMarginPromille, GroupReserveMin, GroupReservePart, MaxScrubbedDisksAtOnce, PDiskSpaceColorBorder,
GroupLayoutSanitizer, NextVirtualGroupId, AllowMultipleRealmsOccupation, CompatibilityInfo,
UseSelfHealLocalPolicy, TryToRelocateBrokenDisksLocallyFirst, YamlConfig, ShredState, StorageYamlConfig,
- ExpectedStorageYamlConfigVersion>;
+ ExpectedStorageYamlConfigVersion, EnableConfigV2>;
};
struct VSlot : Table<5> {
diff --git a/ydb/core/protos/blobstorage.proto b/ydb/core/protos/blobstorage.proto
index d5dc6759ef..dcecae12f0 100644
--- a/ydb/core/protos/blobstorage.proto
+++ b/ydb/core/protos/blobstorage.proto
@@ -1448,6 +1448,7 @@ message TEvControllerReplaceConfigRequest {
optional bool SkipConsoleValidation = 5;
optional bool SwitchDedicatedStorageSection = 6;
optional bool DedicatedConfigMode = 7;
+ optional bool SwitchEnableConfigV2 = 10; // if set, overrides EnableConfigV2 field in BSC
// console flags
optional bool AllowUnknownFields = 8;
optional bool BypassMetadataChecks = 9;
@@ -1466,6 +1467,7 @@ message TEvControllerReplaceConfigResponse {
}
optional EStatus Status = 1;
optional string ErrorReason = 2;
+ optional bool DisabledConfigV2 = 3; // set along with InvalidRequest when Configuration V2 is disabled and BSC can't process this query
}
message TEvControllerValidateConfigRequest {
@@ -1510,6 +1512,7 @@ message TEvControllerFetchConfigResponse {
optional string ClusterYaml = 1;
optional string StorageYaml = 2;
optional string ErrorReason = 3;
+ optional bool DisabledConfigV2 = 4;
}
message TEvControllerDistconfRequest {
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_dynamic_config.cpp b/ydb/public/lib/ydb_cli/commands/ydb_dynamic_config.cpp
index c09f9f5da8..7c3d15259f 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_dynamic_config.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_dynamic_config.cpp
@@ -110,7 +110,7 @@ int TCommandConfigFetch::Run(TConfig& config) {
auto result = client.FetchAllConfigs(settings).GetValueSync();
// if the new Config API is not supported, fallback to the old DynamicConfig API
- if (result.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED) {
+ if (result.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED || result.GetStatus() == EStatus::UNSUPPORTED) {
auto client = NYdb::NDynamicConfig::TDynamicConfigClient(*driver);
auto result = client.GetConfig().GetValueSync();
NStatusHelpers::ThrowOnErrorOrPrintIssues(result);
@@ -212,7 +212,7 @@ void TCommandConfigReplace::Parse(TConfig& config) {
ythrow yexception() << "Must specify non-empty -f (--filename)";
}
- const auto configStr = Filename == "-" ? Cin.ReadAll() : TFileInput(Filename).ReadAll();
+ const auto configStr = Filename == "-" ? Cin.ReadAll() : TFileInput(Filename).ReadAll();
DynamicConfig = configStr;
@@ -244,7 +244,7 @@ int TCommandConfigReplace::Run(TConfig& config) {
auto status = client.ReplaceConfig(DynamicConfig, settings).GetValueSync();
- if (status.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED) {
+ if (status.GetStatus() == EStatus::CLIENT_CALL_UNIMPLEMENTED || status.GetStatus() == EStatus::UNSUPPORTED) {
Cerr << "Warning: Fallback to DynamicConfig API" << Endl;
auto client = NYdb::NDynamicConfig::TDynamicConfigClient(*driver);
diff --git a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
index e023551d51..1284d9021d 100644
--- a/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
+++ b/ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_bs_controller_/flat_bs_controller.schema
@@ -7,6 +7,11 @@
],
"ColumnsAdded": [
{
+ "ColumnId": 29,
+ "ColumnName": "EnableConfigV2",
+ "ColumnType": "Bool"
+ },
+ {
"ColumnId": 1,
"ColumnName": "FixedKey",
"ColumnType": "Bool"
@@ -141,6 +146,7 @@
"ColumnFamilies": {
"0": {
"Columns": [
+ 29,
1,
2,
4,