Skip to content

Commit 8fcef35

Browse files
committed
dirty commit
1 parent 81bb0df commit 8fcef35

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

ydb/core/mind/hive/tx__load_everything.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,11 @@ class TTxLoadEverything : public TTransactionBase<THive> {
605605
followerGroup.LocalNodeOnly = tabletFollowerGroupRowset.GetValueOrDefault<Schema::TabletFollowerGroup::LocalNodeOnly>();
606606
followerGroup.FollowerCountPerDataCenter = tabletFollowerGroupRowset.GetValueOrDefault<Schema::TabletFollowerGroup::FollowerCountPerDataCenter>();
607607
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+
}
608613
} else {
609614
++numMissingTablets;
610615
}
@@ -665,8 +670,10 @@ class TTxLoadEverything : public TTransactionBase<THive> {
665670
continue;
666671
}
667672
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+
}
670677
}
671678
auto groupId = group.Id;
672679
auto filterGroup = [groupId](auto&& follower) { return follower->FollowerGroup.Id == groupId;};
@@ -876,6 +883,12 @@ class TTxLoadEverything : public TTransactionBase<THive> {
876883
Self->ProcessFollowerUpdatesScheduled = true;
877884
}
878885

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+
879892
Self->ProcessPendingStopTablet();
880893
Self->ProcessPendingResumeTablet();
881894

0 commit comments

Comments
 (0)