From 5443466da825d494367a53ceb7ea45bffb77e3b5 Mon Sep 17 00:00:00 2001 From: hiddenbomb Date: Tue, 12 Mar 2024 03:27:12 +0000 Subject: [PATCH] fix ret checking missing issue and typo --- src/storage/tablelock/ob_table_lock_service.cpp | 3 +-- src/storage/tablet/ob_tablet.cpp | 2 +- src/storage/tx/ob_dup_table_base.cpp | 16 ++++++++-------- src/storage/tx/ob_dup_table_lease.cpp | 4 ++-- src/storage/tx/ob_dup_table_lease.h | 2 +- src/storage/tx/ob_dup_table_ts_sync.h | 2 +- src/storage/tx/ob_dup_table_util.cpp | 8 ++++---- src/storage/tx/ob_dup_table_util.h | 2 +- src/storage/tx/ob_two_phase_committer.h | 2 +- .../tx/ob_two_phase_downstream_committer.cpp | 8 ++++---- .../tx/ob_two_phase_upstream_committer.cpp | 10 +++++----- src/storage/tx/ob_tx_loop_worker.cpp | 4 ++-- src/storage/tx/ob_tx_msg.h | 2 +- src/storage/tx/ob_tx_replay_executor.cpp | 2 +- 14 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/storage/tablelock/ob_table_lock_service.cpp b/src/storage/tablelock/ob_table_lock_service.cpp index 862c72988..ff44a8ffa 100644 --- a/src/storage/tablelock/ob_table_lock_service.cpp +++ b/src/storage/tablelock/ob_table_lock_service.cpp @@ -198,8 +198,7 @@ int ObTableLockService::ObOBJLockGarbageCollector::garbage_collect_for_all_ls_() } else if (OB_ISNULL(ls_service = MTL(ObLSService *))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("mtl ObLSService should not be null", K(ret)); - } else if (ls_service->get_ls_iter(ls_iter_guard, - ObLSGetMod::TABLELOCK_MOD)) { + } else if (OB_FAIL(ls_service->get_ls_iter(ls_iter_guard, ObLSGetMod::TABLELOCK_MOD))) { LOG_WARN("fail to get ls iterator", K(ret)); } else { do { diff --git a/src/storage/tablet/ob_tablet.cpp b/src/storage/tablet/ob_tablet.cpp index c2b918d83..6d9a5b540 100644 --- a/src/storage/tablet/ob_tablet.cpp +++ b/src/storage/tablet/ob_tablet.cpp @@ -1625,7 +1625,7 @@ int ObTablet::deserialize_post_work(common::ObArenaAllocator &allocator) ObTabletObjLoadHelper::free(arena_allocator, schema); } if (OB_SUCC(ret) && tablet_meta_.has_next_tablet_) { - if (next_tablet_guard_.get_obj()->deserialize_post_work(allocator)) { + if (OB_FAIL(next_tablet_guard_.get_obj()->deserialize_post_work(allocator))) { LOG_WARN("fail to deserialize post work for next tablet", K(ret)); } } diff --git a/src/storage/tx/ob_dup_table_base.cpp b/src/storage/tx/ob_dup_table_base.cpp index 4ce4efd8a..be3be0516 100644 --- a/src/storage/tx/ob_dup_table_base.cpp +++ b/src/storage/tx/ob_dup_table_base.cpp @@ -1371,11 +1371,11 @@ int ObDupTableLeaseRequestP::process() } else if (OB_ISNULL(ls_handle.get_ls())) { ret = OB_ERR_NULL_VALUE; DUP_TABLE_LOG(WARN, "ls pointer is nullptr", K(ret)); - } else if (ls_handle.get_ls()->get_dup_table_ls_handler()->recive_lease_request(arg_)) { - DUP_TABLE_LOG(WARN, "recive_lease_request error", K(ret)); + } else if (OB_FAIL(ls_handle.get_ls()->get_dup_table_ls_handler()->receive_lease_request(arg_))) { + DUP_TABLE_LOG(WARN, "receive_lease_request error", K(ret)); } - DUP_TABLE_LOG(DEBUG, "recive lease request", K(ret), K(arg_)); + DUP_TABLE_LOG(DEBUG, "receive lease request", K(ret), K(arg_)); return ret; } @@ -1394,11 +1394,11 @@ int ObDupTableTsSyncRequestP::process() } else if (OB_ISNULL(ls_handle.get_ls())) { ret = OB_ERR_NULL_VALUE; DUP_TABLE_LOG(WARN, "ls pointer is nullptr", K(ret)); - } else if (ls_handle.get_ls()->get_dup_table_ls_handler()->handle_ts_sync_request(arg_)) { + } else if (OB_FAIL(ls_handle.get_ls()->get_dup_table_ls_handler()->handle_ts_sync_request(arg_))) { DUP_TABLE_LOG(WARN, "handle ts sync request error", K(ret)); } - DUP_TABLE_LOG(DEBUG, "recive ts sync request", K(ret), K(arg_)); + DUP_TABLE_LOG(DEBUG, "receive ts sync request", K(ret), K(arg_)); return ret; } @@ -1418,11 +1418,11 @@ int ObDupTableTsSyncResponseP::process() } else if (OB_ISNULL(ls_handle.get_ls())) { ret = OB_ERR_NULL_VALUE; DUP_TABLE_LOG(WARN, "ls pointer is nullptr", K(ret)); - } else if (ls_handle.get_ls()->get_dup_table_ls_handler()->handle_ts_sync_response(arg_)) { + } else if (OB_FAIL(ls_handle.get_ls()->get_dup_table_ls_handler()->handle_ts_sync_response(arg_))) { DUP_TABLE_LOG(WARN, "handle ts sync request error", K(ret)); } - DUP_TABLE_LOG(DEBUG, "recive ts sync response", K(ret), K(arg_)); + DUP_TABLE_LOG(DEBUG, "receive ts sync response", K(ret), K(arg_)); return ret; } @@ -1460,7 +1460,7 @@ int ObDupTableBeforePrepareRequestP::process() ls_handle.get_ls()->revert_tx_ctx(part_ctx); } - DUP_TABLE_LOG(DEBUG, "recive before prepare request", K(ret), K(arg_)); + DUP_TABLE_LOG(DEBUG, "receive before prepare request", K(ret), K(arg_)); return ret; } diff --git a/src/storage/tx/ob_dup_table_lease.cpp b/src/storage/tx/ob_dup_table_lease.cpp index cfa66e0e0..0e6ae2621 100644 --- a/src/storage/tx/ob_dup_table_lease.cpp +++ b/src/storage/tx/ob_dup_table_lease.cpp @@ -71,7 +71,7 @@ void ObDupTableLSLeaseMgr::reset() lease_diag_info_log_buf_ = nullptr; } -int ObDupTableLSLeaseMgr::recive_lease_request(const ObDupTableLeaseRequest &lease_req) +int ObDupTableLSLeaseMgr::receive_lease_request(const ObDupTableLeaseRequest &lease_req) { int ret = OB_SUCCESS; SpinWLockGuard guard(lease_lock_); @@ -89,7 +89,7 @@ int ObDupTableLSLeaseMgr::recive_lease_request(const ObDupTableLeaseRequest &lea DUP_TABLE_LOG(INFO, "first lease request from the new dup_table follower", K(ret), K(lease_req)); } } else if (tmp_lease_info.cache_lease_req_.is_ready()) { - DUP_TABLE_LOG(INFO, "leader lease info is logging which can not recive new lease request", + DUP_TABLE_LOG(INFO, "leader lease info is logging which can not receive new lease request", K(lease_req.get_src())); } else if (tmp_lease_info.cache_lease_req_.request_ts_ < lease_req.get_request_ts()) { // renew request ts before submit lease log diff --git a/src/storage/tx/ob_dup_table_lease.h b/src/storage/tx/ob_dup_table_lease.h index 233a3ecc0..1b7c819fa 100644 --- a/src/storage/tx/ob_dup_table_lease.h +++ b/src/storage/tx/ob_dup_table_lease.h @@ -60,7 +60,7 @@ public: int follower_try_acquire_lease(const share::SCN &lease_log_scn); - int recive_lease_request(const ObDupTableLeaseRequest &lease_req); + int receive_lease_request(const ObDupTableLeaseRequest &lease_req); int leader_takeover(bool is_resume); int leader_revoke(); diff --git a/src/storage/tx/ob_dup_table_ts_sync.h b/src/storage/tx/ob_dup_table_ts_sync.h index 8cb316ee7..0eb5ca2eb 100644 --- a/src/storage/tx/ob_dup_table_ts_sync.h +++ b/src/storage/tx/ob_dup_table_ts_sync.h @@ -32,7 +32,7 @@ struct DupTableTsInfo share::SCN max_replayed_scn_; share::SCN max_read_version_; share::SCN max_commit_version_; - // TODO last recive time + // TODO last receive time DupTableTsInfo() { reset(); } void reset() diff --git a/src/storage/tx/ob_dup_table_util.cpp b/src/storage/tx/ob_dup_table_util.cpp index 1d39303b2..c21a7080f 100644 --- a/src/storage/tx/ob_dup_table_util.cpp +++ b/src/storage/tx/ob_dup_table_util.cpp @@ -674,7 +674,7 @@ int ObDupTableLSHandler::refresh_dup_table_tablet(common::ObTabletID tablet_id, return ret; } -int ObDupTableLSHandler::recive_lease_request(const ObDupTableLeaseRequest &lease_req) +int ObDupTableLSHandler::receive_lease_request(const ObDupTableLeaseRequest &lease_req) { int ret = OB_SUCCESS; if (!is_inited() || OB_ISNULL(lease_mgr_ptr_) || OB_ISNULL(ts_sync_mgr_ptr_)) { @@ -682,11 +682,11 @@ int ObDupTableLSHandler::recive_lease_request(const ObDupTableLeaseRequest &leas DUP_TABLE_LOG(WARN, "DupTableLSHandler not init", K(ret), K(is_inited_), KP(lease_mgr_ptr_)); } else if (!ls_state_helper_.is_leader_serving()) { ret = OB_NOT_MASTER; - DUP_TABLE_LOG(WARN, "No need to recive lease request", K(ret), K(lease_req), KPC(this)); + DUP_TABLE_LOG(WARN, "No need to receive lease request", K(ret), K(lease_req), KPC(this)); } else if (OB_FAIL(ts_sync_mgr_ptr_->handle_ts_sync_response(lease_req))) { DUP_TABLE_LOG(WARN, "handle ts sync response failed", K(ret)); - } else if (OB_FAIL(lease_mgr_ptr_->recive_lease_request(lease_req))) { - DUP_TABLE_LOG(WARN, "recive lease request failed", K(ret), K(lease_req)); + } else if (OB_FAIL(lease_mgr_ptr_->receive_lease_request(lease_req))) { + DUP_TABLE_LOG(WARN, "receive lease request failed", K(ret), K(lease_req)); } return ret; } diff --git a/src/storage/tx/ob_dup_table_util.h b/src/storage/tx/ob_dup_table_util.h index f1830990a..30e478f01 100644 --- a/src/storage/tx/ob_dup_table_util.h +++ b/src/storage/tx/ob_dup_table_util.h @@ -144,7 +144,7 @@ public: bool is_dup_table, int64_t refresh_time); // called by rpc thread - int recive_lease_request(const ObDupTableLeaseRequest &lease_req); + int receive_lease_request(const ObDupTableLeaseRequest &lease_req); int handle_ts_sync_response(const ObDupTableTsSyncResponse &ts_sync_reps); // called by part_ctx // int validate_dup_table_tablet(const ObTabletID &tablet_id, bool &is_dup_tablet); diff --git a/src/storage/tx/ob_two_phase_committer.h b/src/storage/tx/ob_two_phase_committer.h index a99e79753..d23fa7a1e 100644 --- a/src/storage/tx/ob_two_phase_committer.h +++ b/src/storage/tx/ob_two_phase_committer.h @@ -208,7 +208,7 @@ public: virtual int on_abort() = 0; virtual int on_clear() = 0; - // 1. when recive a new request msg, the participant will enter into the next phase. + // 1. when receive a new request msg, the participant will enter into the next phase. // 2. invoke do_xxx to execute all in-memory operation with the next phase // 3. set upstream_state at last // 4. retry submit log if upstream_state is larger than downstream_state diff --git a/src/storage/tx/ob_two_phase_downstream_committer.cpp b/src/storage/tx/ob_two_phase_downstream_committer.cpp index e6956abbb..d5396be0f 100644 --- a/src/storage/tx/ob_two_phase_downstream_committer.cpp +++ b/src/storage/tx/ob_two_phase_downstream_committer.cpp @@ -356,7 +356,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_request_impl_() { switch (get_2pc_role()) { case Ob2PCRole::ROOT: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The root should not recive prepare request", K(ret), KPC(this)); + TRANS_LOG(WARN, "The root should not receive prepare request", K(ret), KPC(this)); break; } case Ob2PCRole::INTERNAL: { @@ -440,7 +440,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_commit_request_impl_() switch (get_2pc_role()) { case Ob2PCRole::ROOT: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The root should not recive commit request", K(ret), KPC(this)); + TRANS_LOG(WARN, "The root should not receive commit request", K(ret), KPC(this)); break; } case Ob2PCRole::INTERNAL: { @@ -539,7 +539,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_abort_request_impl_() switch (get_2pc_role()) { case Ob2PCRole::ROOT: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The root should not recive 2pc abort request", K(ret), KPC(this)); + TRANS_LOG(WARN, "The root should not receive 2pc abort request", K(ret), KPC(this)); break; } case Ob2PCRole::INTERNAL: { @@ -680,7 +680,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_clear_request_impl_() switch (get_2pc_role()) { case Ob2PCRole::ROOT: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The root should not recive clear request", K(ret), KPC(this)); + TRANS_LOG(WARN, "The root should not receive clear request", K(ret), KPC(this)); break; } case Ob2PCRole::INTERNAL: { diff --git a/src/storage/tx/ob_two_phase_upstream_committer.cpp b/src/storage/tx/ob_two_phase_upstream_committer.cpp index 972d8d12d..783310f84 100644 --- a/src/storage/tx/ob_two_phase_upstream_committer.cpp +++ b/src/storage/tx/ob_two_phase_upstream_committer.cpp @@ -525,7 +525,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_prepare_response_impl_(const int64_t } case Ob2PCRole::LEAF: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The leaf should not recive prepare response", K(ret), K(participant), + TRANS_LOG(WARN, "The leaf should not receive prepare response", K(ret), K(participant), KPC(this)); break; } @@ -687,7 +687,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_ack_response_impl_(const int64_t part } case Ob2PCRole::LEAF: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The leaf should not recive ack response", K(ret), K(participant), KPC(this)); + TRANS_LOG(WARN, "The leaf should not receive ack response", K(ret), K(participant), KPC(this)); break; } default: { @@ -742,7 +742,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_abort_response_impl_(const int64_t pa } case Ob2PCRole::LEAF: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The leaf should not recive abort response", K(ret), K(participant), + TRANS_LOG(WARN, "The leaf should not receive abort response", K(ret), K(participant), KPC(this)); break; } @@ -853,7 +853,7 @@ int ObTxCycleTwoPhaseCommitter::handle_2pc_pre_commit_response_impl_(const int64 } case Ob2PCRole::LEAF: { ret = OB_ERR_UNEXPECTED; - TRANS_LOG(WARN, "The leaf should not recive pre_commit response", K(ret), K(participant), + TRANS_LOG(WARN, "The leaf should not receive pre_commit response", K(ret), K(participant), KPC(this)); break; } @@ -974,7 +974,7 @@ int ObTxCycleTwoPhaseCommitter::collect_downstream_(const int64_t participant) case Ob2PCRole::ROOT: case Ob2PCRole::INTERNAL: { if (participant == get_self_id()) { - TRANS_LOG(WARN, "recive self 2pc msg", K(participant), KPC(this)); + TRANS_LOG(WARN, "receive self 2pc msg", K(participant), KPC(this)); } else { ret = collected_.add_member(participant); } diff --git a/src/storage/tx/ob_tx_loop_worker.cpp b/src/storage/tx/ob_tx_loop_worker.cpp index a26674649..64e82ebe4 100644 --- a/src/storage/tx/ob_tx_loop_worker.cpp +++ b/src/storage/tx/ob_tx_loop_worker.cpp @@ -232,7 +232,7 @@ void ObTxLoopWorker::do_keep_alive_(ObLS *ls_ptr, const SCN &min_start_scn, MinS { int ret = OB_SUCCESS; - if (ls_ptr->get_keep_alive_ls_handler()->try_submit_log(min_start_scn, status)) { + if (OB_FAIL(ls_ptr->get_keep_alive_ls_handler()->try_submit_log(min_start_scn, status))) { TRANS_LOG(WARN, "[Tx Loop Worker] try submit keep alive log failed", K(ret)); } else if (REACH_TIME_INTERVAL(KEEP_ALIVE_PRINT_INFO_INTERVAL)) { ls_ptr->get_keep_alive_ls_handler()->print_stat_info(); @@ -294,7 +294,7 @@ void ObTxLoopWorker::do_retain_ctx_gc_(ObLS *ls_ptr) TRANS_LOG(WARN, "[Tx Loop Worker] retain_ctx_mgr is not inited", K(ret), K(MTL_ID()), K(*ls_ptr)); - } else if (retain_ctx_mgr->try_gc_retain_ctx(ls_ptr)) { + } else if (OB_FAIL(retain_ctx_mgr->try_gc_retain_ctx(ls_ptr))) { TRANS_LOG(WARN, "[Tx Loop Worker] retain_ctx_mgr try to gc retain ctx failed", K(ret), K(MTL_ID()), K(*ls_ptr)); } else { diff --git a/src/storage/tx/ob_tx_msg.h b/src/storage/tx/ob_tx_msg.h index b2f62f084..64cdacfea 100644 --- a/src/storage/tx/ob_tx_msg.h +++ b/src/storage/tx/ob_tx_msg.h @@ -365,7 +365,7 @@ namespace transaction {} public: //set commit_version when the root participant - //which recover from prepare log recive a pre_commit response + //which recover from prepare log receive a pre_commit response //because the coord_state_ will be set as pre_commit share::SCN commit_version_; bool is_valid() const; diff --git a/src/storage/tx/ob_tx_replay_executor.cpp b/src/storage/tx/ob_tx_replay_executor.cpp index 0be823dc2..e8b86a3f1 100644 --- a/src/storage/tx/ob_tx_replay_executor.cpp +++ b/src/storage/tx/ob_tx_replay_executor.cpp @@ -310,7 +310,7 @@ int ObTxReplayExecutor::before_replay_redo_() const bool parallel_replay = !is_tx_log_replay_queue(); if (OB_ISNULL(ctx_) || OB_ISNULL(mt_ctx_ = ctx_->get_memtable_ctx())) { ret = OB_INVALID_ARGUMENT; - } else if (mt_ctx_->replay_begin(parallel_replay, log_ts_ns_)) { + } else if (OB_FAIL(mt_ctx_->replay_begin(parallel_replay, log_ts_ns_))) { TRANS_LOG(ERROR, "[Replay Tx] replay_begin fail or mt_ctx_ is NULL", K(ret), K(mt_ctx_)); } else { has_redo_ = true;