From c599cf311dc567e761d63f4fc2fec92c4a6d3efa Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 12 Jan 2024 21:12:01 +0800 Subject: [PATCH] [fix](migrate) migrate check old tablet had deleted (#29909) --- be/src/olap/task/engine_storage_migration_task.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/be/src/olap/task/engine_storage_migration_task.cpp b/be/src/olap/task/engine_storage_migration_task.cpp index 56a38fdbd0..8cd5717afb 100644 --- a/be/src/olap/task/engine_storage_migration_task.cpp +++ b/be/src/olap/task/engine_storage_migration_task.cpp @@ -125,6 +125,10 @@ Status EngineStorageMigrationTask::_check_running_txns_until_timeout( // to avoid invalid loops, the lock is guaranteed to be acquired here { std::unique_lock wlock(_tablet->get_migration_lock()); + if (_tablet->tablet_state() == TABLET_SHUTDOWN) { + return Status::Error("tablet {} has deleted", + _tablet->tablet_id()); + } res = _check_running_txns(); if (res.ok()) { // transfer the lock to the caller @@ -160,6 +164,10 @@ Status EngineStorageMigrationTask::_gen_and_write_header_to_hdr_file( } Status EngineStorageMigrationTask::_reload_tablet(const std::string& full_path) { + if (_tablet->tablet_state() == TABLET_SHUTDOWN) { + return Status::Error("tablet {} has deleted", + _tablet->tablet_id()); + } // need hold migration lock and push lock outside int64_t tablet_id = _tablet->tablet_id(); int32_t schema_hash = _tablet->schema_hash();