diff options
author | xenoxeno <xeno@ydb.tech> | 2022-11-17 19:15:34 +0300 |
---|---|---|
committer | xenoxeno <xeno@ydb.tech> | 2022-11-17 19:15:34 +0300 |
commit | 019071feb92f224930b5975d31ecc110f467a618 (patch) | |
tree | 660fe398e46c4d73e937d580b45a333c90ef6a9c | |
parent | fed4fe520bbec14ea905d293d81b05468d0a39f5 (diff) | |
download | ydb-019071feb92f224930b5975d31ecc110f467a618.tar.gz |
don't block group in current generation after reassign
-rw-r--r-- | ydb/core/mind/hive/tx__update_tablet_groups.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ydb/core/mind/hive/tx__update_tablet_groups.cpp b/ydb/core/mind/hive/tx__update_tablet_groups.cpp index 9ca73c3dd3..abf4244984 100644 --- a/ydb/core/mind/hive/tx__update_tablet_groups.cpp +++ b/ydb/core/mind/hive/tx__update_tablet_groups.cpp @@ -28,6 +28,7 @@ public: ETabletState newTabletState = ETabletState::GroupAssignment; bool needToBlockStorage = false; + bool needToIncreaseGeneration = false; bool changed = false; TStringBuilder tabletBootState; @@ -160,11 +161,8 @@ public: if (channel->History.empty()) { fromGeneration = 0; } else { - if (!changed) { - tablet->IncreaseGeneration(); - db.Table<Schema::Tablet>().Key(tablet->Id).Update<Schema::Tablet::KnownGeneration>(tablet->KnownGeneration); - } - fromGeneration = tablet->KnownGeneration; + needToIncreaseGeneration = true; + fromGeneration = tablet->KnownGeneration + 1; } if (!changed) { @@ -282,6 +280,10 @@ public: SideEffects.Register(CreateTabletKiller(TabletId, /* nodeId */ 0, tablet->KnownGeneration)); } } + if (needToIncreaseGeneration) { + tablet->IncreaseGeneration(); + db.Table<Schema::Tablet>().Key(tablet->Id).Update<Schema::Tablet::KnownGeneration>(tablet->KnownGeneration); + } if (!tablet->TryToBoot()) { BLOG_NOTICE("THive::TTxUpdateTabletGroups{" << (ui64)this << "}(" << TabletId << ")::Execute" " - TryToBoot was not successfull"); |