@@ -3253,6 +3253,41 @@ Y_UNIT_TEST_SUITE(THiveTest) {
3253
3253
}
3254
3254
}
3255
3255
3256
+ Y_UNIT_TEST (TestRestartsWithFollower) {
3257
+ static constexpr ui64 NUM_NODES = 3 ;
3258
+ TTestBasicRuntime runtime (NUM_NODES, false );
3259
+ Setup (runtime, true , 3 , [](TAppPrepare& app) {
3260
+ app.HiveConfig .SetMaxBootBatchSize (1 );
3261
+ });
3262
+ TVector<ui64> tabletIds;
3263
+ const ui64 hiveTablet = MakeDefaultHiveID ();
3264
+ const ui64 testerTablet = MakeTabletID (false , 1 );
3265
+ CreateTestBootstrapper (runtime, CreateTestTabletInfo (hiveTablet, TTabletTypes::Hive), &CreateDefaultHive);
3266
+ {
3267
+ TDispatchOptions options;
3268
+ options.FinalEvents .emplace_back (TEvLocal::EvSyncTablets, runtime.GetNodeCount ());
3269
+ runtime.DispatchEvents (options);
3270
+ }
3271
+ TTabletTypes::EType tabletType = TTabletTypes::Dummy;
3272
+ THolder<TEvHive::TEvCreateTablet> ev (new TEvHive::TEvCreateTablet (testerTablet, 100500 , tabletType, BINDED_CHANNELS));
3273
+ auto * followerGroup = ev->Record .AddFollowerGroups ();
3274
+ followerGroup->SetFollowerCount (3 );
3275
+ followerGroup->SetAllowLeaderPromotion (true );
3276
+ ui64 tabletId = SendCreateTestTablet (runtime, hiveTablet, testerTablet, std::move (ev), 0 , true );
3277
+ for (unsigned i = 1 ; i < 10 ; ++i) {
3278
+ auto nodeIdx = 1 + (i % 2 );
3279
+ Ctest << " Killing node " << nodeIdx << Endl;
3280
+ SendKillLocal (runtime, nodeIdx);
3281
+ MakeSureTabletIsUp (runtime, tabletId, 0 );
3282
+ CreateLocal (runtime, nodeIdx);
3283
+ }
3284
+ for (unsigned i = 0 ; i < NUM_NODES; ++i) {
3285
+ SendKillLocal (runtime, i);
3286
+ }
3287
+ CreateLocal (runtime, 0 );
3288
+ MakeSureTabletIsUp (runtime, tabletId, 0 );
3289
+ }
3290
+
3256
3291
Y_UNIT_TEST (TestStartTabletTwiceInARow) {
3257
3292
TTestBasicRuntime runtime (1 , false );
3258
3293
Setup (runtime, true );
0 commit comments