[CP] [opt] optimize the receive_batch_log interface by removing some useless logs

This commit is contained in:
BinChenn 2023-10-17 03:43:40 +00:00 committed by ob-robot
parent 5b2c194ed8
commit 6f8e3be562
3 changed files with 16 additions and 10 deletions

View File

@ -774,7 +774,7 @@ int LogIteratorImpl<ENTRY>::verify_accum_checksum_(const LogGroupEntry &entry,
PALF_LOG(WARN, "invalid data", K(ret), KPC(this), K(entry));
} else if (-1 == accumulate_checksum_) {
new_accumulate_checksum = expected_verify_checksum;
PALF_LOG(INFO, "init accumulate_checksum to first LogGroupEntry", K(entry), KPC(this),
PALF_LOG(TRACE, "init accumulate_checksum to first LogGroupEntry", K(entry), KPC(this),
K(new_accumulate_checksum));
} else if (OB_FAIL(LogChecksum::verify_accum_checksum(
accumulate_checksum_, data_checksum,

View File

@ -3095,15 +3095,19 @@ int PalfHandleImpl::receive_batch_log(const common::ObAddr &server,
int64_t curr_log_proposal_id = 0;
const char *buf_each_round = NULL;
int64_t buf_len_each_round = 0;
int64_t count = 0;
int64_t count = 0, success_count = 0;
while (OB_SUCC(iterator.next())) {
if (OB_FAIL(iterator.get_entry(buf_each_round, buf_len_each_round, curr_lsn_each_round, curr_log_proposal_id))) {
PALF_LOG(ERROR, "get_entry failed", K(ret), KPC(this), K(iterator), KP(buf_each_round));
} else if (OB_FAIL(receive_log_(server, FETCH_LOG_RESP, msg_proposal_id, prev_lsn_each_round,
prev_log_proposal_id_each_round, curr_lsn_each_round, buf_each_round, buf_len_each_round))) {
PALF_LOG(WARN, "receive_log failed", K(ret), KPC(this), K(iterator), K(server), K(FETCH_LOG_RESP), K(msg_proposal_id),
K(prev_lsn_each_round), K(prev_log_proposal_id_each_round), K(curr_lsn_each_round), KP(buf_each_round),
K(buf_len_each_round));
if (REACH_TIME_INTERVAL(100 * 1000)) {
PALF_LOG(WARN, "receive_log failed", K(ret), KPC(this), K(iterator), K(server), K(FETCH_LOG_RESP),
K(msg_proposal_id), K(prev_lsn_each_round), K(prev_log_proposal_id_each_round),
K(curr_lsn_each_round), KP(buf_each_round), K(buf_len_each_round));
}
} else {
success_count++;
}
prev_lsn_each_round = curr_lsn_each_round;
prev_log_proposal_id_each_round = curr_log_proposal_id;
@ -3112,9 +3116,11 @@ int PalfHandleImpl::receive_batch_log(const common::ObAddr &server,
if (OB_ITER_END == ret) {
ret = OB_SUCCESS;
}
int64_t cost_ts = ObTimeUtility::current_time() - start_ts;
PALF_LOG(TRACE, "receive_batch_log finished", K(ret), KPC(this), K(server), K(count), K(prev_lsn), K(curr_lsn),
K(buf_len), K(cost_ts), K_(sw), K(iterator));
int64_t cost_us = ObTimeUtility::current_time() - start_ts;
if (cost_us > 200 * 1000) {
PALF_LOG(INFO, "receive_batch_log cost too much time", K(ret), KPC(this), K(server), K(count),
K(success_count), K(cost_us), K(prev_lsn), K(curr_lsn), K(buf_len), K_(sw), K(iterator));
}
}
return ret;
}

View File

@ -41,7 +41,7 @@ public:
} else if (OB_FAIL(do_init_(start_offset, get_file_end_lsn, get_mode_version, log_storage))) {
PALF_LOG(WARN, "PalfIterator init failed", K(ret));
} else {
PALF_LOG(INFO, "PalfIterator init success", K(ret), K(start_offset), KPC(this));
PALF_LOG(TRACE, "PalfIterator init success", K(ret), K(start_offset), KPC(this));
is_inited_ = true;
}
return ret;
@ -264,7 +264,7 @@ private:
} else if (OB_FAIL(iterator_impl_.init(get_mode_version, &iterator_storage_))) {
PALF_LOG(WARN, "PalfIterator init failed", K(ret));
} else {
PALF_LOG(INFO, "PalfIterator init success", K(ret), K(start_offset), KPC(this));
PALF_LOG(TRACE, "PalfIterator init success", K(ret), K(start_offset), KPC(this));
is_inited_ = true;
}
return ret;