@@ -1224,6 +1224,9 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
1224
1224
)" );
1225
1225
env.TestWaitNotification (runtime, txId);
1226
1226
1227
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex" ), {NLs::PathVersionEqual (2 )});
1228
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable" ), {NLs::PathVersionEqual (3 )});
1229
+
1227
1230
TestCreateCdcStream (runtime, ++txId, " /MyRoot/Table/UnknownIndex" , R"(
1228
1231
TableName: "indexImplTable"
1229
1232
StreamDescription {
@@ -1252,12 +1255,10 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
1252
1255
)" );
1253
1256
env.TestWaitNotification (runtime, txId);
1254
1257
1255
- TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream" ), {
1256
- NLs::PathExist,
1257
- });
1258
- TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream/streamImpl" ), {
1259
- NLs::PathExist,
1260
- });
1258
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex" ), {NLs::PathVersionEqual (3 )});
1259
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable" ), {NLs::PathVersionEqual (4 )});
1260
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream" ), {NLs::PathExist});
1261
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream/streamImpl" ), {NLs::PathExist});
1261
1262
1262
1263
TestAlterCdcStream (runtime, ++txId, " /MyRoot/Table/UnknownIndex" , R"(
1263
1264
TableName: "indexImplTable"
@@ -1272,6 +1273,8 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
1272
1273
)" );
1273
1274
env.TestWaitNotification (runtime, txId);
1274
1275
1276
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex" ), {NLs::PathVersionEqual (4 )});
1277
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable" ), {NLs::PathVersionEqual (5 )});
1275
1278
TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream" ), {
1276
1279
NLs::StreamState (NKikimrSchemeOp::ECdcStreamStateDisabled),
1277
1280
});
@@ -1287,12 +1290,62 @@ Y_UNIT_TEST_SUITE(TCdcStreamTests) {
1287
1290
)" );
1288
1291
env.TestWaitNotification (runtime, txId);
1289
1292
1290
- TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream" ), {
1291
- NLs::PathNotExist,
1292
- });
1293
- TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream/streamImpl" ), {
1294
- NLs::PathNotExist,
1293
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex" ), {NLs::PathVersionEqual (5 )});
1294
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable" ), {NLs::PathVersionEqual (6 )});
1295
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream" ), {NLs::PathNotExist});
1296
+ TestDescribeResult (DescribePrivatePath (runtime, " /MyRoot/Table/SyncIndex/indexImplTable/Stream/streamImpl" ), {NLs::PathNotExist});
1297
+ }
1298
+
1299
+ Y_UNIT_TEST (StreamOnBuildingIndexTable) {
1300
+ TTestBasicRuntime runtime;
1301
+ TTestEnv env (runtime, TTestEnvOptions ().EnableProtoSourceIdInfo (true ));
1302
+ ui64 txId = 100 ;
1303
+
1304
+ TestCreateTable (runtime, ++txId, " /MyRoot" , R"(
1305
+ Name: "Table"
1306
+ Columns { Name: "key" Type: "Uint64" }
1307
+ Columns { Name: "indexed" Type: "Uint64" }
1308
+ KeyColumnNames: ["key"]
1309
+ )" );
1310
+ env.TestWaitNotification (runtime, txId);
1311
+
1312
+ THolder<IEventHandle> blockedBuildIndexRequest;
1313
+ auto blockBuildIndexRequest = runtime.AddObserver <TEvDataShard::TEvBuildIndexCreateRequest>([&](auto & ev) {
1314
+ blockedBuildIndexRequest.Reset (ev.Release ());
1295
1315
});
1316
+
1317
+ AsyncBuildIndex (runtime, ++txId, TTestTxConfig::SchemeShard, " /MyRoot" , " /MyRoot/Table" , " Index" , {" indexed" });
1318
+ const auto buildIndexId = txId;
1319
+ {
1320
+ TDispatchOptions opts;
1321
+ opts.FinalEvents .emplace_back ([&blockedBuildIndexRequest](IEventHandle&) {
1322
+ return bool (blockedBuildIndexRequest);
1323
+ });
1324
+ runtime.DispatchEvents (opts);
1325
+ }
1326
+ blockBuildIndexRequest.Remove ();
1327
+
1328
+ TestCreateCdcStream (runtime, ++txId, " /MyRoot/Table/Index" , R"(
1329
+ TableName: "indexImplTable"
1330
+ StreamDescription {
1331
+ Name: "Stream"
1332
+ Mode: ECdcStreamModeKeysOnly
1333
+ Format: ECdcStreamFormatProto
1334
+ }
1335
+ )" , {NKikimrScheme::StatusMultipleModifications});
1336
+
1337
+ runtime.Send (blockedBuildIndexRequest.Release (), 0 , true );
1338
+ env.TestWaitNotification (runtime, buildIndexId);
1339
+
1340
+ TestCreateCdcStream (runtime, ++txId, " /MyRoot/Table/Index" , R"(
1341
+ TableName: "indexImplTable"
1342
+ StreamDescription {
1343
+ Name: "Stream"
1344
+ Mode: ECdcStreamModeKeysOnly
1345
+ Format: ECdcStreamFormatProto
1346
+ }
1347
+ )" );
1348
+ env.TestWaitNotification (runtime, txId);
1296
1349
}
1297
1350
1298
1351
Y_UNIT_TEST (DropIndexWithStream) {
0 commit comments