diff --git a/ydb/core/persqueue/ut/ut_with_sdk/autoscaling_ut.cpp b/ydb/core/persqueue/ut/ut_with_sdk/autoscaling_ut.cpp index e8dc6c2a3de7..3e95062691c1 100644 --- a/ydb/core/persqueue/ut/ut_with_sdk/autoscaling_ut.cpp +++ b/ydb/core/persqueue/ut/ut_with_sdk/autoscaling_ut.cpp @@ -948,6 +948,42 @@ Y_UNIT_TEST_SUITE(TopicAutoscaling) { } } + Y_UNIT_TEST(DisableCDC) { + TTopicSdkTestSetup setup = CreateSetup(); + auto client = setup.MakeClient(); + auto tableClient = setup.MakeTableClient(); + auto session = tableClient.CreateSession().GetValueSync().GetSession(); + + ExecuteQuery(session, R"( + --!syntax_v1 + CREATE TABLE `/Root/tbl` ( + `Id` UInt64, + `Value` Utf8, + PRIMARY KEY (`Id`) + ); + )"); + + ExecuteQuery(session, R"( + --!syntax_v1 + ALTER TABLE `/Root/tbl` + ADD CHANGEFEED `Feed` + WITH ( + MODE = 'KEYS_ONLY', FORMAT = 'JSON' + ); + )"); + + TAlterTopicSettings alterSettings; + alterSettings + .BeginAlterPartitioningSettings() + .BeginAlterAutoPartitioningSettings() + .Strategy(EAutoPartitioningStrategy::ScaleUp) + .EndAlterAutoPartitioningSettings() + .EndAlterTopicPartitioningSettings(); + + auto result = client.AlterTopic("/Root/tbl/Feed", alterSettings).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), NYdb::EStatus::BAD_REQUEST); + } + Y_UNIT_TEST(MidOfRange) { auto AsString = [](std::vector vs) { TStringBuilder a; diff --git a/ydb/services/lib/actors/pq_schema_actor.cpp b/ydb/services/lib/actors/pq_schema_actor.cpp index 8d598ca13cad..9c56c3adafde 100644 --- a/ydb/services/lib/actors/pq_schema_actor.cpp +++ b/ydb/services/lib/actors/pq_schema_actor.cpp @@ -1335,6 +1335,10 @@ namespace NKikimr::NGRpcProxy::V1 { if (needHandleAutoPartitioning) { auto code = ValidatePartitionStrategy(*pqTabletConfig, error); if (code) return code->YdbCode; + + if (pqTabletConfig->GetPartitionStrategy().GetPartitionStrategyType() != ::NKikimrPQ::TPQTabletConfig_TPartitionStrategyType::TPQTabletConfig_TPartitionStrategyType_DISABLED) { + CHECK_CDC; + } } if (request.alter_attributes().size()) {