From 561fb1dd09e80d4ebdff67e7b5ae15c3de00a734 Mon Sep 17 00:00:00 2001 From: Aleksandra Martyniuk Date: Tue, 2 Apr 2024 19:01:50 +0200 Subject: [PATCH] service: move to cleanup stage if allow_write_both_read_old fails If allow_write_both_read_old tablet transition stage fails, move to cleanup_target stage before reverting migration. It's a preparation for further patches which deallocate storage group of a tablet during cleanup. --- docs/dev/topology-over-raft.md | 2 +- service/topology_coordinator.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dev/topology-over-raft.md b/docs/dev/topology-over-raft.md index 057aea43dd..40b77f7fc2 100644 --- a/docs/dev/topology-over-raft.md +++ b/docs/dev/topology-over-raft.md @@ -292,7 +292,7 @@ stateDiagram-v2 use_new --> cleanup cleanup --> end_migration end_migration --> [*] - allow_write_both_read_old --> revert_migration: error + allow_write_both_read_old --> cleanup_target: error write_both_read_old --> cleanup_target: error streaming --> cleanup_target: error write_both_read_new --> if_state: error diff --git a/service/topology_coordinator.cc b/service/topology_coordinator.cc index e1121f7ee8..f9f82f4c29 100644 --- a/service/topology_coordinator.cc +++ b/service/topology_coordinator.cc @@ -1046,7 +1046,7 @@ class topology_coordinator : public endpoint_lifecycle_subscriber { case locator::tablet_transition_stage::allow_write_both_read_old: if (action_failed(tablet_state.barriers[trinfo.stage])) { if (check_excluded_replicas()) { - transition_to_with_barrier(locator::tablet_transition_stage::revert_migration); + transition_to_with_barrier(locator::tablet_transition_stage::cleanup_target); break; } }