when io_bench not valid, do not limit IOPS
This commit is contained in:
@ -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