aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2023-04-07 12:18:58 +0300
committerilnaz <ilnaz@ydb.tech>2023-04-07 12:18:58 +0300
commit21b23100b7762bb785ac36bf473389453124377a (patch)
tree41274cdb160eafbb80fb2f5f89496768f9a65057
parenta99d2644ac460383617c0eb6fb5a6b3cf7e43048 (diff)
downloadydb-21b23100b7762bb785ac36bf473389453124377a.tar.gz
Remember sync state when restarting populator
-rw-r--r--ydb/core/tx/scheme_board/replica.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/ydb/core/tx/scheme_board/replica.cpp b/ydb/core/tx/scheme_board/replica.cpp
index 4771206aa05..e104ead92ff 100644
--- a/ydb/core/tx/scheme_board/replica.cpp
+++ b/ydb/core/tx/scheme_board/replica.cpp
@@ -528,16 +528,13 @@ private:
struct TPopulatorInfo {
ui64 Generation = 0;
ui64 PendingGeneration = 0;
+ bool IsCommited = false;
TActorId PopulatorActor;
-
- bool IsCommited() const {
- return Generation && Generation == PendingGeneration;
- }
};
bool IsPopulatorCommited(ui64 ownerId) const {
auto it = Populators.find(ownerId);
- if (it != Populators.end() && it->second.IsCommited()) {
+ if (it != Populators.end() && it->second.IsCommited) {
return true;
}
@@ -1006,6 +1003,7 @@ private:
<< ", generation# " << generation);
info.Generation = info.PendingGeneration;
+ info.IsCommited = true;
Send(ev->Sender, new TSchemeBoardEvents::TEvCommitResponse(owner, info.Generation), 0, ev->Cookie);
if (WaitStrongNotifications.contains(owner)) {
@@ -1274,14 +1272,14 @@ private:
}
void PassAway() override {
- for (auto &xpair : Populators) {
- if (const TActorId populator = xpair.second.PopulatorActor) {
- Send(populator, new TEvStateStorage::TEvReplicaShutdown());
+ for (const auto& [_, info] : Populators) {
+ if (const auto& actorId = info.PopulatorActor) {
+ Send(actorId, new TEvStateStorage::TEvReplicaShutdown());
}
}
- for (auto &xpair : Subscribers) {
- Send(xpair.first, new TEvStateStorage::TEvReplicaShutdown());
+ for (const auto& [actorId, _] : Subscribers) {
+ Send(actorId, new TEvStateStorage::TEvReplicaShutdown());
}
TMonitorableActor::PassAway();