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.
This commit is contained in:
Aleksandra Martyniuk
2024-04-02 19:01:50 +02:00
parent 532653f118
commit 561fb1dd09
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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;
}
}