Skip to content

Commit 71a4c61

Browse files
obdevob-robot
authored andcommitted
[CP] Fix offline ddl rebuild ivf index failure, drop vec index process stuck issue.
1 parent b631dea commit 71a4c61

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

deps/oblib/src/lib/utility/ob_tracepoint_def.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,10 @@ GLOBAL_ERRSIM_POINT_DEF(1199, EN_DISABLE_ENCODESORTKEY_OPT, "Used for disable en
577577
GLOBAL_ERRSIM_POINT_DEF(1200, EN_ENABLE_NEWSORT_FORCE, "");
578578
GLOBAL_ERRSIM_POINT_DEF(1201, EN_DISABLE_NEWSORT_FIXED_KEY_OPT, "Used to control whether to turn off the newsort fixed key opt when use encode sortkey");
579579

580+
// vector index 1300 - 1399
581+
GLOBAL_ERRSIM_POINT_DEF(1300, EN_VEC_INDEX_IVF_ROWKEY_CID_BUILD_ERR, "");
582+
GLOBAL_ERRSIM_POINT_DEF(1301, EN_VEC_INDEX_IVF_PQ_BUILD_ERR, "");
583+
580584
// Transaction // 2001 - 2100
581585
// Transaction free route
582586
GLOBAL_ERRSIM_POINT_DEF(2001, EN_TX_FREE_ROUTE_UPDATE_STATE_ERROR, "");

src/rootserver/ddl_task/ob_drop_vec_ivf_index_task.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,15 @@ int ObDropVecIVFIndexTask::drop_aux_index_table(const share::ObDDLTaskStatus &ne
462462
ret = OB_ERR_UNEXPECTED;
463463
LOG_WARN("unexpected ddl task type", K(ret), K(task_type_));
464464
}
465+
466+
// state machine processing: directly switch status if success, otherwise retry if failed
467+
if (OB_FAIL(ret)) {
468+
} else if (OB_FAIL(switch_status(new_status, true, ret))) {
469+
LOG_WARN("switch status failed", K(ret), K(new_status), K(task_status_));
470+
} else {
471+
LOG_INFO("drop_aux_index_table success", K(ret), K(parent_task_id_), K(task_id_), K(*this));
472+
}
473+
465474
return ret;
466475
}
467476

@@ -721,6 +730,7 @@ int ObDropVecIVFIndexTask::create_drop_index_task(
721730
arg.ddl_stmt_str_ = drop_index_sql.string();
722731
arg.is_add_to_scheduler_ = true;
723732
arg.task_id_ = task_id_;
733+
arg.is_hidden_ = drop_index_arg_.is_hidden_;
724734
if (OB_FAIL(ObDDLUtil::get_ddl_rpc_timeout(
725735
index_schema->get_all_part_num() + data_table_schema->get_all_part_num(), ddl_rpc_timeout_us))) {
726736
LOG_WARN("fail to get ddl rpc timeout", K(ret));

src/rootserver/ddl_task/ob_index_build_task.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,19 @@ int ObIndexSSTableBuildTask::process()
131131
ret = OB_ERR_UNEXPECTED;
132132
LOG_WARN("error unexpected, index schema must not be nullptr", K(ret), K(tenant_id_), K(dest_table_id_));
133133
} else {
134-
if (is_partitioned_local_index_task()) {
134+
#ifdef ERRSIM
135+
if (OB_SUCC(ret)
136+
&& (index_schema->is_vec_ivfflat_rowkey_cid_index()
137+
|| index_schema->is_vec_ivfpq_rowkey_cid_index()
138+
|| index_schema->is_vec_ivfsq8_rowkey_cid_index())) {
139+
ret = OB_E(EventTable::EN_VEC_INDEX_IVF_ROWKEY_CID_BUILD_ERR) OB_SUCCESS;
140+
if (OB_FAIL(ret)) {
141+
LOG_WARN("errsim ddl execute building the subtask of vector index rowkey cid table failed", KR(ret));
142+
}
143+
}
144+
#endif
145+
if (OB_FAIL(ret)) {
146+
} else if (is_partitioned_local_index_task()) {
135147
bool is_oracle_mode = false;
136148
if (OB_FAIL(ObCompatModeGetter::check_is_oracle_mode_with_table_id(tenant_id_, data_table_id_, is_oracle_mode))) {
137149
LOG_WARN("check if oracle mode failed", K(ret), K(data_table_id_));

src/share/vector_index/ob_vector_kmeans_ctx.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,16 @@ int ObIvfPqBuildHelper::build(const common::ObTableID &table_id, const common::O
12941294
} else if (OB_FAIL(executor_->build(insert_monitor))) {
12951295
LOG_WARN("failed to build clusters", K(ret));
12961296
}
1297+
1298+
#ifdef ERRSIM
1299+
if (OB_SUCC(ret)) {
1300+
ret = OB_E(common::EventTable::EN_VEC_INDEX_IVF_PQ_BUILD_ERR) OB_SUCCESS;
1301+
if (OB_FAIL(ret)) {
1302+
LOG_WARN("[ERRSIM] fail to build ivf pq", K(ret));
1303+
}
1304+
}
1305+
#endif
1306+
12971307
return ret;
12981308
}
12991309

0 commit comments

Comments
 (0)