fix io_clock calc

This commit is contained in:
renju96
2023-07-27 07:30:15 +00:00
committed by ob-robot
parent 344f4fb653
commit 16a48e22f1
2 changed files with 3 additions and 3 deletions

View File

@ -519,7 +519,7 @@ double ObTenantIOClock::get_weight_scale(const int64_t queue_index)
int64_t ObTenantIOClock::calc_iops(const int64_t iops, const int64_t percentage)
{
return max(1, static_cast<int64_t>(static_cast<double>(iops) * percentage / 100));
return static_cast<double>(iops) / 100 * percentage >= INT64_MAX ? INT64_MAX : static_cast<int64_t>(static_cast<double>(iops) / 100 * percentage);
}
int64_t ObTenantIOClock::calc_weight(const int64_t weight, const int64_t percentage)
@ -533,4 +533,4 @@ void ObTenantIOClock::stop_clock(const uint64_t index)
if (index < group_clocks_.count() && index >= 0) {
group_clocks_.at(index).stop();
}
}
}

View File

@ -883,7 +883,7 @@ int ObTenantIOManager::update_basic_io_config(const ObTenantIOConfig &io_config)
if (OB_FAIL(io_clock_->update_io_clocks(io_config_))) {
LOG_WARN("refresh io clock failed", K(ret), K(io_config_));
} else {
LOG_INFO("update basic io config success", K(tenant_id_), K(io_config_), K(io_config));
LOG_INFO("update basic io config success", K(tenant_id_), K(io_config_), K(io_config), K(io_clock_));
}
}
}