fix primary leader sync log timeout issue in max protect mode.
This commit is contained in:
parent
87b97c82a1
commit
ab743ff0d3
@ -1491,7 +1491,30 @@ int ObPartitionLogService::receive_log(const ObLogEntry& log_entry, const ObAddr
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
RLockGuard guard(lock_);
|
||||
if (cluster_id != state_mgr_.get_self_cluster_id() && STANDBY_LEADER != state_mgr_.get_role()) {
|
||||
// check src server
|
||||
const common::ObAddr parent = cascading_mgr_.get_parent_addr();
|
||||
bool is_valid_src = false;
|
||||
if (!parent.is_valid() || server == parent || cascading_mgr_.is_in_reregister_period()) {
|
||||
// When my parent is invalid(may be migrating dest) or src is my parent or
|
||||
// I'm in reregister period, I can receive log.
|
||||
is_valid_src = true;
|
||||
}
|
||||
|
||||
if (!is_valid_src) {
|
||||
// sender is not valid src, cannot receive log
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
CLOG_LOG(WARN,
|
||||
"sender is an unexpected src, cannot receive log",
|
||||
K_(partition_key),
|
||||
K(ret),
|
||||
K(server),
|
||||
K(proposal_id),
|
||||
K(cluster_id),
|
||||
K(type),
|
||||
K(parent),
|
||||
"self_cluster_id",
|
||||
state_mgr_.get_self_cluster_id());
|
||||
} else if (cluster_id != state_mgr_.get_self_cluster_id() && STANDBY_LEADER != state_mgr_.get_role()) {
|
||||
// only STANDBY_LEADER can receive logs from different cluster
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
CLOG_LOG(WARN,
|
||||
|
@ -8142,15 +8142,17 @@ int ObPartitionService::nonblock_get_strong_leader_from_loc_cache(
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
const int64_t expire_renew_time = 0;
|
||||
if (OB_SUCCESS != (tmp_ret = location_cache_->nonblock_renew(pkey, expire_renew_time, cluster_id))) {
|
||||
STORAGE_LOG(WARN, "nonblock_renew failed", K(pkey), K(tmp_ret));
|
||||
STORAGE_LOG(WARN, "nonblock_renew failed", K(pkey), K(tmp_ret), K(cluster_id));
|
||||
} else {
|
||||
STORAGE_LOG(DEBUG, "nonblock_renew success", K(pkey));
|
||||
if (REACH_TIME_INTERVAL(1000 * 1000)) {
|
||||
STORAGE_LOG(INFO, "nonblock_renew success", K(pkey), K(cluster_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OB_FAIL(location_cache_->nonblock_get_strong_leader_without_renew(pkey, leader, cluster_id))) {
|
||||
STORAGE_LOG(DEBUG, "nonblock_get_strong_leader_without_renew failed", K(pkey), K(ret));
|
||||
STORAGE_LOG(DEBUG, "nonblock_get_strong_leader_without_renew failed", K(pkey), K(cluster_id), K(ret));
|
||||
} else {
|
||||
STORAGE_LOG(DEBUG, "nonblock_get_leader_without_renew success", K(pkey), K(ret));
|
||||
STORAGE_LOG(DEBUG, "nonblock_get_strong_leader_without_renew success", K(pkey), K(cluster_id), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user