Skip to content

Commit 093e5d7

Browse files
committed
Add per database configs (#14173)
1 parent 38b8ada commit 093e5d7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/api/protos/draft/ydb_dynamic_config.proto

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ import "src/api/protos/ydb_operation.proto";
99
message ConfigIdentity {
1010
// Current main config version
1111
uint64 version = 1;
12-
// Cluster name (should be set on node with console tablet, unknown by default)
13-
string cluster = 2;
12+
oneof type {
13+
// Cluster name (should be set on node with console tablet, unknown by default)
14+
string cluster = 2;
15+
// database name
16+
string database = 3;
17+
}
1418
}
1519

1620
message SetConfigRequest {
@@ -19,6 +23,7 @@ message SetConfigRequest {
1923
string config = 2;
2024
bool dry_run = 3;
2125
bool allow_unknown_fields = 4;
26+
bool allow_absent_database = 5;
2227
}
2328

2429
message SetConfigResponse {
@@ -31,6 +36,7 @@ message ReplaceConfigRequest {
3136
string config = 2;
3237
bool dry_run = 3;
3338
bool allow_unknown_fields = 4;
39+
bool allow_absent_database = 5;
3440
}
3541

3642
message ReplaceConfigResponse {
@@ -74,12 +80,12 @@ message GetConfigResponse {
7480
}
7581

7682
message GetConfigResult {
77-
// Main dynamic config with metadata in YAML format
78-
string config = 1;
83+
// Main/database dynamic config with metadata in YAML format
84+
repeated string config = 1;
7985
// All volatile configs
8086
repeated VolatileConfig volatile_configs = 2;
8187

82-
ConfigIdentity identity = 3;
88+
repeated ConfigIdentity identity = 3;
8389
}
8490

8591
message VolatileConfigMetadata {

src/client/draft/ydb_dynamic_config.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ class TDynamicConfigClient::TImpl : public TClientImplCommon<TDynamicConfigClien
156156
std::string config;
157157
std::map<uint64_t, std::string> volatileConfigs;
158158
if (Ydb::DynamicConfig::GetConfigResult result; any && any->UnpackTo(&result)) {
159-
clusterName = result.identity().cluster();
160-
version = result.identity().version();
161-
config = result.config();
159+
clusterName = result.identity(0).cluster();
160+
version = result.identity(0).version();
161+
config = result.config(0);
162162
for (const auto& config : result.volatile_configs()) {
163163
volatileConfigs.emplace(config.id(), config.config());
164164
}

0 commit comments

Comments
 (0)