diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index 466306d4991e..3e4c6859913f 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -3903,6 +3903,22 @@ Y_UNIT_TEST_SUITE(KqpScheme) { UNIT_ASSERT_VALUES_EQUAL(desc.GetTopicDescription().GetRetentionPeriod(), TDuration::Hours(1)); } + { // alter + auto query = R"( + --!syntax_v1 + ALTER TOPIC `/Root/table/feed_2` SET ( + RETENTION_PERIOD = Interval("PT2H") + ); + )"; + + const auto result = session.ExecuteSchemeQuery(query).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + + auto desc = pq.DescribeTopic("/Root/table/feed_2").ExtractValueSync(); + UNIT_ASSERT_C(desc.IsSuccess(), desc.GetIssues().ToString()); + UNIT_ASSERT_VALUES_EQUAL(desc.GetTopicDescription().GetRetentionPeriod(), TDuration::Hours(2)); + } + { // non-positive (invalid) auto query = R"( --!syntax_v1 diff --git a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp index 518740f0d9bf..2d06845d1759 100644 --- a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp +++ b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp @@ -1825,18 +1825,13 @@ Y_UNIT_TEST_SUITE(Cdc) { UNIT_ASSERT_VALUES_EQUAL(res.GetStatus(), NYdb::EStatus::BAD_REQUEST); } - // try to update retention period - { - auto res = client.AlterTopic("/Root/Table/Stream", NYdb::NTopic::TAlterTopicSettings() - .SetRetentionPeriod(TDuration::Hours(48))).ExtractValueSync(); - UNIT_ASSERT_VALUES_EQUAL(res.GetStatus(), NYdb::EStatus::BAD_REQUEST); - } // try to update supported codecs { auto res = client.AlterTopic("/Root/Table/Stream", NYdb::NTopic::TAlterTopicSettings() .AppendSetSupportedCodecs(NYdb::NTopic::ECodec(5))).ExtractValueSync(); UNIT_ASSERT_VALUES_EQUAL(res.GetStatus(), NYdb::EStatus::BAD_REQUEST); } + // try to update retention storage { auto res = client.AlterTopic("/Root/Table/Stream", NYdb::NTopic::TAlterTopicSettings() diff --git a/ydb/services/lib/actors/pq_schema_actor.cpp b/ydb/services/lib/actors/pq_schema_actor.cpp index af52ed00363a..12b046480b54 100644 --- a/ydb/services/lib/actors/pq_schema_actor.cpp +++ b/ydb/services/lib/actors/pq_schema_actor.cpp @@ -1314,7 +1314,6 @@ namespace NKikimr::NGRpcProxy::V1 { } if (request.has_set_retention_period()) { - CHECK_CDC; partConfig->SetLifetimeSeconds(request.set_retention_period().seconds()); }