@@ -1811,11 +1811,16 @@ int ObVecIVFIndexBuildTask::submit_drop_vec_index_task()
18111811 LOG_WARN (" fail to push back pq_rowkey_cid_table_id_" , K (ret), K (pq_rowkey_cid_table_id_));
18121812 } else if (drop_index_arg.index_ids_ .count () <= 0 ) {
18131813 LOG_INFO (" no table need to be drop, skip" , K (ret)); // no table exist, skip drop
1814- } else if (schema_guard.get_table_schema (tenant_id_, object_id_, data_table_schema)) {
1814+ } else if (OB_FAIL ( schema_guard.get_table_schema (tenant_id_, object_id_, data_table_schema) )) {
18151815 LOG_WARN (" fail to get table schema" , K (ret), K (object_id_));
18161816 } else if (OB_ISNULL (data_table_schema)) {
1817- ret = OB_ERR_UNEXPECTED ;
1818- LOG_WARN (" data_table_schema is null" , K (ret), KP (data_table_schema));
1817+ if (create_index_arg_.is_offline_rebuild_ ) {
1818+ drop_index_task_submitted_ = true ;
1819+ LOG_INFO (" hidden data_table maybe removed when offline ddl is failed, skip submit drop" , K (ret), K (object_id_));
1820+ } else {
1821+ ret = OB_ERR_UNEXPECTED ;
1822+ LOG_WARN (" data_table_schema is null" , K (ret), KP (data_table_schema));
1823+ }
18191824 } else if (OB_FAIL (schema_guard.get_database_schema (tenant_id_, data_table_schema->get_database_id (), database_schema))) {
18201825 LOG_WARN (" get database schema failed" , KR (ret), K (data_table_schema->get_database_id ()));
18211826 } else if (OB_ISNULL (database_schema)) {
@@ -1956,13 +1961,17 @@ int ObVecIVFIndexBuildTask::cleanup_impl()
19561961 int64_t refreshed_schema_version = 0 ;
19571962 ObTableLockOwnerID owner_id;
19581963 ObMySQLTransaction trans;
1964+ bool is_skip_unlock = false ;
19591965 if (OB_FAIL (GCTX .schema_service_ ->get_tenant_schema_guard (tenant_id_,
19601966 schema_guard))) {
19611967 LOG_WARN (" get tenant schema guard failed" , K (ret), K (tenant_id_));
19621968 } else if (OB_FAIL (schema_guard.get_table_schema (tenant_id_,
19631969 data_table_id,
19641970 data_schema))) {
19651971 LOG_WARN (" fail to get table schema" , K (ret), K (data_table_id));
1972+ } else if (create_index_arg_.is_offline_rebuild_ && OB_ISNULL (data_schema)) {
1973+ is_skip_unlock = true ;
1974+ LOG_INFO (" the data table schema is null, skip unlock for the offline ddl rebuild ivf index" , K (ret), K (object_id_));
19661975 } else if (OB_ISNULL (data_schema)) {
19671976 ret = OB_TABLE_NOT_EXIST ;
19681977 LOG_WARN (" fail to get table schema" , K (ret), KP (data_schema));
@@ -1971,7 +1980,8 @@ int ObVecIVFIndexBuildTask::cleanup_impl()
19711980 } else if (OB_FAIL (owner_id.convert_from_value (ObLockOwnerType::DEFAULT_OWNER_TYPE ,
19721981 task_id_))) {
19731982 LOG_WARN (" failed to get owner id" , K (ret), K (task_id_));
1974- } else if (OB_FAIL (ObDDLLock::unlock_for_add_drop_index (*data_schema,
1983+ } else if (!is_skip_unlock &&
1984+ OB_FAIL (ObDDLLock::unlock_for_add_drop_index (*data_schema,
19751985 index_table_id,
19761986 false ,
19771987 owner_id,
0 commit comments