@@ -430,6 +430,45 @@ Y_UNIT_TEST_SUITE(WithSDK) {
430
430
UNIT_ASSERT_VALUES_EQUAL (0 , getCommittedOffset (4 ));
431
431
}
432
432
}
433
+
434
+ Y_UNIT_TEST (Commit_ToNewChild_WithoutCommitToParent) {
435
+ TTopicSdkTestSetup setup = CreateSetup ();
436
+ setup.CreateTopicWithAutoscale ();
437
+
438
+ setup.Write (" message-0-0" , 0 );
439
+ setup.Write (" message-0-1" , 0 );
440
+ setup.Write (" message-0-2" , 0 );
441
+
442
+ auto getCommittedOffset = [&](size_t partition) {
443
+ auto desc = setup.DescribeConsumer ();
444
+ return desc.GetPartitions ().at (partition).GetPartitionConsumerStats ()->GetCommittedOffset ();
445
+ };
446
+
447
+ {
448
+ auto r = setup.Read (TEST_TOPIC, TEST_CONSUMER, [&](auto & x) {
449
+ for (auto & m: x.GetMessages ()) {
450
+ if (x.GetPartitionSession ()->GetPartitionId () == 0 && m.GetOffset () == 1 ) {
451
+ ui64 txId = 1006 ;
452
+ SplitPartition (setup, ++txId, 0 , " a" );
453
+
454
+ setup.Write (" message-1-0" , 1 );
455
+ setup.Write (" message-1-1" , 1 );
456
+ setup.Write (" message-1-2" , 1 );
457
+ } else if (x.GetPartitionSession ()->GetPartitionId () == 1 && m.GetOffset () == 0 ) {
458
+ m.Commit ();
459
+ }
460
+ }
461
+ return false ;
462
+ });
463
+
464
+ Sleep (TDuration::Seconds (2 ));
465
+
466
+ UNIT_ASSERT_VALUES_EQUAL (0 , getCommittedOffset (0 ));
467
+ UNIT_ASSERT_VALUES_EQUAL (0 , getCommittedOffset (1 ));
468
+ UNIT_ASSERT_VALUES_EQUAL (0 , getCommittedOffset (2 ));
469
+ }
470
+ }
471
+
433
472
}
434
473
435
474
} // namespace NKikimr
0 commit comments