support DDL_group_id transfer with RPC struct
This commit is contained in:
@ -438,7 +438,7 @@ int64_t ObIORequest::get_group_id() const
|
||||
uint64_t ObIORequest::get_io_usage_index()
|
||||
{
|
||||
uint64_t index = 0;
|
||||
if (get_group_id() < GROUP_START_ID) {
|
||||
if (get_group_id() < RESOURCE_GROUP_START_ID) {
|
||||
//other group , do nothing
|
||||
} else {
|
||||
index = tenant_io_mgr_.get_ptr()->get_usage_index(get_group_id());
|
||||
@ -1173,7 +1173,7 @@ int ObTenantIOConfig::parse_group_config(const char *config_str)
|
||||
int ObTenantIOConfig::add_single_group_config(const uint64_t tenant_id, const int64_t group_id, int64_t min_percent, int64_t max_percent, int64_t weight_percent)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (group_id < GROUP_START_ID || !is_valid_tenant_id(tenant_id) ||
|
||||
if (group_id < RESOURCE_GROUP_START_ID || !is_valid_tenant_id(tenant_id) ||
|
||||
min_percent < 0 || min_percent > 100 ||
|
||||
max_percent < 0 || max_percent > 100 ||
|
||||
weight_percent < 0 || weight_percent > 100 ||
|
||||
|
||||
@ -31,7 +31,6 @@ namespace common
|
||||
|
||||
static constexpr int64_t DEFAULT_IO_WAIT_TIME_MS = 5000L; // 5s
|
||||
static constexpr int64_t MAX_IO_WAIT_TIME_MS = 300L * 1000L; // 5min
|
||||
static constexpr int64_t GROUP_START_ID = 10000L; // start id = 10000
|
||||
static constexpr int64_t GROUP_START_NUM = 8L;
|
||||
enum class ObIOMode : uint8_t
|
||||
{
|
||||
|
||||
@ -980,7 +980,7 @@ int ObTenantIOManager::modify_io_config(const uint64_t group_id,
|
||||
} else {
|
||||
uint64_t index = INT64_MAX;
|
||||
DRWLock::WRLockGuard guard(io_config_lock_);
|
||||
if (group_id < GROUP_START_ID && group_id > 0) {
|
||||
if (group_id < RESOURCE_GROUP_START_ID && group_id > 0) {
|
||||
ret = OB_INVALID_CONFIG;
|
||||
LOG_WARN("invalid group id", K(ret), K(tenant_id_), K(group_id));
|
||||
} else if (min_percent < 0 || min_percent > 100 ||
|
||||
@ -1046,7 +1046,7 @@ int ObTenantIOManager::add_group_io_config(const int64_t group_id,
|
||||
} else if (OB_UNLIKELY(!is_working())) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
LOG_WARN("tenant not working", K(ret), K(tenant_id_));
|
||||
} else if (group_id < GROUP_START_ID || min_percent < 0 || min_percent > 100 ||
|
||||
} else if (group_id < RESOURCE_GROUP_START_ID || min_percent < 0 || min_percent > 100 ||
|
||||
max_percent < 0 || max_percent > 100 || max_percent < min_percent ||
|
||||
weight_percent < 0 || weight_percent > 100) {
|
||||
ret = OB_INVALID_CONFIG;
|
||||
@ -1099,7 +1099,7 @@ int ObTenantIOManager::reset_consumer_group_config(const int64_t group_id)
|
||||
} else if (OB_UNLIKELY(!is_working())) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
LOG_WARN("tenant not working", K(ret), K(tenant_id_));
|
||||
} else if (group_id < GROUP_START_ID) {
|
||||
} else if (group_id < RESOURCE_GROUP_START_ID) {
|
||||
ret = OB_INVALID_CONFIG;
|
||||
LOG_WARN("cannot reset other group io config", K(ret), K(group_id));
|
||||
} else {
|
||||
@ -1138,7 +1138,7 @@ int ObTenantIOManager::delete_consumer_group_config(const int64_t group_id)
|
||||
} else if (OB_UNLIKELY(!is_working())) {
|
||||
ret = OB_STATE_NOT_MATCH;
|
||||
LOG_WARN("tenant not working", K(ret), K(tenant_id_));
|
||||
} else if (group_id < GROUP_START_ID) {
|
||||
} else if (group_id < RESOURCE_GROUP_START_ID) {
|
||||
ret = OB_INVALID_CONFIG;
|
||||
LOG_WARN("cannot delete other group io config", K(ret), K(group_id));
|
||||
} else {
|
||||
|
||||
@ -992,7 +992,7 @@ int ObIOSender::enqueue_request(ObIORequest &req)
|
||||
} else {
|
||||
uint64_t index = INT_MAX64;
|
||||
const int64_t group_id = tmp_req->get_group_id();
|
||||
if (group_id < GROUP_START_ID) { //other
|
||||
if (group_id < RESOURCE_GROUP_START_ID) { //other
|
||||
tmp_phy_queue = &(io_group_queues->other_phy_queue_);
|
||||
} else if (OB_FAIL(req.tenant_io_mgr_.get_ptr()->get_group_index(group_id, index))) {
|
||||
// 防止删除group、新建group等情况发生时在途req无法找到对应的group
|
||||
|
||||
Reference in New Issue
Block a user