Fix direct load not release slice writer when abort task
This commit is contained in:
@ -77,9 +77,8 @@ void ObTableLoadStore::abort_ctx(ObTableLoadTableCtx *ctx, bool &is_stopped)
|
||||
if (OB_FAIL(abort_active_trans(ctx))) {
|
||||
LOG_WARN("fail to abort active trans", KR(ret));
|
||||
}
|
||||
// 4. stop merger
|
||||
ctx->store_ctx_->insert_table_ctx_->cancel();
|
||||
ctx->store_ctx_->merger_->stop();
|
||||
// 5. stop task_scheduler
|
||||
ctx->store_ctx_->task_scheduler_->stop();
|
||||
is_stopped = ctx->store_ctx_->task_scheduler_->is_stopped();
|
||||
}
|
||||
|
||||
@ -610,5 +610,25 @@ int ObDirectLoadInsertTableContext::get_tablet_context(
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ObDirectLoadInsertTableContext::cancel()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("ObDirectLoadInsertTableContext not init", KR(ret), KP(this));
|
||||
} else {
|
||||
FOREACH(iter, tablet_ctx_map_) {
|
||||
const ObTabletID &tablet_id = iter->first;
|
||||
ObDirectLoadInsertTabletContext *tablet_ctx = iter->second;
|
||||
if (OB_ISNULL(tablet_ctx)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected tablet ctx is NULL", KR(ret), K(tablet_id));
|
||||
} else if (OB_FAIL(tablet_ctx->cancel())) {
|
||||
LOG_WARN("fail to cancel tablet ctx", KR(ret), K(tablet_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace storage
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -143,6 +143,7 @@ public:
|
||||
int init(const ObDirectLoadInsertTableParam ¶m);
|
||||
int get_tablet_context(const common::ObTabletID &tablet_id,
|
||||
ObDirectLoadInsertTabletContext *&tablet_ctx) const;
|
||||
void cancel();
|
||||
TO_STRING_KV(K_(param));
|
||||
private:
|
||||
int create_all_tablet_contexts();
|
||||
|
||||
Reference in New Issue
Block a user