@@ -605,6 +605,11 @@ class TTxLoadEverything : public TTransactionBase<THive> {
605
605
followerGroup.LocalNodeOnly = tabletFollowerGroupRowset.GetValueOrDefault <Schema::TabletFollowerGroup::LocalNodeOnly>();
606
606
followerGroup.FollowerCountPerDataCenter = tabletFollowerGroupRowset.GetValueOrDefault <Schema::TabletFollowerGroup::FollowerCountPerDataCenter>();
607
607
followerGroup.RequireDifferentNodes = tabletFollowerGroupRowset.GetValueOrDefault <Schema::TabletFollowerGroup::RequireDifferentNodes>();
608
+
609
+ if (followerGroup.RequireAllDataCenters && !followerGroup.FollowerCountPerDataCenter ) {
610
+ followerGroup.FollowerCountPerDataCenter = true ;
611
+ followerGroup.FollowerCount = (followerGroup.FollowerCount - 1 ) / Self.DataCenters .size () + 1 ;
612
+ }
608
613
} else {
609
614
++numMissingTablets;
610
615
}
@@ -665,8 +670,10 @@ class TTxLoadEverything : public TTransactionBase<THive> {
665
670
continue ;
666
671
}
667
672
std::map<TDataCenterId, i32> dataCentersToCover; // dc -> need x more followers in dc
668
- for (const auto & [dc, _] : Self->DataCenters ) {
669
- dataCentersToCover[dc] = group.GetFollowerCountForDataCenter (dc);
673
+ for (const auto & [dcId, dcInfo] : Self->DataCenters ) {
674
+ if (dcInfo.IsRegistered ()) {
675
+ dataCentersToCover[dcId] = group.GetFollowerCountForDataCenter (dcId);
676
+ }
670
677
}
671
678
auto groupId = group.Id ;
672
679
auto filterGroup = [groupId](auto && follower) { return follower->FollowerGroup .Id == groupId;};
@@ -876,6 +883,12 @@ class TTxLoadEverything : public TTransactionBase<THive> {
876
883
Self->ProcessFollowerUpdatesScheduled = true ;
877
884
}
878
885
886
+ for (const auto & [dcId, dcInfo] : Self->DataCenters ) {
887
+ if (!dcInfo.IsRegistered ()) {
888
+ Self->Schedule (TDuration::Seconds (1 ), new TEvPrivate::TEvUpdateDataCenterFollowers (dcId));
889
+ }
890
+ }
891
+
879
892
Self->ProcessPendingStopTablet ();
880
893
Self->ProcessPendingResumeTablet ();
881
894
0 commit comments