diff options
author | Alexey Efimov <[email protected]> | 2022-04-14 15:13:41 +0300 |
---|---|---|
committer | Alexey Efimov <[email protected]> | 2022-04-14 15:13:41 +0300 |
commit | 7316b548cc49d637c5d37d13757684da52cf52ef (patch) | |
tree | 2d47481a324acdf5491202f0d1af36326c90a152 | |
parent | a8ff920540d66ce4ae683a6b160156e039df4072 (diff) |
increase generation on groups reassign KIKIMR-14575
ref:c2fe4b1707979832b35144ac607fe0f13f532ca4
-rw-r--r-- | ydb/core/mind/hive/tx__update_tablet_groups.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ydb/core/mind/hive/tx__update_tablet_groups.cpp b/ydb/core/mind/hive/tx__update_tablet_groups.cpp index 1fec5d8e900..49c8141e864 100644 --- a/ydb/core/mind/hive/tx__update_tablet_groups.cpp +++ b/ydb/core/mind/hive/tx__update_tablet_groups.cpp @@ -156,7 +156,14 @@ public: db.Table<Schema::TabletChannel>().Key(tablet->Id, channelId).Update<Schema::TabletChannel::NeedNewGroup>(false); - ui32 fromGeneration = channel->History.empty() ? 0 : (tablet->KnownGeneration + 1); + ui32 fromGeneration; + if (channel->History.empty()) { + fromGeneration = 0; + } else { + tablet->IncreaseGeneration(); + db.Table<Schema::Tablet>().Key(tablet->Id).Update<Schema::Tablet::KnownGeneration>(tablet->KnownGeneration); + fromGeneration = tablet->KnownGeneration; + } TInstant timestamp = ctx.Now(); db.Table<Schema::TabletChannelGen>().Key(tablet->Id, channelId, fromGeneration).Update( NIceDb::TUpdate<Schema::TabletChannelGen::Group>(group->GetGroupID()), |