Fix OB_NOT_RUNNING Error about virtual tables in trans module
This commit is contained in:
@ -53,9 +53,13 @@ int ObGVTxCtxMgrStat::prepare_start_to_read_()
|
|||||||
SERVER_LOG(ERROR, "cur row cell is NULL", K(ret));
|
SERVER_LOG(ERROR, "cur row cell is NULL", K(ret));
|
||||||
} else if (OB_FAIL(trans_service_->iterate_tx_ctx_mgr_stat(tx_ctx_mgr_stat_iter_))) {
|
} else if (OB_FAIL(trans_service_->iterate_tx_ctx_mgr_stat(tx_ctx_mgr_stat_iter_))) {
|
||||||
SERVER_LOG(WARN, "iterate_tx_ctx_mgr_stat error", K(ret));
|
SERVER_LOG(WARN, "iterate_tx_ctx_mgr_stat error", K(ret));
|
||||||
} else if (!tx_ctx_mgr_stat_iter_.is_ready()) {
|
if (OB_NOT_RUNNING == ret || OB_NOT_INIT == ret) {
|
||||||
SERVER_LOG(WARN, "tx_ctx_mgr_stat_iter_ is not ready");
|
ret = OB_SUCCESS;
|
||||||
ret = OB_ERR_UNEXPECTED;
|
}
|
||||||
|
}
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
} else if (OB_FAIL(tx_ctx_mgr_stat_iter_.set_ready())) {
|
||||||
|
TRANS_LOG(WARN, "tx_ctx_mgr_stat_iter set ready error", KR(ret));
|
||||||
} else {
|
} else {
|
||||||
start_to_read_ = true;
|
start_to_read_ = true;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,8 @@ int ObGVTxLockStat::get_next_tx_lock_stat_(ObTxLockStat &tx_lock_stat)
|
|||||||
tx_lock_stat_iter_.reset();
|
tx_lock_stat_iter_.reset();
|
||||||
if (OB_FAIL(txs_->iterate_tx_lock_stat(ls_id_, tx_lock_stat_iter_))) {
|
if (OB_FAIL(txs_->iterate_tx_lock_stat(ls_id_, tx_lock_stat_iter_))) {
|
||||||
TRANS_LOG(WARN, "iterate_tx_lock_stat error", K(ret), K(ls_id));
|
TRANS_LOG(WARN, "iterate_tx_lock_stat error", K(ret), K(ls_id));
|
||||||
|
} else if (OB_FAIL(tx_lock_stat_iter_.set_ready())) {
|
||||||
|
TRANS_LOG(WARN, "iterate_tx_lock_stat set ready error", KR(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -109,18 +111,22 @@ int ObGVTxLockStat::prepare_start_to_read_()
|
|||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
} else if (OB_FAIL(txs_->iterate_ls_id(ls_id_iter_))) {
|
} else if (OB_FAIL(txs_->iterate_ls_id(ls_id_iter_))) {
|
||||||
TRANS_LOG(WARN, "iterate ls id error", K(ret));
|
TRANS_LOG(WARN, "iterate ls id error", K(ret));
|
||||||
} else if (!ls_id_iter_.is_ready()) {
|
if (OB_NOT_RUNNING == ret || OB_NOT_INIT == ret) {
|
||||||
TRANS_LOG(WARN, "ls_id_iter is not ready");
|
ret = OB_SUCCESS;
|
||||||
ret = OB_ERR_UNEXPECTED;
|
}
|
||||||
|
}
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
} else if (OB_FAIL(ls_id_iter_.set_ready())) {
|
||||||
|
TRANS_LOG(WARN, "ls_id_iter set ready error", KR(ret));
|
||||||
} else if (OB_FAIL(ls_id_iter_.get_next(ls_id_))) {
|
} else if (OB_FAIL(ls_id_iter_.get_next(ls_id_))) {
|
||||||
if (OB_ITER_END != ret) {
|
if (OB_ITER_END != ret) {
|
||||||
TRANS_LOG(WARN, "ls_id_iter get next ls id error", K(ret));
|
TRANS_LOG(WARN, "ls_id_iter get next ls id error", K(ret));
|
||||||
}
|
}
|
||||||
} else if (OB_FAIL(txs_->iterate_tx_lock_stat(ls_id_, tx_lock_stat_iter_))) {
|
} else if (OB_FAIL(txs_->iterate_tx_lock_stat(ls_id_, tx_lock_stat_iter_))) {
|
||||||
TRANS_LOG(WARN, "iterate_tx_lock_stat error", K(ret), K(ls_id_));
|
TRANS_LOG(WARN, "iterate_tx_lock_stat error", K(ret), K(ls_id_));
|
||||||
} else if (!tx_lock_stat_iter_.is_ready()) {
|
// if ls_id_iter_.get_next success, we can believe obTransService is running
|
||||||
TRANS_LOG(WARN, "ls_id_iter is not ready");
|
} else if (OB_FAIL(tx_lock_stat_iter_.set_ready())) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
TRANS_LOG(WARN, "iterate_tx_lock_stat set ready error", KR(ret));
|
||||||
} else {
|
} else {
|
||||||
start_to_read_ = true;
|
start_to_read_ = true;
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,11 @@ int ObGVTxSchedulerStat::process_curr_tenant(common::ObNewRow *&row)
|
|||||||
} else if (!tx_scheduler_stat_iter_.is_ready()) {
|
} else if (!tx_scheduler_stat_iter_.is_ready()) {
|
||||||
if (OB_FAIL(MTL(ObTransService*)->iterate_tx_scheduler_stat(tx_scheduler_stat_iter_))) {
|
if (OB_FAIL(MTL(ObTransService*)->iterate_tx_scheduler_stat(tx_scheduler_stat_iter_))) {
|
||||||
SERVER_LOG(WARN, "iterate transaction scheduler error", KR(ret));
|
SERVER_LOG(WARN, "iterate transaction scheduler error", KR(ret));
|
||||||
|
if (OB_NOT_RUNNING == ret || OB_NOT_INIT == ret) {
|
||||||
|
ret = OB_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
} else if (OB_FAIL(tx_scheduler_stat_iter_.set_ready())) {
|
} else if (OB_FAIL(tx_scheduler_stat_iter_.set_ready())) {
|
||||||
SERVER_LOG(WARN, "ObTransSchedulerIterator set ready error", KR(ret));
|
SERVER_LOG(WARN, "ObTransSchedulerIterator set ready error", KR(ret));
|
||||||
}
|
}
|
||||||
|
@ -2298,8 +2298,6 @@ int ObTransService::iterate_tx_ctx_mgr_stat(ObTxCtxMgrStatIterator &tx_ctx_mgr_s
|
|||||||
ret = OB_NOT_RUNNING;
|
ret = OB_NOT_RUNNING;
|
||||||
} else if (OB_FAIL(tx_ctx_mgr_.iterate_tx_ctx_mgr_stat(self_, tx_ctx_mgr_stat_iter))) {
|
} else if (OB_FAIL(tx_ctx_mgr_.iterate_tx_ctx_mgr_stat(self_, tx_ctx_mgr_stat_iter))) {
|
||||||
TRANS_LOG(WARN, "iterate_tx_ctx_mgr_stat error", KR(ret), K_(self));
|
TRANS_LOG(WARN, "iterate_tx_ctx_mgr_stat error", KR(ret), K_(self));
|
||||||
} else if (OB_FAIL(tx_ctx_mgr_stat_iter.set_ready())) {
|
|
||||||
TRANS_LOG(WARN, "tx_ctx_mgr_stat_iter set ready error", KR(ret));
|
|
||||||
} else {
|
} else {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
@ -2319,11 +2317,8 @@ int ObTransService::iterate_tx_lock_stat(const share::ObLSID& ls_id,
|
|||||||
ret = OB_NOT_RUNNING;
|
ret = OB_NOT_RUNNING;
|
||||||
} else if (OB_FAIL(tx_ctx_mgr_.iterate_ls_tx_lock_stat(ls_id, tx_lock_stat_iter))) {
|
} else if (OB_FAIL(tx_ctx_mgr_.iterate_ls_tx_lock_stat(ls_id, tx_lock_stat_iter))) {
|
||||||
TRANS_LOG(WARN, "iterate_tx_lock_stat error", KR(ret));
|
TRANS_LOG(WARN, "iterate_tx_lock_stat error", KR(ret));
|
||||||
} else if (OB_FAIL(tx_lock_stat_iter.set_ready())) {
|
|
||||||
TRANS_LOG(WARN, "iterate_tx_lock_stat set ready error", KR(ret));
|
|
||||||
} else {
|
} else {
|
||||||
// do nothing
|
// do nothing
|
||||||
TRANS_LOG(INFO, "iterate_tx_lock_stat set ready succ", KR(ret));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -2341,8 +2336,6 @@ int ObTransService::iterate_ls_id(ObLSIDIterator &ls_id_iter)
|
|||||||
ret = OB_NOT_RUNNING;
|
ret = OB_NOT_RUNNING;
|
||||||
} else if (OB_FAIL(tx_ctx_mgr_.iterate_ls_id(ls_id_iter))) {
|
} else if (OB_FAIL(tx_ctx_mgr_.iterate_ls_id(ls_id_iter))) {
|
||||||
TRANS_LOG(WARN, "iterate ls id error", KR(ret));
|
TRANS_LOG(WARN, "iterate ls id error", KR(ret));
|
||||||
} else if (OB_FAIL(ls_id_iter.set_ready())) {
|
|
||||||
TRANS_LOG(WARN, "ls_id_iter set ready error", KR(ret));
|
|
||||||
} else {
|
} else {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user