diff --git a/src/logservice/restoreservice/ob_remote_log_iterator.h b/src/logservice/restoreservice/ob_remote_log_iterator.h index 6b81299ffa..3f19bb1e4a 100644 --- a/src/logservice/restoreservice/ob_remote_log_iterator.h +++ b/src/logservice/restoreservice/ob_remote_log_iterator.h @@ -125,8 +125,7 @@ private: void update_data_gen_max_lsn_(); void advance_data_gen_lsn_(); void mark_source_error_(const int ret_code); - bool need_prepare_buf_(const int ret_code, - int has_retry_count) const; + bool need_prepare_buf_(const int ret_code) const; private: bool inited_; diff --git a/src/logservice/restoreservice/ob_remote_log_iterator.ipp b/src/logservice/restoreservice/ob_remote_log_iterator.ipp index cf2f8c1ddd..c011c08bda 100644 --- a/src/logservice/restoreservice/ob_remote_log_iterator.ipp +++ b/src/logservice/restoreservice/ob_remote_log_iterator.ipp @@ -240,11 +240,10 @@ int ObRemoteLogIterator::next_entry_(LogEntryType &entry, LSN &lsn { int ret = OB_SUCCESS; bool done = false; - int64_t has_retry_count = 0; do { if (OB_FAIL(ret)) { } else if (OB_FAIL(get_entry_(entry, lsn, buf, buf_size))) { - if (need_prepare_buf_(ret, has_retry_count)) { + if (need_prepare_buf_(ret)) { CLOG_LOG(TRACE, "buf not enough, need read data", K(ret), KPC(this)); } else { CLOG_LOG(WARN, "get entry failed", K(ret), KPC(this)); @@ -260,15 +259,13 @@ int ObRemoteLogIterator::next_entry_(LogEntryType &entry, LSN &lsn } } - if (need_prepare_buf_(ret, has_retry_count)) { + if (need_prepare_buf_(ret)) { if (OB_FAIL(prepare_buf_())) { if (OB_ITER_END != ret) { CLOG_LOG(WARN, "prepare buffer failed", K(ret)); } else { CLOG_LOG(TRACE, "prepare buffer to end", K(ret), KPC(this)); } - } else { - has_retry_count++; } } @@ -287,12 +284,9 @@ int ObRemoteLogIterator::next_entry_(LogEntryType &entry, LSN &lsn } template -bool ObRemoteLogIterator::need_prepare_buf_(const int ret_code, - int has_retry_count) const +bool ObRemoteLogIterator::need_prepare_buf_(const int ret_code) const { - const int MAX_RETRY_COUNT = 2; - return OB_BUF_NOT_ENOUGH == ret_code - || (OB_NEED_RETRY == ret_code && has_retry_count < MAX_RETRY_COUNT); + return OB_BUF_NOT_ENOUGH == ret_code || OB_NEED_RETRY == ret_code; } template