[TABLELOCK] placeholder for wait_seq and priority of inner_table all_virtual_obj_lock

This commit is contained in:
YangEfei 2024-11-20 13:15:34 +00:00 committed by ob-robot
parent 6ffbf2f1a6
commit b54c5a7836
8 changed files with 75 additions and 0 deletions

View File

@ -109,6 +109,7 @@ const int64_t MAX_LOCK_OP_TYPE_BUF_LENGTH = 32;
const int64_t MAX_LOCK_OP_STATUS_BUF_LENGTH = 16;
const int64_t MAX_LOCK_OP_EXTRA_INFO_LENGTH = 256;
const int64_t MAX_LOCK_DETECT_PARAM_LENGTH = 512;
const int64_t MAX_LOCK_OP_PRIORITY_BUF_LENGTH = 16;
const int64_t MAX_SERVICE_TYPE_BUF_LENGTH = 32;
const int64_t MAX_CHECKPOINT_TYPE_BUF_LENGTH = 32;
const int64_t MAX_FREEZE_CHECKPOINT_LOCATION_BUF_LENGTH = 16;

View File

@ -419,6 +419,12 @@ int ObAllVirtualObjLock::process_curr_tenant(ObNewRow *&row)
// TODO: set the column with real data
break;
}
case PRIORITY: {
break;
}
case WAIT_SEQ: {
break;
}
default:
ret = OB_ERR_UNEXPECTED;
SERVER_LOG(WARN, "invalid col_id", K(ret), K(col_id));

View File

@ -71,6 +71,8 @@ private:
OBJ_TYPE,
OBJ_ID,
OWNER_TYPE,
PRIORITY,
WAIT_SEQ
};
private:
common::ObAddr addr_;

View File

@ -10608,6 +10608,36 @@ int ObInnerTableSchema::all_virtual_obj_lock_schema(ObTableSchema &table_schema)
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("priority", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObVarcharType, //column_type
CS_TYPE_INVALID, //column_collation_type
MAX_LOCK_OP_PRIORITY_BUF_LENGTH, //column_length
-1, //column_precision
-1, //column_scale
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("wait_seq", //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)) {
table_schema.get_part_option().set_part_num(1);
table_schema.set_part_level(PARTITION_LEVEL_ONE);

View File

@ -1113,6 +1113,36 @@ int ObInnerTableSchema::all_virtual_obj_lock_ora_schema(ObTableSchema &table_sch
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("PRIORITY", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObVarcharType, //column_type
CS_TYPE_UTF8MB4_BIN, //column_collation_type
MAX_LOCK_OP_PRIORITY_BUF_LENGTH, //column_length
2, //column_precision
-1, //column_scale
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("WAIT_SEQ", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObNumberType, //column_type
CS_TYPE_INVALID, //column_collation_type
38, //column_length
38, //column_precision
0, //column_scale
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
table_schema.get_part_option().set_part_num(1);
table_schema.set_part_level(PARTITION_LEVEL_ONE);

View File

@ -12812,6 +12812,8 @@ def_table_schema(
('obj_type', 'varchar:MAX_LOCK_OBJ_TYPE_BUF_LENGTH'),
('obj_id', 'int'),
('owner_type', 'int'),
('priority', 'varchar:MAX_LOCK_OP_PRIORITY_BUF_LENGTH'),
('wait_seq', 'int')
],
partition_columns = ['svr_ip', 'svr_port'],
vtable_route_policy = 'distributed',

View File

@ -2940,6 +2940,8 @@ time_after_create bigint(20) NO NULL
obj_type varchar(32) NO NULL
obj_id bigint(20) NO NULL
owner_type bigint(20) NO NULL
priority varchar(16) NO NULL
wait_seq bigint(20) NO NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_obj_lock;
IF(count(*) >= 0, 1, 0)
1

View File

@ -6559,6 +6559,8 @@ time_after_create bigint(20) NO NULL
obj_type varchar(32) NO NULL
obj_id bigint(20) NO NULL
owner_type bigint(20) NO NULL
priority varchar(16) NO NULL
wait_seq bigint(20) NO NULL
select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_obj_lock;
IF(count(*) >= 0, 1, 0)
1