when io_bench not valid, do not limit IOPS
This commit is contained in:
@ -355,6 +355,7 @@ int ObAllVirtualIOQuota::init(const common::ObAddr &addr)
|
||||
item.real_iops_ = avg_iops.at(i+1).at(j);
|
||||
int64_t group_min_iops = 0, group_max_iops = 0, group_iops_weight = 0;
|
||||
double iops_scale = 0;
|
||||
bool is_io_ability_valid = true;
|
||||
if (OB_FAIL(io_config.get_group_config(i,
|
||||
group_min_iops,
|
||||
group_max_iops,
|
||||
@ -362,7 +363,8 @@ int ObAllVirtualIOQuota::init(const common::ObAddr &addr)
|
||||
LOG_WARN("get group config failed", K(ret), K(i));
|
||||
} else if (OB_FAIL(ObIOCalibration::get_instance().get_iops_scale(static_cast<ObIOMode>(j),
|
||||
avg_size.at(i+1).at(j),
|
||||
iops_scale))) {
|
||||
iops_scale,
|
||||
is_io_ability_valid))) {
|
||||
LOG_WARN("get iops scale failed", K(ret), "mode", get_io_mode_string(static_cast<ObIOMode>(j)));
|
||||
} else {
|
||||
item.min_iops_ = group_min_iops * iops_scale;
|
||||
@ -386,6 +388,7 @@ int ObAllVirtualIOQuota::init(const common::ObAddr &addr)
|
||||
item.real_iops_ = avg_iops.at(0).at(k);
|
||||
int64_t group_min_iops = 0, group_max_iops = 0, group_iops_weight = 0;
|
||||
double iops_scale = 0;
|
||||
bool is_io_ability_valid = true;
|
||||
if (OB_FAIL(io_config.get_group_config(INT64_MAX,
|
||||
group_min_iops,
|
||||
group_max_iops,
|
||||
@ -393,7 +396,8 @@ int ObAllVirtualIOQuota::init(const common::ObAddr &addr)
|
||||
LOG_WARN("get other group config failed", K(ret), "gruop_info", io_config.other_group_config_);
|
||||
} else if (OB_FAIL(ObIOCalibration::get_instance().get_iops_scale(static_cast<ObIOMode>(k),
|
||||
avg_size.at(0).at(k),
|
||||
iops_scale))) {
|
||||
iops_scale,
|
||||
is_io_ability_valid))) {
|
||||
LOG_WARN("get iops scale failed", K(ret), "mode", get_io_mode_string(static_cast<ObIOMode>(k)));
|
||||
} else {
|
||||
item.min_iops_ = group_min_iops * iops_scale;
|
||||
|
@ -275,10 +275,19 @@ int ObTenantIOClock::calc_phyqueue_clock(ObPhyQueue *phy_queue, const ObIOReques
|
||||
ObMClock &mclock = get_mclock(cur_queue_index);
|
||||
double weight_scale = get_weight_scale(cur_queue_index);
|
||||
double iops_scale = 0;
|
||||
bool is_io_ability_valid = true;
|
||||
if (OB_FAIL(ObIOCalibration::get_instance().get_iops_scale(req.get_mode(),
|
||||
max(req.io_info_.size_, req.io_size_),
|
||||
iops_scale))) {
|
||||
iops_scale,
|
||||
is_io_ability_valid))) {
|
||||
LOG_WARN("get iops scale failed", K(ret), K(req));
|
||||
} else if (OB_UNLIKELY(is_io_ability_valid == false)) {
|
||||
//unlimited
|
||||
const int64_t current_ts = ObTimeUtility::fast_current_time();
|
||||
phy_queue->reservation_ts_ = current_ts;
|
||||
phy_queue->group_limitation_ts_ = current_ts;
|
||||
phy_queue->tenant_limitation_ts_ = current_ts;
|
||||
phy_queue->proportion_ts_ = current_ts;
|
||||
} else if (OB_FAIL(mclock.calc_phy_clock(current_ts, iops_scale, weight_scale, phy_queue))) {
|
||||
LOG_WARN("calculate clock of the request failed", K(ret), K(mclock), K(weight_scale));
|
||||
} else {
|
||||
@ -344,9 +353,11 @@ int ObTenantIOClock::adjust_reservation_clock(ObPhyQueue *phy_queue, const ObIOR
|
||||
} else {
|
||||
ObMClock &mclock = get_mclock(cur_queue_index);
|
||||
double iops_scale = 0;
|
||||
bool is_io_ability_valid = true;
|
||||
if (OB_FAIL(ObIOCalibration::get_instance().get_iops_scale(req.get_mode(),
|
||||
max(req.io_info_.size_, req.io_size_),
|
||||
iops_scale))) {
|
||||
iops_scale,
|
||||
is_io_ability_valid))) {
|
||||
LOG_WARN("get iops scale failed", K(ret), K(req));
|
||||
} else if (OB_FAIL(mclock.dial_back_reservation_clock(iops_scale))) {
|
||||
LOG_WARN("dial back reservation clock failed", K(ret), K(iops_scale), K(req), K(mclock));
|
||||
|
@ -650,7 +650,7 @@ int ObIOCalibration::get_io_ability(ObIOAbility &io_ability)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObIOCalibration::get_iops_scale(const ObIOMode mode, const int64_t size, double &iops_scale)
|
||||
int ObIOCalibration::get_iops_scale(const ObIOMode mode, const int64_t size, double &iops_scale, bool &is_io_ability_valid)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
iops_scale = 0;
|
||||
@ -663,6 +663,7 @@ int ObIOCalibration::get_iops_scale(const ObIOMode mode, const int64_t size, dou
|
||||
DRWLock::RDLockGuard guard(lock_);
|
||||
if (!io_ability_.is_valid()) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
is_io_ability_valid = false;
|
||||
} else {
|
||||
double iops = 0;
|
||||
if (OB_FAIL(io_ability_.get_iops(mode, size, iops))) {
|
||||
|
@ -130,7 +130,7 @@ public:
|
||||
int update_io_ability(const ObIOAbility &io_ability);
|
||||
int reset_io_ability();
|
||||
int get_io_ability(ObIOAbility &io_ability);
|
||||
int get_iops_scale(const ObIOMode mode, const int64_t size, double &iops_scale);
|
||||
int get_iops_scale(const ObIOMode mode, const int64_t size, double &iops_scale, bool &is_io_ability_valid);
|
||||
int read_from_table();
|
||||
int write_into_table(ObMySQLTransaction &trans, const ObAddr &addr, const ObIOAbility &io_ability);
|
||||
int refresh(const bool only_refresh, const ObIArray<ObIOBenchResult> &items);
|
||||
|
Reference in New Issue
Block a user