[CP] [fix] avoid loop when registering parents for R replicas

This commit is contained in:
BinChenn
2024-02-09 18:22:56 +00:00
committed by ob-robot
parent f6fb5771e8
commit 40b6cab3fa
3 changed files with 151 additions and 3 deletions

View File

@ -2711,6 +2711,16 @@ int LogConfigMgr::check_parent_health()
if (IS_NOT_INIT) {
ret = OB_NOT_INIT;
} else {
{
SpinLockGuard parent_guard(parent_lock_);
SpinLockGuard child_guard(child_lock_);
// break learner loop
if (parent_.is_valid() &&
children_.contains(parent_) &&
OB_FAIL(retire_parent_())) {
PALF_LOG(WARN, "retire_parent_ failed", KR(ret), K_(palf_id), K_(self));
}
}
SpinLockGuard guard(parent_lock_);
const int64_t curr_time_us = common::ObTimeUtility::current_time();
const bool is_registering_timeout = (is_registering_() && curr_time_us - last_submit_register_req_time_us_ > PALF_CHILD_RESEND_REGISTER_INTERVAL_US);

View File

@ -596,7 +596,6 @@ private:
int pre_sync_config_log_and_mode_meta_(const common::ObMember &server,
const int64_t proposal_id,
const bool is_arb_replica);
private:
// inner_config_meta_ is protected by RWLock in PalfHandleImpl,
// any read/write ops to inner_config_meta_ should acquire RLock/WLock in PalfHandleImpl.