fix problem with region priority
This commit is contained in:
@ -256,6 +256,11 @@ int ObPartitionLogService::init(ObILogEngine* log_engine, ObLogReplayEngineWrapp
|
|||||||
archive_mgr_ = archive_mgr;
|
archive_mgr_ = archive_mgr;
|
||||||
max_flushed_ilog_id_ = 0;
|
max_flushed_ilog_id_ = 0;
|
||||||
scan_confirmed_log_cnt_ = 0;
|
scan_confirmed_log_cnt_ = 0;
|
||||||
|
|
||||||
|
// priority of log replica include encrypted log replica should be initialize with UINT64_MAX,
|
||||||
|
// while other replica types with 0.
|
||||||
|
const uint64_t zone_priority = ObReplicaTypeCheck::is_log_replica(replica_type) ? UINT64_MAX : 0;
|
||||||
|
ATOMIC_STORE(&zone_priority_, zone_priority);
|
||||||
is_inited_ = true;
|
is_inited_ = true;
|
||||||
election_has_removed_ = false;
|
election_has_removed_ = false;
|
||||||
}
|
}
|
||||||
@ -4144,7 +4149,7 @@ void ObPartitionLogService::destroy()
|
|||||||
self_.reset();
|
self_.reset();
|
||||||
// checksum_.destroy()
|
// checksum_.destroy()
|
||||||
saved_base_storage_info_.reset();
|
saved_base_storage_info_.reset();
|
||||||
zone_priority_ = UINT64_MAX;
|
zone_priority_ = 0;
|
||||||
is_candidate_ = false;
|
is_candidate_ = false;
|
||||||
free_cursor_array_cache_();
|
free_cursor_array_cache_();
|
||||||
free_broadcast_info_mgr_();
|
free_broadcast_info_mgr_();
|
||||||
@ -6386,7 +6391,9 @@ int64_t ObPartitionLogService::get_zone_priority() const
|
|||||||
|
|
||||||
void ObPartitionLogService::set_zone_priority(const uint64_t zone_priority)
|
void ObPartitionLogService::set_zone_priority(const uint64_t zone_priority)
|
||||||
{
|
{
|
||||||
ATOMIC_STORE(&zone_priority_, zone_priority);
|
const uint64_t final_zone_priority =
|
||||||
|
ObReplicaTypeCheck::is_log_replica(mm_.get_replica_type()) ? UINT64_MAX : zone_priority;
|
||||||
|
ATOMIC_STORE(&zone_priority_, final_zone_priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObPartitionLogService::set_region(const common::ObRegion& region)
|
int ObPartitionLogService::set_region(const common::ObRegion& region)
|
||||||
@ -6672,6 +6679,9 @@ int ObPartitionLogService::set_replica_type(const enum ObReplicaType replica_typ
|
|||||||
free_broadcast_info_mgr_();
|
free_broadcast_info_mgr_();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (ObReplicaTypeCheck::is_log_replica(replica_type)) {
|
||||||
|
ATOMIC_STORE(&zone_priority_, UINT64_MAX);
|
||||||
|
}
|
||||||
// change success
|
// change success
|
||||||
if (REPLICA_TYPE_LOGONLY == mm_.get_replica_type()) {
|
if (REPLICA_TYPE_LOGONLY == mm_.get_replica_type()) {
|
||||||
sw_.destroy_aggre_buffer();
|
sw_.destroy_aggre_buffer();
|
||||||
|
@ -364,6 +364,8 @@ int ObLocalityTableOperator::load_region(const ObAddr& addr, const bool& is_self
|
|||||||
region_priority = UINT64_MAX;
|
region_priority = UINT64_MAX;
|
||||||
if (ObPrimaryZoneUtil::no_need_to_check_primary_zone(tenant_schema->get_primary_zone()) ||
|
if (ObPrimaryZoneUtil::no_need_to_check_primary_zone(tenant_schema->get_primary_zone()) ||
|
||||||
!is_self_cluster) {
|
!is_self_cluster) {
|
||||||
|
// fix bug: https://work.aone.alibaba-inc.com/issue/34933159
|
||||||
|
region_priority = 0;
|
||||||
// FIXME: do not process the semantics of leader balance of primary_zone
|
// FIXME: do not process the semantics of leader balance of primary_zone
|
||||||
LOG_INFO("tenant_schema primary_zone is NULL, or no need calc region priority",
|
LOG_INFO("tenant_schema primary_zone is NULL, or no need calc region priority",
|
||||||
K(tenant_id),
|
K(tenant_id),
|
||||||
|
Reference in New Issue
Block a user