From 488ecae0c7deb9df307143755cf4b4c514c0539a Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Thu, 21 Mar 2024 02:42:30 +0300 Subject: [PATCH] Add test with reboot --- .../ut_sequence_reboots.cpp | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/ydb/core/tx/schemeshard/ut_sequence_reboots/ut_sequence_reboots.cpp b/ydb/core/tx/schemeshard/ut_sequence_reboots/ut_sequence_reboots.cpp index d0553d6ad40e..9b00fd70faa1 100644 --- a/ydb/core/tx/schemeshard/ut_sequence_reboots/ut_sequence_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_sequence_reboots/ut_sequence_reboots.cpp @@ -180,4 +180,48 @@ Y_UNIT_TEST_SUITE(TSequenceReboots) { }); } + Y_UNIT_TEST(CopyTableWithSequence) { + TTestWithReboots t(false); + t.Run([&](TTestActorRuntime& runtime, bool& activeZone) { + runtime.SetLogPriority(NKikimrServices::FLAT_TX_SCHEMESHARD, NActors::NLog::PRI_TRACE); + runtime.SetLogPriority(NKikimrServices::SEQUENCESHARD, NActors::NLog::PRI_TRACE); + + { + TInactiveZone inactive(activeZone); + // no inactive initialization + } + + t.TestEnv->ReliablePropose(runtime, + CreateIndexedTableRequest(++t.TxId, "/MyRoot", R"( + TableDescription { + Name: "Table" + Columns { Name: "key" Type: "Uint64" DefaultFromSequence: "myseq" } + Columns { Name: "value" Type: "Utf8" } + KeyColumnNames: ["key"] + } + IndexDescription { + Name: "ValueIndex" + KeyColumnNames: ["value"] + } + SequenceDescription { + Name: "myseq" + } + )"), + {NKikimrScheme::StatusAccepted, NKikimrScheme::StatusAlreadyExists, NKikimrScheme::StatusMultipleModifications}); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + + t.TestEnv->ReliablePropose(runtime, CopyTableRequest(++t.TxId, "/MyRoot", "copy", "/MyRoot/Table"), + {NKikimrScheme::StatusAccepted, NKikimrScheme::StatusAlreadyExists, + NKikimrScheme::StatusMultipleModifications}); + t.TestEnv->TestWaitNotification(runtime, t.TxId); + + TestLs(runtime, "/MyRoot/copy/myseq", TDescribeOptionsBuilder().SetShowPrivateTable(true), NLs::PathExist); + + { + TInactiveZone inactive(activeZone); + // no inactive finalization + } + }); + } + } // Y_UNIT_TEST_SUITE(TSequenceReboots)