Skip to content

Commit 3c63951

Browse files
authored
feat: add indexes support for incremental backup (#28051)
1 parent 18944d3 commit 3c63951

17 files changed

+1433
-12
lines changed

ydb/core/kqp/host/kqp_gateway_proxy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,8 @@ class TKqpGatewayProxy : public IKikimrGateway {
13681368
op.SetPrefix(settings.Prefix);
13691369

13701370
if (settings.Settings.IncrementalBackupEnabled) {
1371-
op.MutableIncrementalBackupConfig();
1371+
auto* config = op.MutableIncrementalBackupConfig();
1372+
config->SetOmitIndexes(settings.Settings.OmitIndexes);
13721373
}
13731374

13741375
auto errOpt = std::visit(

ydb/core/kqp/provider/yql_kikimr_exec.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,13 @@ namespace {
10211021
"INCREMENTAL_BACKUP_ENABLED must be true or false"));
10221022
return false;
10231023
}
1024+
} else if (name == "omit_indexes") {
1025+
auto value = ToString(setting.Value().Cast<TCoDataCtor>().Literal().Cast<TCoAtom>().Value());
1026+
if (!TryFromString(value, dstSettings.OmitIndexes)) {
1027+
ctx.AddError(TIssue(ctx.GetPosition(pos),
1028+
"OMIT_INDEXES must be true or false"));
1029+
return false;
1030+
}
10241031
} else if (name == "storage") {
10251032
auto value = ToString(setting.Value().Cast<TCoDataCtor>().Literal().Cast<TCoAtom>().Value());
10261033
if (to_lower(value) != "cluster") {

ydb/core/kqp/provider/yql_kikimr_gateway.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,8 @@ struct TAnalyzeSettings {
10561056
};
10571057

10581058
struct TBackupCollectionSettings {
1059-
bool IncrementalBackupEnabled;
1059+
bool IncrementalBackupEnabled = false;
1060+
bool OmitIndexes = false;
10601061
};
10611062

10621063
struct TCreateBackupCollectionSettings {

ydb/core/kqp/provider/yql_kikimr_type_ann.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,7 @@ virtual TStatus HandleCreateTable(TKiCreateTable create, TExprContext& ctx) over
24482448
const THashSet<TString> supportedSettings = {
24492449
"incremental_backup_enabled",
24502450
"storage",
2451+
"omit_indexes",
24512452
};
24522453

24532454
if (!CheckBackupCollectionSettings(node.BackupCollectionSettings(), supportedSettings, ctx)) {

ydb/core/protos/flat_scheme_op.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@ message TBackupCollectionDescription {
23122312
}
23132313

23142314
message TIncrementalBackupConfig {
2315-
2315+
optional bool OmitIndexes = 1 [default = false];
23162316
}
23172317

23182318
oneof Entries {

0 commit comments

Comments
 (0)