提交 a336d376 编写于 作者: O obdev 提交者: ob-robot

fix some restore bug and add print info

上级 63a9bb62
......@@ -1269,7 +1269,13 @@ int ObLogArchivePieceContext::get_max_log_in_piece_(const ObLogArchivePieceConte
if (OB_FAIL(get_piece_meta_info_(piece_id))) {
ARCHIVE_LOG(WARN, "get piece meta info failed", K(ret), K_(id), K_(round_context), K(piece_id));
} else if (OB_FAIL(get_piece_file_range_())) {
ARCHIVE_LOG(WARN, "get piece file range failed", K(ret));
if (OB_ITER_END == ret) {
ret = OB_SUCCESS;
exist = false;
// no file exist in this piece, return OB_SUCCESS
} else {
ARCHIVE_LOG(WARN, "get piece file range failed", K(ret));
}
} else if (inner_piece_context_.is_empty_() || inner_piece_context_.max_file_id_ == 0) {
ARCHIVE_LOG(INFO, "no file exist in piece, just skip", K(ret), K_(id), K_(round_context), K_(inner_piece_context));
} else {
......
......@@ -330,39 +330,42 @@ int ObRemoteFetchWorker::handle_fetch_log_task_(ObFetchLogTask *task)
return ret;
}
int ObRemoteFetchWorker::submit_entries_(const ObLSID &id,
const int64_t proposal_id,
const palf::LSN &base_lsn,
ObRemoteLogGroupEntryIterator &iter)
int ObRemoteFetchWorker::submit_entries_(ObFetchLogTask &task)
{
int ret = OB_SUCCESS;
LogGroupEntry entry;
const char *buf = NULL;
int64_t size = 0;
LSN lsn;
const ObLSID &id = task.id_;
while (OB_SUCC(ret) && ! has_set_stop()) {
bool quota_done = false;
if (OB_FAIL(iter.next(entry, lsn, buf, size))) {
if (OB_FAIL(task.iter_.next(entry, lsn, buf, size))) {
if (OB_ITER_END != ret) {
LOG_WARN("ObRemoteLogIterator next failed", K(ret), K(iter));
LOG_WARN("ObRemoteLogIterator next failed", K(task));
} else {
LOG_TRACE("ObRemoteLogIterator to end", K(iter));
LOG_TRACE("ObRemoteLogIterator to end", K(task.iter_));
}
} else if (OB_UNLIKELY(! entry.check_integrity())) {
ret = OB_INVALID_DATA;
LOG_WARN("entry is invalid", K(ret), K(entry), K(lsn), K(iter));
} else if (base_lsn > lsn) {
LOG_INFO("repeated log, just skip", K(ret), K(id), K(lsn), K(base_lsn), K(entry));
LOG_WARN("entry is invalid", K(entry), K(lsn), K(task));
} else if (task.cur_lsn_ > lsn) {
LOG_INFO("repeated log, just skip", K(lsn), K(entry), K(task));
} else if (OB_FAIL(wait_restore_quota_(entry.get_serialize_size(), quota_done))) {
LOG_WARN("wait restore quota failed", K(ret), K(entry));
LOG_WARN("wait restore quota failed", K(entry), K(task));
} else if (! quota_done) {
break;
} else if (OB_FAIL(submit_log_(id, proposal_id, lsn,
} else if (OB_FAIL(submit_log_(id, task.proposal_id_, lsn,
entry.get_scn(), buf, entry.get_serialize_size()))) {
LOG_WARN("submit log failed", K(ret), K(iter), K(buf), K(entry), K(lsn));
LOG_WARN("submit log failed", K(buf), K(entry), K(lsn), K(task));
} else {
task.cur_lsn_ = lsn + entry.get_serialize_size();
}
} // while
if (OB_ITER_END == ret) {
if (lsn.is_valid()) {
LOG_INFO("submit_entries_ succ", K(id), K(lsn), K(entry.get_scn()), K(task));
}
ret = OB_SUCCESS;
}
return ret;
......@@ -520,8 +523,7 @@ int ObRemoteFetchWorker::foreach_ls_(const ObLSID &id)
}
} else if (NULL == task) {
break;
} else if (OB_FAIL(submit_entries_(task->id_, task->proposal_id_,
task->cur_lsn_, task->iter_))) {
} else if (OB_FAIL(submit_entries_(*task))) {
if (OB_RESTORE_LOG_TO_END != ret) {
LOG_WARN("submit_entries_ failed", K(ret), KPC(task));
}
......
......@@ -78,8 +78,7 @@ private:
void do_thread_task_();
int handle_single_task_();
int handle_fetch_log_task_(ObFetchLogTask *task);
int submit_entries_(const ObLSID &id, const int64_t proposal_id, const palf::LSN &base_lsn,
ObRemoteLogGroupEntryIterator &iter);
int submit_entries_(ObFetchLogTask &task);
int submit_log_(const ObLSID &id, const int64_t proposal_id, const LSN &lsn,
const share::SCN &scn, const char *buf, const int64_t buf_size);
int wait_restore_quota_(const int64_t size, bool &done);
......
......@@ -35,7 +35,7 @@ struct ObBackupLeaseInfo
static const int64_t MAX_LEASE_TIME = 30 * 1000 * 1000;
static const int64_t MAX_LEASE_TAKEOVER_TIME = 10 * 60 * 1000 * 1000L;
static const int64_t MAX_LEASE_TAKEOVER_TIME = 10 * 1000 * 1000L;
ObBackupLeaseInfo();
void reset();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册