aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2022-07-21 14:14:34 +0300
committerilnaz <ilnaz@ydb.tech>2022-07-21 14:14:34 +0300
commit288258a70a724752fbc8d41b996fcb58b36e2c08 (patch)
tree8f0768c6cd1ef829a17ecd077a8a1d2a2b244a9f
parent6279fb7ef04b74e0f581dec0bdbd4311d6d0b921 (diff)
downloadydb-288258a70a724752fbc8d41b996fcb58b36e2c08.tar.gz
Check that proto source id info is enabled
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp5
-rw-r--r--ydb/core/tx/schemeshard/ut_cdc_stream.cpp23
2 files changed, 28 insertions, 0 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
index 49d5747c94d..38c8862cd6b 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp
@@ -607,6 +607,11 @@ TVector<ISubOperationBase::TPtr> CreateNewCdcStream(TOperationId opId, const TTx
<< ", intention to create new children: " << aliveStreams + 1)};
}
+ if (!AppData()->PQConfig.GetEnableProtoSourceIdInfo()) {
+ return {CreateReject(opId, NKikimrScheme::EStatus::StatusPreconditionFailed, TStringBuilder()
+ << "Changefeeds require proto source id info to be enabled")};
+ }
+
TString errStr;
if (!context.SS->CheckApplyIf(tx, errStr)) {
return {CreateReject(opId, NKikimrScheme::StatusPreconditionFailed, errStr)};
diff --git a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
index 24a67186b9b..008fd2b7bb7 100644
--- a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
+++ b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp
@@ -143,6 +143,29 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
)", {NKikimrScheme::StatusNameConflict});
}
+ Y_UNIT_TEST(DisableProtoSourceIdInfo) {
+ TTestBasicRuntime runtime;
+ TTestEnv env(runtime, TTestEnvOptions().EnableProtoSourceIdInfo(false));
+ ui64 txId = 100;
+
+ TestCreateTable(runtime, ++txId, "/MyRoot", R"(
+ Name: "Table"
+ Columns { Name: "key" Type: "Uint64" }
+ Columns { Name: "value" Type: "Uint64" }
+ KeyColumnNames: ["key"]
+ )");
+ env.TestWaitNotification(runtime, txId);
+
+ TestCreateCdcStream(runtime, ++txId, "/MyRoot", R"(
+ TableName: "Table"
+ StreamDescription {
+ Name: "Stream"
+ Mode: ECdcStreamModeKeysOnly
+ Format: ECdcStreamFormatProto
+ }
+ )", {NKikimrScheme::StatusPreconditionFailed});
+ }
+
Y_UNIT_TEST(CreateStream) {
TTestBasicRuntime runtime;
TTestEnv env(runtime, TTestEnvOptions().EnableProtoSourceIdInfo(true));