[LOG]fix fallback of max_decided_scn
This commit is contained in:
@ -782,11 +782,13 @@ void ObApplyStatus::reset_proposal_id()
|
||||
CLOG_LOG(INFO, "reset_proposal_id success");
|
||||
}
|
||||
|
||||
void ObApplyStatus::reset_max_applied_scn_meta()
|
||||
void ObApplyStatus::reset_meta()
|
||||
{
|
||||
RLockGuard rlock(lock_);
|
||||
lib::ObMutexGuard guard(mutex_);
|
||||
last_check_scn_.reset();
|
||||
max_applied_cb_scn_.reset();
|
||||
palf_committed_end_lsn_.val_ = 0;
|
||||
}
|
||||
|
||||
int ObApplyStatus::submit_task_to_apply_service_(ObApplyServiceTask &task)
|
||||
|
||||
@ -203,7 +203,8 @@ public:
|
||||
//
|
||||
// NB: this interface only can be used in 'ObLogHandler::offline'.
|
||||
void reset_proposal_id();
|
||||
void reset_max_applied_scn_meta();
|
||||
// NB: this interface only can be used in 'ObLogHandler::online'.
|
||||
void reset_meta();
|
||||
TO_STRING_KV(K(ls_id_),
|
||||
K(role_),
|
||||
K(proposal_id_),
|
||||
|
||||
@ -1645,9 +1645,6 @@ int ObLogHandler::offline()
|
||||
//
|
||||
MEM_BARRIER();
|
||||
is_offline_ = true;
|
||||
//4.Due to the order of ObLogHandle:offline() and ObLSWRSHandler::offline() in ObLS::offline(), we must keep reset_max_applied_scn_meta() after set is_offline_ to true, otherwise ls_wrs_service may
|
||||
//print error log.
|
||||
apply_status_->reset_max_applied_scn_meta();
|
||||
// NB: must ensure on_role_change not fail.
|
||||
if (OB_FAIL(rc_service_->on_role_change(id_))) {
|
||||
CLOG_LOG(WARN, "on_role_change failed", K(ret), KPC(this));
|
||||
@ -1686,6 +1683,10 @@ int ObLogHandler::online(const LSN &lsn, const SCN &scn)
|
||||
} else {
|
||||
WLockGuard guard(lock_);
|
||||
proposal_id_ = INVALID_PROPOSAL_ID;
|
||||
//reset_meta to avoid contributing excessively large max_decided_scn
|
||||
//reset_meta is placed here rather than offline() because after offline, callbacks will be
|
||||
//handled after offline which may refer to palf_committed_end_lsn_
|
||||
apply_status_->reset_meta();
|
||||
is_offline_ = false;
|
||||
// NB: before notify role change service, we need set role to FOLLOWER,
|
||||
// otherwise, role change service may need switch leader to leader.
|
||||
|
||||
Reference in New Issue
Block a user