diff options
author | ilnaz <ilnaz@ydb.tech> | 2022-07-08 17:18:29 +0300 |
---|---|---|
committer | ilnaz <ilnaz@ydb.tech> | 2022-07-08 17:18:29 +0300 |
commit | 7d6b089d38c2fe4d277a0cbf5cc7137e02e5dcbb (patch) | |
tree | 15400e6cfb2073c841085fe683a813f94a1bc1b6 | |
parent | e5eab3309e308a5713727c7f9c506b51b6d32af7 (diff) | |
download | ydb-7d6b089d38c2fe4d277a0cbf5cc7137e02e5dcbb.tar.gz |
Fix TMaybe initialization
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__init.cpp | 4 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/ut_cdc_stream.cpp | 33 |
2 files changed, 35 insertions, 2 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index d9801507d8..4622e908fd 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -2283,7 +2283,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { if (rowset.HaveValue<Schema::PersQueues::RangeBegin>()) { if (!pqInfo.KeyRange) { - pqInfo.KeyRange = {}; + pqInfo.KeyRange.ConstructInPlace(); } pqInfo.KeyRange->FromBound = rowset.GetValue<Schema::PersQueues::RangeBegin>(); @@ -2291,7 +2291,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { if (rowset.HaveValue<Schema::PersQueues::RangeEnd>()) { if (!pqInfo.KeyRange) { - pqInfo.KeyRange = {}; + pqInfo.KeyRange.ConstructInPlace(); } pqInfo.KeyRange->ToBound = rowset.GetValue<Schema::PersQueues::RangeEnd>(); diff --git a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp index ee7519f0e5..24a67186b9 100644 --- a/ydb/core/tx/schemeshard/ut_cdc_stream.cpp +++ b/ydb/core/tx/schemeshard/ut_cdc_stream.cpp @@ -569,4 +569,37 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) { } } + Y_UNIT_TEST(RebootSchemeShard) { + TTestBasicRuntime runtime; + TTestEnv env(runtime, TTestEnvOptions().EnableProtoSourceIdInfo(true)); + ui64 txId = 100; + + TestCreateTable(runtime, ++txId, "/MyRoot", R"( + Name: "Table" + Columns { Name: "key" Type: "Uint64" } + Columns { Name: "value" Type: "Uint64" } + KeyColumnNames: ["key"] + UniformPartitionsCount: 2 + )"); + env.TestWaitNotification(runtime, txId); + + TestCreateCdcStream(runtime, ++txId, "/MyRoot", R"( + TableName: "Table" + StreamDescription { + Name: "Stream" + Mode: ECdcStreamModeKeysOnly + Format: ECdcStreamFormatProto + } + )"); + env.TestWaitNotification(runtime, txId); + + RebootTablet(runtime, TTestTxConfig::SchemeShard, runtime.AllocateEdgeActor()); + + TestDropCdcStream(runtime, ++txId, "/MyRoot", R"( + TableName: "Table" + StreamName: "Stream" + )"); + env.TestWaitNotification(runtime, txId); + } + } // TCdcStreamTests |