From c082c93fd428e5d51e2302fb7e7eadf721a33e16 Mon Sep 17 00:00:00 2001 From: qianchanger Date: Fri, 6 Jan 2023 14:38:14 +0000 Subject: [PATCH] Fix plan with das for update hang in px transmit operator --- build.sh | 2 +- src/sql/engine/px/exchange/ob_px_transmit_op.cpp | 13 ------------- src/sql/engine/px/exchange/ob_px_transmit_op.h | 2 +- src/storage/ls/ob_ls_member_table.cpp | 4 ++-- src/storage/tx_storage/ob_tablet_gc_service.cpp | 1 - src/storage/tx_storage/ob_tablet_gc_service.h | 3 ++- 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/build.sh b/build.sh index 99896652d..e6d5a1b67 100755 --- a/build.sh +++ b/build.sh @@ -201,7 +201,7 @@ function build ;; xrpm) STATIC_LINK_LGPL_DEPS_OPTION=OFF - do_build "$@" -DOB_BUILD_RPM=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION + do_build "$@" -DOB_BUILD_RPM=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOB_USE_LLD=$LLD_OPTION -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DOB_STATIC_LINK_LGPL_DEPS=$STATIC_LINK_LGPL_DEPS_OPTION ;; xenable_smart_var_check) do_build "$@" -DCMAKE_BUILD_TYPE=Debug -DOB_USE_LLD=$LLD_OPTION -DENABLE_SMART_VAR_CHECK=ON -DOB_ENABLE_AVX2=ON diff --git a/src/sql/engine/px/exchange/ob_px_transmit_op.cpp b/src/sql/engine/px/exchange/ob_px_transmit_op.cpp index 42d15f03e..1f4b236a8 100644 --- a/src/sql/engine/px/exchange/ob_px_transmit_op.cpp +++ b/src/sql/engine/px/exchange/ob_px_transmit_op.cpp @@ -164,16 +164,6 @@ void ObPxTransmitOp::destroy() ObTransmitOp::destroy(); } -bool ObPxTransmitOp::is_dml_type_match_iter_end(bool need_drive_dml_query) -{ - // In the new engine, insert, update, and delete no longer do real dml in inner_open, - // do real dml in get_next_row, so the original early termination logic needs to be modified, - // and other dml operators can still retain this optimization, such as replace, merge, etc. - return child_->get_spec().is_dml_operator() && - !child_->get_spec().is_pdml_operator() && - !need_drive_dml_query; -} - int ObPxTransmitOp::inner_open() { int ret = OB_SUCCESS; @@ -226,9 +216,6 @@ int ObPxTransmitOp::fetch_first_row() OB_ISNULL(phy_plan = phy_plan_ctx->get_phy_plan())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("null phy_plan or phy_plan_ctx", K(phy_plan_ctx), K(phy_plan), K(ret)); - } else if (is_dml_type_match_iter_end(phy_plan->need_drive_dml_query_)) { - iter_end_ = true; - LOG_TRACE("transmit iter end", K(ret), K(iter_end_)); } else { const ObBatchRows *brs = NULL; if (is_vectorized()) { diff --git a/src/sql/engine/px/exchange/ob_px_transmit_op.h b/src/sql/engine/px/exchange/ob_px_transmit_op.h index 293c07f9f..b9e048bcd 100644 --- a/src/sql/engine/px/exchange/ob_px_transmit_op.h +++ b/src/sql/engine/px/exchange/ob_px_transmit_op.h @@ -1,4 +1,5 @@ /** + * Copyright (c) 2021 OceanBase * OceanBase CE is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. @@ -148,7 +149,6 @@ private: int broadcast_eof_row(); int next_row(); int set_rollup_hybrid_keys(ObSliceIdxCalc &slice_calc); - bool is_dml_type_match_iter_end(bool need_drive_dml_query); int fetch_first_row(); int set_expect_range_count(); diff --git a/src/storage/ls/ob_ls_member_table.cpp b/src/storage/ls/ob_ls_member_table.cpp index ed96e3463..b5651a821 100644 --- a/src/storage/ls/ob_ls_member_table.cpp +++ b/src/storage/ls/ob_ls_member_table.cpp @@ -179,7 +179,7 @@ int ObLSMemberTable::on_commit_create_tablets(const obrpc::ObBatchCreateTabletAr if (OB_FAIL(tablet_svr->on_abort_create_tablets(*arg, trans_flags))) { LOG_WARN("fail to on_abort_create_tablets", KR(ret), KPC(arg), K(trans_flags)); } else { - ls->get_tablet_gc_handler()->set_tablet_gc_trigger(); + ls->get_tablet_gc_handler()->set_tablet_persist_trigger(); } } if (OB_FAIL(ret)) { @@ -358,7 +358,7 @@ int ObLSMemberTable::on_commit_remove_tablets(const obrpc::ObBatchRemoveTabletAr if (OB_FAIL(tablet_svr->on_commit_remove_tablets(*arg, trans_flags))) { LOG_WARN("fail to on_commit_remove_tablets", KR(ret), KPC(arg), K(trans_flags)); } else { - ls->get_tablet_gc_handler()->set_tablet_gc_trigger(); + ls->get_tablet_gc_handler()->set_tablet_persist_trigger(); } } else if (OB_FAIL(tablet_svr->on_abort_remove_tablets(*arg, trans_flags))) { LOG_WARN("fail to on_abort_remove_tablets", KR(ret), KPC(arg), K(trans_flags)); diff --git a/src/storage/tx_storage/ob_tablet_gc_service.cpp b/src/storage/tx_storage/ob_tablet_gc_service.cpp index 1f472581e..1dd76a26e 100644 --- a/src/storage/tx_storage/ob_tablet_gc_service.cpp +++ b/src/storage/tx_storage/ob_tablet_gc_service.cpp @@ -450,7 +450,6 @@ int ObTabletGCHandler::offline() void ObTabletGCHandler::online() { set_tablet_persist_trigger(); - set_tablet_gc_trigger(); set_start(); STORAGE_LOG(INFO, "tablet gc handler online", KPC(this), KPC(ls_), K(ls_->get_ls_meta())); } diff --git a/src/storage/tx_storage/ob_tablet_gc_service.h b/src/storage/tx_storage/ob_tablet_gc_service.h index a8efd20af..cb8b36be6 100644 --- a/src/storage/tx_storage/ob_tablet_gc_service.h +++ b/src/storage/tx_storage/ob_tablet_gc_service.h @@ -28,6 +28,7 @@ namespace checkpoint class ObTabletGCHandler { + friend class ObTabletGCService; public: ObTabletGCHandler() : ls_(NULL), @@ -50,7 +51,6 @@ public: static bool is_tablet_gc_trigger(uint8_t tablet_persist_trigger) { return 0 != (tablet_persist_trigger & 2); } void set_tablet_persist_trigger(); - void set_tablet_gc_trigger(); uint8_t get_tablet_persist_trigger_and_reset(); int get_unpersist_tablet_ids(common::ObTabletIDArray &unpersist_create_tablet_ids, bool only_deleted = false); @@ -71,6 +71,7 @@ private: bool is_finish() { obsys::ObWLockGuard lock(wait_lock_, false); return lock.acquired(); } void set_stop() { ATOMIC_STORE(&update_enabled_, false); } void set_start() { ATOMIC_STORE(&update_enabled_, true); } + void set_tablet_gc_trigger(); public: obsys::ObRWLock wait_lock_;