提交 9b1ec8ad 编写于 作者: C Charles0429 提交者: LINGuanRen

skip building delay deleted index

上级 67b1a08e
...@@ -565,6 +565,8 @@ int ObGlobalIndexBuilder::check_and_get_index_schema(share::schema::ObSchemaGett ...@@ -565,6 +565,8 @@ int ObGlobalIndexBuilder::check_and_get_index_schema(share::schema::ObSchemaGett
} else if (OB_UNLIKELY(NULL == index_schema)) { } else if (OB_UNLIKELY(NULL == index_schema)) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("index schema ptr is null", K(ret), K(index_table_id)); LOG_WARN("index schema ptr is null", K(ret), K(index_table_id));
} else if (index_schema->is_dropped_schema()) {
// table delay delete, do not build index
} else { } else {
} // no more to do } // no more to do
return ret; return ret;
......
...@@ -618,7 +618,7 @@ int ObRSBuildIndexTask::wait_trans_end(bool& is_end) ...@@ -618,7 +618,7 @@ int ObRSBuildIndexTask::wait_trans_end(bool& is_end)
LOG_WARN("fail to get schema guard", K(ret), K(fetch_tenant_id), K_(index_id)); LOG_WARN("fail to get schema guard", K(ret), K(fetch_tenant_id), K_(index_id));
} else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) {
LOG_WARN("fail to get table schema", K(ret), K(index_id_)); LOG_WARN("fail to get table schema", K(ret), K(index_id_));
} else if (OB_ISNULL(index_schema)) { } else if (OB_ISNULL(index_schema) || index_schema->is_dropped_schema()) {
// index table has been dropped // index table has been dropped
ret = OB_SUCCESS; ret = OB_SUCCESS;
is_end = true; is_end = true;
...@@ -732,7 +732,7 @@ int ObRSBuildIndexTask::wait_build_index_end(bool& is_end) ...@@ -732,7 +732,7 @@ int ObRSBuildIndexTask::wait_build_index_end(bool& is_end)
LOG_WARN("fail to get schema guard", K(ret), K(fetch_tenant_id), K_(index_id)); LOG_WARN("fail to get schema guard", K(ret), K(fetch_tenant_id), K_(index_id));
} else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) {
LOG_WARN("fail to get table schema", K(ret), K(index_id_)); LOG_WARN("fail to get table schema", K(ret), K(index_id_));
} else if (OB_ISNULL(index_schema)) { } else if (OB_ISNULL(index_schema) || index_schema->is_dropped_schema()) {
ret = OB_SUCCESS; ret = OB_SUCCESS;
is_end = true; is_end = true;
} else if (OB_FAIL(schema_guard.get_table_schema(index_schema->get_data_table_id(), table_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_schema->get_data_table_id(), table_schema))) {
......
...@@ -467,7 +467,7 @@ int ObTenantDDLCheckSchemaTask::process_schedule_build_index_task() ...@@ -467,7 +467,7 @@ int ObTenantDDLCheckSchemaTask::process_schedule_build_index_task()
// do nothing // do nothing
} else if (OB_FAIL(schema_guard.get_table_schema(table_ids.at(i), index_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(table_ids.at(i), index_schema))) {
STORAGE_LOG(WARN, "fail to get table schema", K(ret)); STORAGE_LOG(WARN, "fail to get table schema", K(ret));
} else if (OB_ISNULL(index_schema)) { } else if (OB_ISNULL(index_schema) || index_schema->is_dropped_schema()) {
ret = OB_SUCCESS; ret = OB_SUCCESS;
STORAGE_LOG(INFO, "table has been deleted, do not need to create index", K(ret), "table_id", table_ids.at(i)); STORAGE_LOG(INFO, "table has been deleted, do not need to create index", K(ret), "table_id", table_ids.at(i));
} else if (OB_FAIL(find_build_index_partitions(index_schema, schema_guard, partition_keys))) { } else if (OB_FAIL(find_build_index_partitions(index_schema, schema_guard, partition_keys))) {
...@@ -998,7 +998,7 @@ int ObBuildIndexScheduleTask::send_copy_replica_rpc() ...@@ -998,7 +998,7 @@ int ObBuildIndexScheduleTask::send_copy_replica_rpc()
STORAGE_LOG(WARN, "fail to get schema guard", K(ret), K(schema_version_)); STORAGE_LOG(WARN, "fail to get schema guard", K(ret), K(schema_version_));
} else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) {
STORAGE_LOG(WARN, "fail to get table schema", K(ret), K(pkey_), K(index_id_)); STORAGE_LOG(WARN, "fail to get table schema", K(ret), K(pkey_), K(index_id_));
} else if (OB_ISNULL(index_schema)) { } else if (OB_ISNULL(index_schema) || index_schema->is_dropped_schema()) {
ret = OB_SUCCESS; ret = OB_SUCCESS;
} else if (OB_FAIL(schema_guard.get_table_schema(index_schema->get_data_table_id(), data_table_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_schema->get_data_table_id(), data_table_schema))) {
STORAGE_LOG(WARN, "fail to get table schema", K(ret)); STORAGE_LOG(WARN, "fail to get table schema", K(ret));
...@@ -1414,7 +1414,7 @@ int ObBuildIndexScheduleTask::process() ...@@ -1414,7 +1414,7 @@ int ObBuildIndexScheduleTask::process()
STORAGE_LOG(WARN, "fail to get schema guard", K(ret), K(pkey_), K(index_id_)); STORAGE_LOG(WARN, "fail to get schema guard", K(ret), K(pkey_), K(index_id_));
} else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) { } else if (OB_FAIL(schema_guard.get_table_schema(index_id_, index_schema))) {
STORAGE_LOG(WARN, "fail to get table schema", K(ret), K(pkey_), K(index_id_)); STORAGE_LOG(WARN, "fail to get table schema", K(ret), K(pkey_), K(index_id_));
} else if (OB_ISNULL(index_schema)) { } else if (OB_ISNULL(index_schema) || index_schema->is_dropped_schema()) {
if (UNIQUE_INDEX_CHECKING != state_) { if (UNIQUE_INDEX_CHECKING != state_) {
STORAGE_LOG(INFO, "index schema has been deleted, skip build it", K(pkey_), K(index_id_)); STORAGE_LOG(INFO, "index schema has been deleted, skip build it", K(pkey_), K(index_id_));
is_end = true; is_end = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册