[4.1] add tablet_change_scn to __all_virtual_ls_info

This commit is contained in:
obdev
2023-03-09 13:11:07 +00:00
committed by ob-robot
parent ae6eea62f1
commit 8086a65ad4
5 changed files with 22 additions and 0 deletions

View File

@ -185,6 +185,10 @@ int ObAllVirtualLSInfo::process_curr_tenant(ObNewRow *&row)
// rebuild_seq
cur_row_.cells_[i].set_int(ls_info.rebuild_seq_);
break;
case OB_APP_MIN_COLUMN_ID + 13:
// clog_checkpoint_ts
cur_row_.cells_[i].set_uint64(!ls_info.tablet_change_checkpoint_scn_.is_valid() ? 0 : ls_info.tablet_change_checkpoint_scn_.get_val_for_tx());
break;
default:
ret = OB_ERR_UNEXPECTED;
SERVER_LOG(WARN, "invalid col_id", K(ret), K(col_id));

View File

@ -9372,6 +9372,21 @@ int ObInnerTableSchema::all_virtual_ls_info_schema(ObTableSchema &table_schema)
false, //is_nullable
false); //is_autoincrement
}
if (OB_SUCC(ret)) {
ADD_COLUMN_SCHEMA("tablet_change_checkpoint_scn_", //column_name
++column_id, //column_id
0, //rowkey_id
0, //index_id
0, //part_key_pos
ObUInt64Type, //column_type
CS_TYPE_INVALID, //column_collation_type
sizeof(uint64_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

@ -10510,6 +10510,7 @@ def_table_schema(
('checkpoint_lsn', 'uint'),
('migrate_status', 'int'),
('rebuild_seq', 'int'),
('tablet_change_checkpoint_scn_', 'uint'),
],
partition_columns = ['svr_ip', 'svr_port'],
vtable_route_policy = 'distributed',

View File

@ -1044,6 +1044,7 @@ int ObLS::get_ls_info(ObLSVTInfo &ls_info)
ls_info.checkpoint_scn_ = ls_meta_.get_clog_checkpoint_scn();
ls_info.checkpoint_lsn_ = ls_meta_.get_clog_base_lsn().val_;
ls_info.rebuild_seq_ = ls_meta_.get_rebuild_seq();
ls_info.tablet_change_checkpoint_scn_ = ls_meta_.get_tablet_change_checkpoint_scn();
}
return ret;
}

View File

@ -87,6 +87,7 @@ struct ObLSVTInfo
//TODO SCN
int64_t checkpoint_lsn_;
int64_t rebuild_seq_;
share::SCN tablet_change_checkpoint_scn_;
};
// 诊断虚表统计信息