diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp index 9cf4d6c554..485c98733f 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp @@ -2179,6 +2179,17 @@ int ObVTIterCreator::create_vt_iter(ObVTableScanParam ¶ms, } break; } + case OB_ALL_VIRTUAL_IO_SCHEDULER_TID: { + ObAllVirtualIOScheduler *io_scheduler = nullptr; + if (OB_SUCC(NEW_VIRTUAL_TABLE(ObAllVirtualIOScheduler, io_scheduler))) { + if (OB_FAIL(io_scheduler->init(addr_))) { + SERVER_LOG(WARN, "fail to init io_scheduler_tid, ", K(ret)); + } else { + vt_iter = static_cast(io_scheduler); + } + } + break; + } case OB_ALL_VIRTUAL_TABLET_ENCRYPT_INFO_TID: { ObAllVirtualTabletEncryptInfo *partition_encrypt_info = NULL; if (OB_SUCC(NEW_VIRTUAL_TABLE(ObAllVirtualTabletEncryptInfo, partition_encrypt_info))) { diff --git a/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp b/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp index b3efc17264..ffe6d4947b 100644 --- a/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12351_12400.cpp @@ -3951,6 +3951,214 @@ int ObInnerTableSchema::all_virtual_archive_dest_status_schema(ObTableSchema &ta return ret; } +int ObInnerTableSchema::all_virtual_io_scheduler_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_IO_SCHEDULER_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(VIRTUAL_TABLE); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_IO_SCHEDULER_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_ip", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 1, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_port", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 2, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("thread_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("group_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("queuing_count", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("reservation_ts", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("category_limit_ts", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("tenant_limit_ts", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("proportion_ts", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + if (OB_SUCC(ret)) { + table_schema.get_part_option().set_part_num(1); + table_schema.set_part_level(PARTITION_LEVEL_ONE); + table_schema.get_part_option().set_part_func_type(PARTITION_FUNC_TYPE_LIST_COLUMNS); + if (OB_FAIL(table_schema.get_part_option().set_part_expr("svr_ip, svr_port"))) { + LOG_WARN("set_part_expr failed", K(ret)); + } else if (OB_FAIL(table_schema.mock_list_partition_array())) { + LOG_WARN("mock list partition array failed", K(ret)); + } + } + table_schema.set_index_using_type(USING_HASH); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema.21351_21400.cpp b/src/share/inner_table/ob_inner_table_schema.21351_21400.cpp index c0513f124e..a7dc37312c 100644 --- a/src/share/inner_table/ob_inner_table_schema.21351_21400.cpp +++ b/src/share/inner_table/ob_inner_table_schema.21351_21400.cpp @@ -775,6 +775,56 @@ int ObInnerTableSchema::cdb_ob_ls_log_archive_progress_schema(ObTableSchema &tab return ret; } +int ObInnerTableSchema::dba_ob_rsrc_io_directives_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_DBA_OB_RSRC_IO_DIRECTIVES_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_DBA_OB_RSRC_IO_DIRECTIVES_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT PLAN, GROUP_OR_SUBPLAN, COMMENTS, MIN_IOPS, MAX_IOPS, WEIGHT_IOPS FROM oceanbase.__all_res_mgr_directive )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema.25201_25250.cpp b/src/share/inner_table/ob_inner_table_schema.25201_25250.cpp index f3e189f6bd..054634b03c 100644 --- a/src/share/inner_table/ob_inner_table_schema.25201_25250.cpp +++ b/src/share/inner_table/ob_inner_table_schema.25201_25250.cpp @@ -1075,6 +1075,56 @@ int ObInnerTableSchema::dba_ob_ls_arb_replica_task_history_ora_schema(ObTableSch return ret; } +int ObInnerTableSchema::dba_ob_rsrc_io_directives_ora_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT PLAN, GROUP_OR_SUBPLAN, COMMENTS, MIN_IOPS, MAX_IOPS, WEIGHT_IOPS FROM SYS.ALL_VIRTUAL_RES_MGR_DIRECTIVE_REAL_AGENT )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index 415dad4961..f0ab184695 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -871,6 +871,7 @@ public: static int all_virtual_ls_arb_replica_task_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_ls_arb_replica_task_history_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_archive_dest_status_schema(share::schema::ObTableSchema &table_schema); + static int all_virtual_io_scheduler_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_plan_stat_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_plan_cache_plan_explain_ora_schema(share::schema::ObTableSchema &table_schema); @@ -1371,6 +1372,7 @@ public: static int v_ob_archive_dest_status_schema(share::schema::ObTableSchema &table_schema); static int dba_ob_ls_log_archive_progress_schema(share::schema::ObTableSchema &table_schema); static int cdb_ob_ls_log_archive_progress_schema(share::schema::ObTableSchema &table_schema); + static int dba_ob_rsrc_io_directives_schema(share::schema::ObTableSchema &table_schema); static int dba_synonyms_schema(share::schema::ObTableSchema &table_schema); static int dba_objects_ora_schema(share::schema::ObTableSchema &table_schema); static int all_objects_schema(share::schema::ObTableSchema &table_schema); @@ -1589,6 +1591,7 @@ public: static int user_sec_relevant_cols_ora_schema(share::schema::ObTableSchema &table_schema); static int dba_ob_ls_arb_replica_tasks_ora_schema(share::schema::ObTableSchema &table_schema); static int dba_ob_ls_arb_replica_task_history_ora_schema(share::schema::ObTableSchema &table_schema); + static int dba_ob_rsrc_io_directives_ora_schema(share::schema::ObTableSchema &table_schema); static int gv_ob_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema); static int v_ob_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema); static int gv_instance_schema(share::schema::ObTableSchema &table_schema); @@ -2921,6 +2924,7 @@ const schema_create_func virtual_table_schema_creators [] = { ObInnerTableSchema::all_virtual_ls_arb_replica_task_schema, ObInnerTableSchema::all_virtual_ls_arb_replica_task_history_schema, ObInnerTableSchema::all_virtual_archive_dest_status_schema, + ObInnerTableSchema::all_virtual_io_scheduler_schema, ObInnerTableSchema::all_virtual_sql_audit_ora_schema, ObInnerTableSchema::all_virtual_plan_stat_ora_schema, ObInnerTableSchema::all_virtual_plan_cache_plan_explain_ora_schema, @@ -3441,6 +3445,7 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::v_ob_archive_dest_status_schema, ObInnerTableSchema::dba_ob_ls_log_archive_progress_schema, ObInnerTableSchema::cdb_ob_ls_log_archive_progress_schema, + ObInnerTableSchema::dba_ob_rsrc_io_directives_schema, ObInnerTableSchema::dba_synonyms_schema, ObInnerTableSchema::dba_objects_ora_schema, ObInnerTableSchema::all_objects_schema, @@ -3659,6 +3664,7 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::user_sec_relevant_cols_ora_schema, ObInnerTableSchema::dba_ob_ls_arb_replica_tasks_ora_schema, ObInnerTableSchema::dba_ob_ls_arb_replica_task_history_ora_schema, + ObInnerTableSchema::dba_ob_rsrc_io_directives_ora_schema, ObInnerTableSchema::gv_ob_sql_audit_ora_schema, ObInnerTableSchema::v_ob_sql_audit_ora_schema, ObInnerTableSchema::gv_instance_schema, @@ -4723,6 +4729,7 @@ const uint64_t tenant_space_tables [] = { OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_TID, OB_V_OB_ARCHIVE_DEST_STATUS_TID, OB_DBA_OB_LS_LOG_ARCHIVE_PROGRESS_TID, + OB_DBA_OB_RSRC_IO_DIRECTIVES_TID, OB_DBA_SYNONYMS_TID, OB_DBA_OBJECTS_ORA_TID, OB_ALL_OBJECTS_TID, @@ -4941,6 +4948,7 @@ const uint64_t tenant_space_tables [] = { OB_USER_SEC_RELEVANT_COLS_ORA_TID, OB_DBA_OB_LS_ARB_REPLICA_TASKS_ORA_TID, OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_ORA_TID, + OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TID, OB_GV_OB_SQL_AUDIT_ORA_TID, OB_V_OB_SQL_AUDIT_ORA_TID, OB_GV_INSTANCE_TID, @@ -6651,6 +6659,7 @@ const char* const tenant_space_table_names [] = { OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_TNAME, OB_V_OB_ARCHIVE_DEST_STATUS_TNAME, OB_DBA_OB_LS_LOG_ARCHIVE_PROGRESS_TNAME, + OB_DBA_OB_RSRC_IO_DIRECTIVES_TNAME, OB_DBA_SYNONYMS_TNAME, OB_DBA_OBJECTS_ORA_TNAME, OB_ALL_OBJECTS_TNAME, @@ -6869,6 +6878,7 @@ const char* const tenant_space_table_names [] = { OB_USER_SEC_RELEVANT_COLS_ORA_TNAME, OB_DBA_OB_LS_ARB_REPLICA_TASKS_ORA_TNAME, OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_ORA_TNAME, + OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TNAME, OB_GV_OB_SQL_AUDIT_ORA_TNAME, OB_V_OB_SQL_AUDIT_ORA_TNAME, OB_GV_INSTANCE_TNAME, @@ -7589,7 +7599,8 @@ const uint64_t cluster_distributed_vtables [] = { OB_ALL_VIRTUAL_SCHEMA_MEMORY_TID, OB_ALL_VIRTUAL_SCHEMA_SLOT_TID, OB_ALL_VIRTUAL_MINOR_FREEZE_INFO_TID, - OB_ALL_VIRTUAL_HA_DIAGNOSE_TID, }; + OB_ALL_VIRTUAL_HA_DIAGNOSE_TID, + OB_ALL_VIRTUAL_IO_SCHEDULER_TID, }; const uint64_t tenant_distributed_vtables [] = { OB_ALL_VIRTUAL_PROCESSLIST_TID, @@ -9854,11 +9865,11 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid, const int64_t OB_CORE_TABLE_COUNT = 4; const int64_t OB_SYS_TABLE_COUNT = 230; -const int64_t OB_VIRTUAL_TABLE_COUNT = 579; -const int64_t OB_SYS_VIEW_COUNT = 660; -const int64_t OB_SYS_TENANT_TABLE_COUNT = 1474; +const int64_t OB_VIRTUAL_TABLE_COUNT = 580; +const int64_t OB_SYS_VIEW_COUNT = 662; +const int64_t OB_SYS_TENANT_TABLE_COUNT = 1477; const int64_t OB_CORE_SCHEMA_VERSION = 1; -const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1477; +const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 1480; } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema_constants.h b/src/share/inner_table/ob_inner_table_schema_constants.h index 93b9e69719..0b0984d793 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -613,6 +613,7 @@ const uint64_t OB_ALL_VIRTUAL_CORE_TABLE_TID = 12362; // "__all_virtual_core_tab const uint64_t OB_ALL_VIRTUAL_LS_ARB_REPLICA_TASK_TID = 12364; // "__all_virtual_ls_arb_replica_task" const uint64_t OB_ALL_VIRTUAL_LS_ARB_REPLICA_TASK_HISTORY_TID = 12365; // "__all_virtual_ls_arb_replica_task_history" const uint64_t OB_ALL_VIRTUAL_ARCHIVE_DEST_STATUS_TID = 12366; // "__all_virtual_archive_dest_status" +const uint64_t OB_ALL_VIRTUAL_IO_SCHEDULER_TID = 12369; // "__all_virtual_io_scheduler" const uint64_t OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID = 15009; // "ALL_VIRTUAL_SQL_AUDIT_ORA" const uint64_t OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID = 15010; // "ALL_VIRTUAL_PLAN_STAT_ORA" const uint64_t OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TID = 15012; // "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA" @@ -1113,6 +1114,7 @@ const uint64_t OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_TID = 21361; // "DBA_OB_LS_ const uint64_t OB_V_OB_ARCHIVE_DEST_STATUS_TID = 21362; // "V$OB_ARCHIVE_DEST_STATUS" const uint64_t OB_DBA_OB_LS_LOG_ARCHIVE_PROGRESS_TID = 21363; // "DBA_OB_LS_LOG_ARCHIVE_PROGRESS" const uint64_t OB_CDB_OB_LS_LOG_ARCHIVE_PROGRESS_TID = 21364; // "CDB_OB_LS_LOG_ARCHIVE_PROGRESS" +const uint64_t OB_DBA_OB_RSRC_IO_DIRECTIVES_TID = 21369; // "DBA_OB_RSRC_IO_DIRECTIVES" const uint64_t OB_DBA_SYNONYMS_TID = 25001; // "DBA_SYNONYMS" const uint64_t OB_DBA_OBJECTS_ORA_TID = 25002; // "DBA_OBJECTS_ORA" const uint64_t OB_ALL_OBJECTS_TID = 25003; // "ALL_OBJECTS" @@ -1331,6 +1333,7 @@ const uint64_t OB_ALL_SEC_RELEVANT_COLS_ORA_TID = 25219; // "ALL_SEC_RELEVANT_CO const uint64_t OB_USER_SEC_RELEVANT_COLS_ORA_TID = 25220; // "USER_SEC_RELEVANT_COLS_ORA" const uint64_t OB_DBA_OB_LS_ARB_REPLICA_TASKS_ORA_TID = 25221; // "DBA_OB_LS_ARB_REPLICA_TASKS_ORA" const uint64_t OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_ORA_TID = 25222; // "DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_ORA" +const uint64_t OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TID = 25223; // "DBA_OB_RSRC_IO_DIRECTIVES_ORA" const uint64_t OB_GV_OB_SQL_AUDIT_ORA_TID = 28002; // "GV$OB_SQL_AUDIT_ORA" const uint64_t OB_V_OB_SQL_AUDIT_ORA_TID = 28003; // "V$OB_SQL_AUDIT_ORA" const uint64_t OB_GV_INSTANCE_TID = 28004; // "GV$INSTANCE" @@ -2647,6 +2650,7 @@ const char *const OB_ALL_VIRTUAL_CORE_TABLE_TNAME = "__all_virtual_core_table"; const char *const OB_ALL_VIRTUAL_LS_ARB_REPLICA_TASK_TNAME = "__all_virtual_ls_arb_replica_task"; const char *const OB_ALL_VIRTUAL_LS_ARB_REPLICA_TASK_HISTORY_TNAME = "__all_virtual_ls_arb_replica_task_history"; const char *const OB_ALL_VIRTUAL_ARCHIVE_DEST_STATUS_TNAME = "__all_virtual_archive_dest_status"; +const char *const OB_ALL_VIRTUAL_IO_SCHEDULER_TNAME = "__all_virtual_io_scheduler"; const char *const OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TNAME = "ALL_VIRTUAL_SQL_AUDIT"; const char *const OB_ALL_VIRTUAL_PLAN_STAT_ORA_TNAME = "ALL_VIRTUAL_PLAN_STAT"; const char *const OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TNAME = "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN"; @@ -3147,6 +3151,7 @@ const char *const OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_TNAME = "DBA_OB_LS_ARB_R const char *const OB_V_OB_ARCHIVE_DEST_STATUS_TNAME = "V$OB_ARCHIVE_DEST_STATUS"; const char *const OB_DBA_OB_LS_LOG_ARCHIVE_PROGRESS_TNAME = "DBA_OB_LS_LOG_ARCHIVE_PROGRESS"; const char *const OB_CDB_OB_LS_LOG_ARCHIVE_PROGRESS_TNAME = "CDB_OB_LS_LOG_ARCHIVE_PROGRESS"; +const char *const OB_DBA_OB_RSRC_IO_DIRECTIVES_TNAME = "DBA_OB_RSRC_IO_DIRECTIVES"; const char *const OB_DBA_SYNONYMS_TNAME = "DBA_SYNONYMS"; const char *const OB_DBA_OBJECTS_ORA_TNAME = "DBA_OBJECTS"; const char *const OB_ALL_OBJECTS_TNAME = "ALL_OBJECTS"; @@ -3365,6 +3370,7 @@ const char *const OB_ALL_SEC_RELEVANT_COLS_ORA_TNAME = "ALL_SEC_RELEVANT_COLS"; const char *const OB_USER_SEC_RELEVANT_COLS_ORA_TNAME = "USER_SEC_RELEVANT_COLS"; const char *const OB_DBA_OB_LS_ARB_REPLICA_TASKS_ORA_TNAME = "DBA_OB_LS_ARB_REPLICA_TASKS"; const char *const OB_DBA_OB_LS_ARB_REPLICA_TASK_HISTORY_ORA_TNAME = "DBA_OB_LS_ARB_REPLICA_TASK_HISTORY"; +const char *const OB_DBA_OB_RSRC_IO_DIRECTIVES_ORA_TNAME = "DBA_OB_RSRC_IO_DIRECTIVES"; const char *const OB_GV_OB_SQL_AUDIT_ORA_TNAME = "GV$OB_SQL_AUDIT"; const char *const OB_V_OB_SQL_AUDIT_ORA_TNAME = "V$OB_SQL_AUDIT"; const char *const OB_GV_INSTANCE_TNAME = "GV$INSTANCE"; diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index be1d38a2fa..46f55eac2b 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -11493,8 +11493,30 @@ def_table_schema( # 12367: __all_virtual_kv_hotkey_stat # 12368: __all_virtual_backup_transferring_tablets -# 12369: __all_virtual_io_scheduler +def_table_schema( + owner = 'renju.rj', + table_name = '__all_virtual_io_scheduler', + table_id = '12369', + table_type = 'VIRTUAL_TABLE', + in_tenant_space = False, + gm_columns = [], + rowkey_columns = [], + normal_columns = [ + ('svr_ip', 'varchar:MAX_IP_ADDR_LENGTH'), + ('svr_port', 'int'), + ('thread_id', 'int'), + ('tenant_id', 'int'), + ('group_id', 'int'), + ('queuing_count', 'int'), + ('reservation_ts', 'timestamp'), + ('category_limit_ts', 'timestamp'), + ('tenant_limit_ts', 'timestamp'), + ('proportion_ts', 'timestamp'), + ], + partition_columns = ['svr_ip', 'svr_port'], + vtable_route_policy = 'distributed', +) # # 余留位置 # @@ -25771,6 +25793,28 @@ def_table_schema( # 21367: GV$OB_KV_HOTKEY_STAT # 21368: V$OB_KV_HOTKEY_STAT +def_table_schema( + owner = 'renju.rj', + table_name = 'DBA_OB_RSRC_IO_DIRECTIVES', + table_id = '21369', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + PLAN, + GROUP_OR_SUBPLAN, + COMMENTS, + MIN_IOPS, + MAX_IOPS, + WEIGHT_IOPS + FROM + oceanbase.__all_res_mgr_directive +""".replace("\n", " ") +) + @@ -43024,6 +43068,30 @@ def_table_schema( TENANT_ID = EFFECTIVE_TENANT_ID() """.replace("\n", " "), ) + +def_table_schema( + owner = 'renju.rj', + table_name = 'DBA_OB_RSRC_IO_DIRECTIVES', + name_postfix = '_ORA', + database_id = 'OB_ORA_SYS_DATABASE_ID', + table_id = '25223', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + PLAN, + GROUP_OR_SUBPLAN, + COMMENTS, + MIN_IOPS, + MAX_IOPS, + WEIGHT_IOPS + FROM + SYS.ALL_VIRTUAL_RES_MGR_DIRECTIVE_REAL_AGENT +""".replace("\n", " ") +) #### End Data Dictionary View ################################################################################ diff --git a/src/share/io/ob_io_struct.cpp b/src/share/io/ob_io_struct.cpp index 195c9d7a33..2bd875c3f4 100644 --- a/src/share/io/ob_io_struct.cpp +++ b/src/share/io/ob_io_struct.cpp @@ -1283,8 +1283,7 @@ int ObIOSender::get_sender_status(const uint64_t tenant_id, const uint64_t index if (!is_inited_) { ret = OB_NOT_INIT; LOG_WARN("Not init", K(ret), K(is_inited_)); - } else if (OB_UNLIKELY(!is_valid_tenant_id(tenant_id) || index < 0 || - (index >= io_group_queues->group_phy_queues_.count() && INT64_MAX != index))) { + } else if (OB_UNLIKELY(!is_valid_tenant_id(tenant_id) || index < 0)) { ret = OB_INVALID_CONFIG; LOG_WARN("invalid index", K(ret), K(index)); } else { @@ -1294,6 +1293,9 @@ int ObIOSender::get_sender_status(const uint64_t tenant_id, const uint64_t index } else { if (OB_FAIL(tenant_groups_map_.get_refactored(tenant_id, io_group_queues))) { LOG_WARN("get io_group_queues from map failed", K(ret), K(tenant_id)); + } else if (OB_UNLIKELY((index >= io_group_queues->group_phy_queues_.count() && INT64_MAX != index))) { + ret = OB_INVALID_CONFIG; + LOG_WARN("invalid index", K(ret), K(index)); } else { ObPhyQueue *tmp_phy_queue = index == INT64_MAX ? &(io_group_queues->other_phy_queue_) : io_group_queues->group_phy_queues_.at(index); diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result index 837d36aca2..fd5f49c15e 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result @@ -585,6 +585,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 12364 __all_virtual_ls_arb_replica_task 2 201001 1 12365 __all_virtual_ls_arb_replica_task_history 2 201001 1 12366 __all_virtual_archive_dest_status 2 201001 1 +12369 __all_virtual_io_scheduler 2 201001 1 20001 GV$OB_PLAN_CACHE_STAT 1 201001 1 20002 GV$OB_PLAN_CACHE_PLAN_STAT 1 201001 1 20003 SCHEMATA 1 201002 1 @@ -875,6 +876,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 21362 V$OB_ARCHIVE_DEST_STATUS 1 201001 1 21363 DBA_OB_LS_LOG_ARCHIVE_PROGRESS 1 201001 1 21364 CDB_OB_LS_LOG_ARCHIVE_PROGRESS 1 201001 1 +21369 DBA_OB_RSRC_IO_DIRECTIVES 1 201001 1 check sys table count and table_id range success check count and table_id range for virtual table success select * from information_schema.CHARACTER_SETS limit 1;