[CP] fix bug about px admission
This commit is contained in:
@ -436,11 +436,13 @@ int ObPxTenantTargetMonitor::apply_target(hash::ObHashMap<ObAddr, int64_t> &work
|
|||||||
}
|
}
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
if (is_first_query || is_target_enough) {
|
if (is_first_query || is_target_enough) {
|
||||||
|
int64_t total_admit_count = 0;
|
||||||
for (hash::ObHashMap<ObAddr, int64_t>::iterator it = worker_map.begin();
|
for (hash::ObHashMap<ObAddr, int64_t>::iterator it = worker_map.begin();
|
||||||
OB_SUCC(ret) && it != worker_map.end(); it++) {
|
OB_SUCC(ret) && it != worker_map.end(); it++) {
|
||||||
it->second = std::min(it->second, target);
|
it->second = std::min(it->second, target);
|
||||||
ObAddr &server = it->first;
|
ObAddr &server = it->first;
|
||||||
int64_t acquired_cnt = it->second;
|
int64_t acquired_cnt = it->second;
|
||||||
|
total_admit_count += acquired_cnt;
|
||||||
auto apply_local_target = [=](hash::HashMapPair<ObAddr, ServerTargetUsage> &entry) -> void {
|
auto apply_local_target = [=](hash::HashMapPair<ObAddr, ServerTargetUsage> &entry) -> void {
|
||||||
entry.second.update_local_used(acquired_cnt);
|
entry.second.update_local_used(acquired_cnt);
|
||||||
if (is_leader()) {
|
if (is_leader()) {
|
||||||
@ -456,7 +458,7 @@ int ObPxTenantTargetMonitor::apply_target(hash::ObHashMap<ObAddr, int64_t> &work
|
|||||||
K(parallel_servers_target_));
|
K(parallel_servers_target_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
admit_count = std::min(req_cnt, target);
|
admit_count = total_admit_count;
|
||||||
admit_version = version;
|
admit_version = version;
|
||||||
parallel_session_count_++;
|
parallel_session_count_++;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user