fix column_store_only route bug

This commit is contained in:
zzg19950727
2025-02-06 04:48:31 +00:00
committed by ob-robot
parent 02c4c64388
commit a4d46d352d

View File

@ -103,10 +103,13 @@ int ObRoutePolicy::filter_replica(const ObAddr &local_server,
}
}
}
if (OB_SUCC(ret) && policy_type == COLUMN_STORE_ONLY) {
if (OB_SUCC(ret)) {
for (int64_t i = candi_replicas.count()-1; OB_SUCC(ret) && i >= 0; --i) {
CandidateReplica &cur_replica = candi_replicas.at(i);
if (cur_replica.is_filter_ && OB_FAIL(candi_replicas.remove(i))) {
if (cur_replica.is_filter_ &&
((policy_type == COLUMN_STORE_ONLY && !ObReplicaTypeCheck::is_columnstore_replica(cur_replica.get_replica_type()))
|| (policy_type != COLUMN_STORE_ONLY && ObReplicaTypeCheck::is_columnstore_replica(cur_replica.get_replica_type()))) &&
OB_FAIL(candi_replicas.remove(i))) {
LOG_WARN("failed to remove filted replica", K(ret));
}
}