From a57b33a5d5b4f94a0adee6c841d177831c2e2b98 Mon Sep 17 00:00:00 2001 From: "shenyunlong.syl" Date: Thu, 2 Jan 2025 12:46:17 +0000 Subject: [PATCH] [OBKV] fix hbase rowkey TTL task coredump at ObRowkey::deserialize_objs --- src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp | 8 +++++--- src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp index 77282771c..1cb0c2dd6 100644 --- a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp +++ b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp @@ -607,13 +607,13 @@ ObTTLTaskCtx* ObTabletTTLScheduler::get_one_tablet_ctx(const ObTabletID& tablet_ } /*other inner function*/ -int ObTabletTTLScheduler::deep_copy_task(ObTTLTaskCtx* ctx, ObTTLTaskInfo& task_info, const ObTTLTaskParam &task_param) +int ObTabletTTLScheduler::deep_copy_task(ObTTLTaskCtx* ctx, ObTTLTaskInfo& task_info, const ObTTLTaskParam &task_param, bool with_rowkey_copy /*true*/) { int ret = OB_SUCCESS; if (OB_ISNULL(ctx)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("the ctx is null", KR(ret)); - } else if (OB_FAIL(ctx->deep_copy_rowkey(task_info.row_key_)) ) { + } else if (with_rowkey_copy && OB_FAIL(ctx->deep_copy_rowkey(task_info.row_key_)) ) { LOG_WARN("fail to deep copy rowkey", KR(ret), K(task_info.row_key_)); } else { ctx->task_info_.ttl_del_cnt_ += task_info.ttl_del_cnt_; @@ -1366,7 +1366,9 @@ int ObTabletHRowkeyTTLScheduler::report_task_status(ObTTLTaskInfo& task_info, Ob ctx->last_modify_time_ = ObTimeUtility::current_time(); ctx->in_queue_ = false; mark_ttl_ctx_dirty(local_tenant_task_, *ctx); - if (need_copy_task && OB_FAIL(deep_copy_task(ctx, task_info, task_para))) { + // A tablet task is associated with multiple rowkey ttl tasks, + // so it's meaningless to copy the rowkey of current task + if (need_copy_task && OB_FAIL(deep_copy_task(ctx, task_info, task_para, false))) { LOG_WARN("fail to deep copy task", KR(ret), K_(tenant_id), K(task_info), K(task_para)); ctx->task_status_ = OB_TTL_TASK_PENDING; ctx->failure_times_++; diff --git a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h index 612d476c4..1cb73d6a0 100644 --- a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h +++ b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h @@ -269,7 +269,7 @@ protected: OB_INLINE bool need_skip_run() { return ATOMIC_LOAD(&need_do_for_switch_); } protected: void mark_ttl_ctx_dirty(ObTTLTenantInfo& tenant_info, ObTTLTaskCtx& ctx); - int deep_copy_task(ObTTLTaskCtx* ctx, table::ObTTLTaskInfo& task_info, const table::ObTTLTaskParam &task_param); + int deep_copy_task(ObTTLTaskCtx* ctx, table::ObTTLTaskInfo& task_info, const table::ObTTLTaskParam &task_param, bool with_rowkey_copy = true); int try_schedule_remaining_tasks(const ObTTLTaskCtx *current_ctx); protected: