From 9cb529705e2a9d095e6ee9b9ac9f9d2ba74ecf8c Mon Sep 17 00:00:00 2001 From: YoungYang0820 Date: Fri, 20 May 2022 14:34:36 +0800 Subject: [PATCH] [CP] fix local index scheduler not exiting --- src/storage/ob_build_index_scheduler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/ob_build_index_scheduler.cpp b/src/storage/ob_build_index_scheduler.cpp index 15d6709044..0c0871222f 100644 --- a/src/storage/ob_build_index_scheduler.cpp +++ b/src/storage/ob_build_index_scheduler.cpp @@ -177,6 +177,9 @@ int ObBuildIndexBaseTask::check_partition_need_build_index(const ObPartitionKey& need_build = false; ObTaskController::get().allow_next_syslog(); STORAGE_LOG(INFO, "The table does not exist, no need to create index, ", K(index_schema.get_table_id())); + } else if (INDEX_STATUS_UNAVAILABLE != new_index_schema->get_index_status()) { + need_build = false; + STORAGE_LOG(INFO, "index build is already completed, skip it", K(ret), K(new_index_schema->get_table_id())); } else if (OB_FAIL(schema_guard.check_partition_exist( pkey.get_table_id(), pkey.get_partition_id(), check_dropped_partition, is_partition_exist))) { STORAGE_LOG(WARN, "fail to check partition exist", K(ret), K(pkey), K(index_schema.get_table_id())); @@ -1484,8 +1487,6 @@ int ObBuildIndexScheduleTask::process() STORAGE_LOG(INFO, "index schema has been deleted, skip build it", K(pkey_), K(index_id_)); is_end = true; } - } else if (INDEX_STATUS_UNAVAILABLE != index_schema->get_index_status()) { - STORAGE_LOG(INFO, "index build is already completed, skip it", K(ret), K(index_id_)); } else if (OB_FAIL(schema_guard.get_table_schema(index_schema->get_data_table_id(), table_schema))) { STORAGE_LOG(WARN, "fail to get table schema", K(ret)); } else if (OB_FAIL(check_partition_need_build_index(pkey_, *index_schema, *table_schema, part_guard, need_build))) { -- GitLab