[CP] Fix performance reduction and reduce the log frequency for wrs and hotspot update

This commit is contained in:
Naynahs
2023-10-08 08:10:19 +00:00
committed by ob-robot
parent 9ad9da08b3
commit b48202aa11
6 changed files with 20 additions and 10 deletions

View File

@ -49,7 +49,6 @@ ObMemtableCtx::ObMemtableCtx()
ref_(0),
query_allocator_(),
ctx_cb_allocator_(),
log_conflict_interval_(LOG_CONFLICT_INTERVAL),
ctx_(NULL),
truncate_cnt_(0),
lock_for_read_retry_count_(0),
@ -141,8 +140,6 @@ void ObMemtableCtx::reset()
unsynced_cnt_ = 0;
unsubmitted_cnt_ = 0;
lock_mem_ctx_.reset();
//FIXME: ctx_ is not reset
log_conflict_interval_.reset();
mtstat_.reset();
trans_mgr_.reset();
log_gen_.reset();
@ -303,7 +300,9 @@ void ObMemtableCtx::on_wlock_retry(const ObMemtableKey& key, const transaction::
{
mtstat_.on_wlock_retry();
#define USING_LOG_PREFIX TRANS
FLOG_INFO("mvcc_write conflict", K(key), "tx_id", get_tx_id(), K(conflict_tx_id), KPC(this));
if (mtstat_.need_print()) {
FLOG_INFO("mvcc_write conflict", K(key), "tx_id", get_tx_id(), K(conflict_tx_id), KPC(this));
}
#undef USING_LOG_PREFIX
}
@ -313,7 +312,7 @@ void ObMemtableCtx::on_tsc_retry(const ObMemtableKey& key,
const transaction::ObTransID &conflict_tx_id)
{
mtstat_.on_tsc_retry();
if (log_conflict_interval_.reach()) {
if (mtstat_.need_print()) {
TRANS_LOG_RET(WARN, OB_SUCCESS, "transaction_set_consistency conflict", K(key), K(snapshot_version), K(max_trans_version), K(conflict_tx_id), KPC(this));
}
}