add timeguard and fix io_quota
This commit is contained in:
@ -438,19 +438,23 @@ int ObAllVirtualIOQuota::record_sys_group(const uint64_t tenant_id, ObSysIOUsage
|
||||
ObSysIOUsage::SysAvgItems sys_avg_iops, sys_avg_size, sys_avg_rt;
|
||||
sys_io_usage.calculate_io_usage();
|
||||
sys_io_usage.get_io_usage(sys_avg_iops, sys_avg_size, sys_avg_rt);
|
||||
for (int64_t i = 0; i < SYS_RESOURCE_GROUP_CNT; ++i) {
|
||||
for (int64_t j = 0; OB_SUCC(ret) && j < static_cast<int>(ObIOMode::MAX_MODE); ++j) {
|
||||
if (sys_avg_size.at(i).at(j) > std::numeric_limits<double>::epsilon()) {
|
||||
QuotaInfo item;
|
||||
item.tenant_id_ = tenant_id;
|
||||
item.mode_ = static_cast<ObIOMode>(j);
|
||||
item.group_id_ = SYS_RESOURCE_GROUP_START_ID + j;
|
||||
item.size_ = sys_avg_size.at(i).at(j);
|
||||
item.real_iops_ = sys_avg_iops.at(i).at(j);
|
||||
item.min_iops_ = INT64_MAX;
|
||||
item.max_iops_ = INT64_MAX;
|
||||
if (OB_FAIL(quota_infos_.push_back(item))) {
|
||||
LOG_WARN("push back io group item failed", K(j), K(ret), K(item));
|
||||
for (int64_t i = 0; i < sys_avg_size.count(); ++i) {
|
||||
if (i >= sys_avg_size.count() || i >= sys_avg_iops.count() || i >= sys_avg_rt.count()) {
|
||||
//ignore
|
||||
} else {
|
||||
for (int64_t j = 0; OB_SUCC(ret) && j < static_cast<int>(ObIOMode::MAX_MODE); ++j) {
|
||||
if (sys_avg_size.at(i).at(j) > std::numeric_limits<double>::epsilon()) {
|
||||
QuotaInfo item;
|
||||
item.tenant_id_ = tenant_id;
|
||||
item.mode_ = static_cast<ObIOMode>(j);
|
||||
item.group_id_ = SYS_RESOURCE_GROUP_START_ID + i;
|
||||
item.size_ = sys_avg_size.at(i).at(j);
|
||||
item.real_iops_ = sys_avg_iops.at(i).at(j);
|
||||
item.min_iops_ = INT64_MAX;
|
||||
item.max_iops_ = INT64_MAX;
|
||||
if (OB_FAIL(quota_infos_.push_back(item))) {
|
||||
LOG_WARN("push back io group item failed", K(j), K(ret), K(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1971,7 +1971,7 @@ int ObAsyncIOChannel::submit(ObIORequest &req)
|
||||
}
|
||||
} else if (device_channel_->used_io_depth_ > device_channel_->max_io_depth_) {
|
||||
ret = OB_EAGAIN;
|
||||
LOG_INFO("reach max io depth", K(ret), K(device_channel_->used_io_depth_), K(device_channel_->max_io_depth_));
|
||||
FLOG_INFO("reach max io depth", K(ret), K(device_channel_->used_io_depth_), K(device_channel_->max_io_depth_));
|
||||
} else {
|
||||
ATOMIC_INC(&submit_count_);
|
||||
ATOMIC_FAA(&device_channel_->used_io_depth_, get_io_depth(req.io_size_));
|
||||
|
||||
@ -1131,6 +1131,7 @@ int ObLocalDevice::io_submit(
|
||||
common::ObIOCB *iocb)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTimeGuard time_guard("LocalDevice", 5000); //5ms
|
||||
ObLocalIOContext *local_io_context = nullptr;
|
||||
ObLocalIOCB *local_iocb = nullptr;
|
||||
struct iocb *iocbp = nullptr;
|
||||
@ -1150,6 +1151,7 @@ int ObLocalDevice::io_submit(
|
||||
} else {
|
||||
iocbp = &(local_iocb->iocb_);
|
||||
int submit_ret = ::io_submit(local_io_context->io_context_, 1, &iocbp);
|
||||
time_guard.click("LocalDevice_submit");
|
||||
if (1 != submit_ret) {
|
||||
ret = OB_IO_ERROR;
|
||||
SHARE_LOG(WARN, "Fail to submit aio, ", K(ret), K(submit_ret), K(errno), KERRMSG);
|
||||
|
||||
Reference in New Issue
Block a user