[OBCDC] fix a bug when fetch missing log time out
This commit is contained in:
@ -839,6 +839,7 @@ int ObCdcFetcher::do_fetch_missing_log_(const obrpc::ObCdcLSFetchMissLogReq &req
|
|||||||
resp.set_next_miss_lsn(missing_lsn);
|
resp.set_next_miss_lsn(missing_lsn);
|
||||||
int64_t start_fetch_ts = ObTimeUtility::current_time();
|
int64_t start_fetch_ts = ObTimeUtility::current_time();
|
||||||
bool log_fetched_in_palf = false;
|
bool log_fetched_in_palf = false;
|
||||||
|
bool log_fetched_in_archive = false;
|
||||||
|
|
||||||
if (is_time_up_(fetched_log_count, end_tstamp)) { // time up, stop fetching logs globally
|
if (is_time_up_(fetched_log_count, end_tstamp)) { // time up, stop fetching logs globally
|
||||||
frt.stop("TimeUP");
|
frt.stop("TimeUP");
|
||||||
@ -863,10 +864,12 @@ int ObCdcFetcher::do_fetch_missing_log_(const obrpc::ObCdcLSFetchMissLogReq &req
|
|||||||
if (OB_FAIL(fetch_log_in_archive_(ls_id, remote_iter, missing_lsn,
|
if (OB_FAIL(fetch_log_in_archive_(ls_id, remote_iter, missing_lsn,
|
||||||
need_init_iter, log_entry, lsn, ctx))) {
|
need_init_iter, log_entry, lsn, ctx))) {
|
||||||
LOG_WARN("fetch missng log in archive failed", KR(ret), K(missing_lsn));
|
LOG_WARN("fetch missng log in archive failed", KR(ret), K(missing_lsn));
|
||||||
|
} else {
|
||||||
|
log_fetched_in_archive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret) && (log_fetched_in_palf || log_fetched_in_archive)) {
|
||||||
if (OB_UNLIKELY(missing_lsn != lsn)) {
|
if (OB_UNLIKELY(missing_lsn != lsn)) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_WARN("do_fetch_missing_log missing_lsn not match", KR(ret), K(tenant_id_), K(ls_id),
|
LOG_WARN("do_fetch_missing_log missing_lsn not match", KR(ret), K(tenant_id_), K(ls_id),
|
||||||
@ -892,6 +895,7 @@ int ObCdcFetcher::do_fetch_missing_log_(const obrpc::ObCdcLSFetchMissLogReq &req
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // for
|
} // for
|
||||||
} // else
|
} // else
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user