[CP] fix stc scanned bugs

This commit is contained in:
LeonChaoHi
2024-01-19 10:43:05 +00:00
committed by ob-robot
parent 41025cf020
commit a11d0971db
2 changed files with 5 additions and 5 deletions

View File

@ -524,7 +524,7 @@ int ObLSBalanceTaskHelper::generate_task_for_shrink_(
for (int64_t i = 0; OB_SUCC(ret) && i < src_split_param.count(); ++i) {
const ObSplitLSParam &param = src_split_param.at(i);
ObLSID merge_ls_id;
if (1 == param.get_current_factor()) {
if (fabs(param.get_current_factor() - 1.0) < OB_DOUBLE_EPSINON) {
//nothing
merge_ls_id = param.get_ls_info()->ls_id_;
} else {
@ -623,7 +623,7 @@ int ObLSBalanceTaskHelper::construct_shrink_src_param_(const int64_t target_coun
for (int64_t j = 0; OB_SUCC(ret) && j < src_ls.count() && need_factor > OB_DOUBLE_EPSINON; ++j) {
ObSplitLSParam &param = src_ls.at(j);
double get_factor = param.reduce_enough_factor(need_factor);
if (0 == get_factor) {
if (!(get_factor)) { // strictly equal to zero
//empty
} else if (OB_DOUBLE_EPSINON >= get_factor) {
ret = OB_ERR_UNEXPECTED;

View File

@ -76,9 +76,9 @@ int ObUnitPlacementDPStrategy::choose_server(ObArray<ObUnitPlacementDPStrategy::
int ret = OB_SUCCESS;
ObArray<double> all_dot_product;
double dot_product = 0.0;
double demands[RES_MAX]; // scaled demands
double remaining[RES_MAX]; // scaled remaining
double weight[RES_MAX];
double demands[RES_MAX] = {}; // scaled demands
double remaining[RES_MAX] = {}; // scaled remaining
double weight[RES_MAX] = {};
double max_dot_product = -1.0;
int64_t found_idx = -1;
if (servers.count() > 0) {