Skip to content

Commit 8664da6

Browse files
obdevfootka
authored andcommitted
[CP] [fix] hybrid vector index refresh task memory bloat
Co-authored-by: footka <672528926@qq.com>
1 parent 666df29 commit 8664da6

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/share/vector_index/ob_hybrid_vector_refresh_task.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class ObHybridVectorRefreshTask : public ObVecIndexIAsyncTask
110110
ObHybridVectorRefreshTask() : ObVecIndexIAsyncTask(ObMemAttr(MTL_ID(), "VecIdxASyTask")) {}
111111
virtual ~ObHybridVectorRefreshTask() {}
112112
virtual void check_task_free() override {
113+
all_finished_ = true;
113114
ObHybridVectorRefreshTaskCtx *ctx = static_cast<ObHybridVectorRefreshTaskCtx *>(get_task_ctx());
114115
if (OB_NOT_NULL(ctx)) {
115116
ctx->check_task_free();

src/share/vector_index/ob_vector_index_async_task_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ void ObVecIndexAsyncTaskHandler::handle(void *task)
10711071
}
10721072
}
10731073
if (OB_NOT_NULL(async_task)
1074-
&& (async_task->get_task_type() != ObVecIndexAsyncTaskType::OB_VECTOR_ASYNC_HYBRID_VECTOR_EMBEDDING || async_task->get_task_ctx()->task_status_.all_finished_)) {
1074+
&& (async_task->get_task_type() != ObVecIndexAsyncTaskType::OB_VECTOR_ASYNC_HYBRID_VECTOR_EMBEDDING || async_task->all_finished())) {
10751075
handle_ls_process_task_cnt(async_task->get_ls_id(), false);
10761076
dec_async_task_ref();
10771077
}

src/share/vector_index/ob_vector_index_async_task_util.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ class ObVecIndexIAsyncTask
285285
old_adapter_(nullptr),
286286
mem_attr_(mem_attr),
287287
allocator_(ObMemAttr(MTL_ID(), "VecIdxASyTask")),
288-
vid_obj_()
288+
vid_obj_(),
289+
all_finished_(false)
289290
{}
290291
virtual ~ObVecIndexIAsyncTask() {}
291292
int init(const uint64_t tenant_id, const ObLSID &ls_id, const int task_type,
@@ -294,6 +295,7 @@ class ObVecIndexIAsyncTask
294295
ObLSID &get_ls_id() { return ls_id_; }
295296
ObVecIndexAsyncTaskCtx *get_task_ctx() { return ctx_; }
296297
void set_old_adapter(ObPluginVectorIndexAdaptor* adapter) { old_adapter_ = adapter; }
298+
bool all_finished() { return all_finished_; }
297299
virtual void check_task_free() {}
298300
virtual int do_work() = 0;
299301

@@ -310,6 +312,7 @@ class ObVecIndexIAsyncTask
310312
ObMemAttr mem_attr_;
311313
common::ObArenaAllocator allocator_;
312314
ObObj vid_obj_;
315+
bool all_finished_;
313316
DISALLOW_COPY_AND_ASSIGN(ObVecIndexIAsyncTask);
314317
};
315318

0 commit comments

Comments
 (0)