fix print too much log

This commit is contained in:
dimstars
2022-12-13 08:08:39 +00:00
committed by ob-robot
parent 9f87d6fb3b
commit a468628f8e
5 changed files with 11 additions and 10 deletions

View File

@ -685,9 +685,6 @@ OB_INLINE int ObResultSet::do_close_plan(int errcode, ObExecContext &ctx)
err_ignored = plan_ctx->is_error_ignored();
}
bool rollback = need_rollback(ret, errcode, err_ignored);
if (rollback || OB_SUCCESS != pret) {
SQL_LOG(INFO, "stmt will rollback", K(rollback), K(ret), K(errcode), K(err_ignored), K(pret));
}
sret = end_stmt(rollback || OB_SUCCESS != pret);
// SQL_LOG(INFO, "end_stmt err code", K_(errcode), K(ret), K(pret), K(sret));
// if branch fail is returned from end_stmt, then return it first

View File

@ -274,7 +274,9 @@ ObMvccWriteGuard::~ObMvccWriteGuard()
ctx_->write_done();
if (OB_NOT_NULL(memtable_) && memtable_->is_frozen_memtable()) {
if (OB_FAIL(tx_ctx->submit_redo_log(true/*is_freeze*/))) {
TRANS_LOG(WARN, "failed to submit freeze log", K(ret), KPC(tx_ctx));
if (REACH_TIME_INTERVAL(100 * 1000)) {
TRANS_LOG(WARN, "failed to submit freeze log", K(ret), KPC(tx_ctx));
}
memtable_->get_freezer()->set_need_resubmit_log(true);
}
}

View File

@ -2351,7 +2351,7 @@ int ObPartTransCtx::submit_redo_log_()
// don't need to handle OB_BLOCK_FROZEN ret
if (OB_BLOCK_FROZEN == ret) {
TRANS_LOG(INFO, "submit log meets frozen memtable", KR(ret), K(*this));
} else {
} else if (REACH_TIME_INTERVAL(100 * 1000)) {
TRANS_LOG(WARN, "submit redo log failed", KR(ret), K(*this));
}
} else if (!has_redo) {
@ -3081,7 +3081,7 @@ int ObPartTransCtx::submit_log_impl_(const ObTxLogType log_type)
}
}
if (OB_FAIL(ret)) {
if (OB_FAIL(ret) && REACH_TIME_INTERVAL(100 * 1000)) {
TRANS_LOG(WARN, "submit_log_impl_ failed", KR(ret), K(log_type), K(*this));
} else {
#ifndef NDEBUG
@ -3089,7 +3089,7 @@ int ObPartTransCtx::submit_log_impl_(const ObTxLogType log_type)
#endif
}
if (OB_TX_NOLOGCB == ret) {
if (REACH_COUNT_PER_SEC(10)) {
if (REACH_COUNT_PER_SEC(10) && REACH_TIME_INTERVAL(100 * 1000)) {
TRANS_LOG(INFO, "can not get log_cb when submit_log", KR(ret), K(log_type),
KPC(busy_cbs_.get_first()));
}
@ -3236,7 +3236,7 @@ int ObPartTransCtx::after_submit_log_(ObTxLogBlock &log_block,
int ObPartTransCtx::prepare_log_cb_(const bool need_final_cb, ObTxLogCb *&log_cb)
{
int ret = OB_SUCCESS;
if (OB_FAIL(get_log_cb_(need_final_cb, log_cb))) {
if (OB_FAIL(get_log_cb_(need_final_cb, log_cb)) && REACH_TIME_INTERVAL(100 * 1000)) {
TRANS_LOG(WARN, "failed to get log_cb", KR(ret), K(*this));
}
return ret;

View File

@ -199,7 +199,9 @@ int ObPartTransCtx::check_and_response_scheduler_(int result)
if (!is_sub2pc() && OB_FAIL(ret)) {
// when error inject, response scheduler delayed to CLEAR state
if (ObTxState::CLEAR == get_upstream_state()) {
TRANS_LOG(INFO, "response scheduler in clear state", K(ret), K(*this));
if (REACH_TIME_INTERVAL(1000 * 1000)) {
TRANS_LOG(INFO, "response scheduler in clear state", K(ret), K(*this));
}
ret = OB_SUCCESS;
} else {
return OB_SUCCESS;

View File

@ -531,7 +531,7 @@ void ObTenantWeakReadService::do_thread_task_(const int64_t begin_tstamp,
int64_t &last_print_stat_ts)
{
bool need_print = false;
static const int64_t PRINT_INTERVAL = 500 * 1000L;
static const int64_t PRINT_INTERVAL = 5 * 1000 * 1000L;
if (REACH_TIME_INTERVAL(PRINT_INTERVAL)) {
need_print = true;
} else {