[DETECT] Add handle timout log

This commit is contained in:
Handora
2023-09-14 03:40:13 +00:00
committed by ob-robot
parent 0c6b823cc8
commit 691cbc7f91
6 changed files with 35 additions and 2 deletions

View File

@ -1306,5 +1306,10 @@ int ObMemtableCtx::check_tx_mem_size_overflow(bool &is_overflow)
return ret;
}
void ObMemtableCtx::print_first_mvcc_callback()
{
log_gen_.print_first_mvcc_callback();
}
}
}

View File

@ -485,6 +485,8 @@ public:
return trans_mgr_.get_callback_remove_for_fast_commit_count() > 0 ||
trans_mgr_.get_callback_remove_for_remove_memtable_count() > 0;
}
void print_first_mvcc_callback();
private:
int do_trans_end(
const bool commit,

View File

@ -291,6 +291,24 @@ void ObRedoLogGenerator::sync_log_fail(const ObCallbackScope &callbacks)
}
}
void ObRedoLogGenerator::print_first_mvcc_callback()
{
int ret = OB_SUCCESS;
if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
} else {
ObTransCallbackMgr::RDLockGuard guard(callback_mgr_->get_rwlock());
ObITransCallbackIterator cursor = generate_cursor_ + 1;
if (callback_mgr_->end() != cursor) {
ObITransCallback *iter = (ObITransCallback *)*cursor;
LOG_DBA_WARN(OB_TRANS_LIVE_TOO_MUCH_TIME,
"msg",
"transaction live cost too much time without commit or abort",
KPC(iter));
}
}
}
int ObRedoLogGenerator::fill_row_redo(ObITransCallbackIterator &cursor,
ObMutatorWriter &mmw,
RedoDataNode &redo,
@ -429,4 +447,3 @@ void ObRedoLogGenerator::bug_detect_for_logging_blocked_()
}; // end namespace memtable
}; // end namespace oceanbase

View File

@ -88,6 +88,7 @@ public:
int64_t get_redo_filled_count() const { return redo_filled_cnt_; }
int64_t get_redo_sync_succ_count() const { return redo_sync_succ_cnt_; }
int64_t get_redo_sync_fail_count() const { return redo_sync_fail_cnt_; }
void print_first_mvcc_callback();
private:
int fill_row_redo(ObITransCallbackIterator &cursor,
ObMutatorWriter &mmw,

View File

@ -536,6 +536,7 @@ int ObPartTransCtx::handle_timeout(const int64_t delay)
}
} else {
if (now >= ctx_create_time_ + OB_TRANS_WARN_USE_TIME) {
print_first_mvcc_callback_();
tmp_ret = OB_TRANS_LIVE_TOO_MUCH_TIME;
LOG_DBA_WARN(OB_TRANS_LIVE_TOO_MUCH_TIME,
"msg", "transaction live cost too much time without commit or abort",
@ -8270,5 +8271,10 @@ int ObPartTransCtx::handle_ask_tx_state_for_4377(bool &is_alive)
return ret;
}
void ObPartTransCtx::print_first_mvcc_callback_()
{
mt_ctx_.print_first_mvcc_callback();
}
} // namespace transaction
} // namespace oceanbase

View File

@ -253,7 +253,8 @@ private:
K_(prev_rec_log_ts),
K_(lastest_snapshot),
K_(state_info_array),
K_(last_request_ts));
K_(last_request_ts),
KP_(block_frozen_memtable));
public:
static const int64_t OP_LOCAL_NUM = 16;
static const int64_t RESERVED_MEM_SIZE = 256;
@ -756,6 +757,7 @@ private:
int get_ls_replica_readable_scn_(const ObLSID &ls_id, SCN &snapshot_version);
int check_and_submit_redo_log_(bool &try_submit);
int submit_redo_log_for_freeze_(bool &try_submit);
void print_first_mvcc_callback_();
protected:
// for xa
virtual bool is_sub2pc() const override