fix table load general table compact concurrency issue

This commit is contained in:
obdev 2023-03-06 07:43:47 +00:00 committed by ob-robot
parent d2149f86e3
commit ca23020851

View File

@ -424,6 +424,7 @@ int ObTableLoadGeneralTableCompactor::start_compact()
int ret = OB_SUCCESS;
const int64_t thread_count = store_ctx_->task_scheduler_->get_thread_count();
ObTableLoadTableCtx *ctx = store_ctx_->ctx_;
running_thread_count_ = thread_count;
for (int32_t thread_idx = 0; OB_SUCC(ret) && thread_idx < thread_count; ++thread_idx) {
ObTableLoadTask *task = nullptr;
// 1. 分配task
@ -442,10 +443,6 @@ int ObTableLoadGeneralTableCompactor::start_compact()
else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(thread_idx, task))) {
LOG_WARN("fail to add task", KR(ret), K(thread_idx), KPC(task));
}
// 5. inc running_thread_count_
else {
ATOMIC_INC(&running_thread_count_);
}
if (OB_FAIL(ret)) {
if (nullptr != task) {
ctx->free_task(task);