diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h index 97744e0e40..80025cce51 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h @@ -91,47 +91,6 @@ OB_SERIALIZE_MEMBER_TEMP(inline, PriorityV0, is_valid_, port_number_); // 适用于[4_0_0, latest] struct PriorityV1 : public AbstractPriority { -/**********************this is for some strange compact reason***********************/ - struct LOG_TS_WRAPPER { - LOG_TS_WRAPPER() : value_(0) {} - LOG_TS_WRAPPER(const int64_t log_ts) : value_(log_ts) {} - LOG_TS_WRAPPER &operator=(const int64_t log_ts) { - value_ = log_ts; - return *this; - } - int serialize(char *buf, const int64_t buf_len, int64_t &pos) const { - int ret = OB_SUCCESS; - int64_t new_pos = pos; - if (NULL == buf && buf_len <= 0) { - ret = OB_INVALID_ARGUMENT; - } else if (OB_FAIL(serialization::encode_i64(buf, buf_len, new_pos, value_))) { - ret = OB_BUF_NOT_ENOUGH; - } else { - pos = new_pos; - } - return ret; - } - int deserialize(const char *buf, const int64_t data_len, int64_t &pos) - { - int ret = OB_SUCCESS; - int64_t new_pos = pos; - if (NULL == buf && data_len <= 0) { - ret = OB_INVALID_ARGUMENT; - } else if (OB_FAIL(serialization::decode_i64(buf, data_len, new_pos, reinterpret_cast(&value_)))) { - ret = OB_BUF_NOT_ENOUGH; - } else { - pos = new_pos; - } - return ret; - } - int64_t get_serialize_size() const - { - int64_t size = 0 ; - size += serialization::encoded_length_i64(value_); - return size; - } - int64_t value_; - }; /*********************************************************************************/ static constexpr int64_t MAX_UNREPLAYED_LOG_TS_DIFF_THRESHOLD_NS = 2 * 1000 * 1000 * 1000L; friend class unittest::TestElectionPriority; @@ -147,7 +106,7 @@ public: // int assign(const PriorityV1 &rhs); TO_STRING_KV(K_(is_valid), K_(is_observer_stopped), K_(is_server_stopped), K_(is_zone_stopped), K_(fatal_failures), K_(is_primary_region), K_(serious_failures), K_(is_in_blacklist), - K_(in_blacklist_reason), K_(log_ts_.value), K_(is_manual_leader), K_(zone_priority)); + K_(in_blacklist_reason), K_(log_ts), K_(is_manual_leader), K_(zone_priority)); protected: // 刷新优先级的方法 virtual int refresh_(const share::ObLSID &ls_id) override; @@ -170,7 +129,7 @@ private: common::ObSArray fatal_failures_;// negative infos bool is_primary_region_; common::ObSArray serious_failures_;// negative infos - LOG_TS_WRAPPER log_ts_; + int64_t log_ts_; bool is_in_blacklist_; common::ObStringHolder in_blacklist_reason_; bool is_manual_leader_; diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp index 226e5b256d..82db647535 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp @@ -54,12 +54,6 @@ int PriorityV1::compare(const AbstractPriority &rhs, int &result, ObStringHolder } else if (COMPARE_OUT(compare_fatal_failures_(ret, rhs_impl))) {// 比较致命的异常 (void) reason.assign("FATAL FAILURE"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from fatal_failures_"); - } else if (COMPARE_OUT(compare_primary_region_(ret, rhs_impl))) {// 通常Leader不能选出primary region - (void) reason.assign("PRIMARY REGION"); - COORDINATOR_LOG_(TRACE, "compare done! get compared result from primary_region_"); - } else if (COMPARE_OUT(compare_serious_failures_(ret, rhs_impl))) {// 比较会导致切主的异常 - (void) reason.assign("SERIOUS FAILURE"); - COORDINATOR_LOG_(TRACE, "compare done! get compared result from serious_failures_"); } else if (COMPARE_OUT(compare_log_ts_(ret, rhs_impl))) {// 避免切换至回放位点过小的副本 (void) reason.assign("LOG TS"); COORDINATOR_LOG_(TRACE, "compare done! get compared resultfrom log_ts_"); @@ -68,6 +62,12 @@ int PriorityV1::compare(const AbstractPriority &rhs, int &result, ObStringHolder } else if (COMPARE_OUT(compare_manual_leader_flag_(ret, rhs_impl))) {// 比较是否存在用户指定的leader (void) reason.assign("MANUAL LEADER"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from manual_leader_flag_"); + } else if (COMPARE_OUT(compare_primary_region_(ret, rhs_impl))) {// 通常Leader不能选出primary region + (void) reason.assign("PRIMARY REGION"); + COORDINATOR_LOG_(TRACE, "compare done! get compared result from primary_region_"); + } else if (COMPARE_OUT(compare_serious_failures_(ret, rhs_impl))) {// 比较会导致切主的异常 + (void) reason.assign("SERIOUS FAILURE"); + COORDINATOR_LOG_(TRACE, "compare done! get compared result from serious_failures_"); } else if (COMPARE_OUT(compare_zone_priority_(ret, rhs_impl))) {// 比较RS设置的zone priority (void) reason.assign("ZONE PRIORITY"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from zone_priority_"); @@ -148,7 +148,7 @@ int PriorityV1::refresh_(const share::ObLSID &ls_id) is_primary_region_ = election_reference_info.element<6>(); is_observer_stopped_ = (observer::ObServer::get_instance().is_stopped() || observer::ObServer::get_instance().is_prepare_stopped()); - log_ts_.value_ = log_ts; + log_ts_ = log_ts; } return ret; #undef PRINT_WRAPPERd @@ -312,9 +312,9 @@ int PriorityV1::compare_log_ts_(int &ret, const PriorityV1&rhs) const { int compare_result = 0; if (OB_SUCC(ret)) { - if (std::max(log_ts_.value_, rhs.log_ts_.value_) - std::min(log_ts_.value_, rhs.log_ts_.value_) <= MAX_UNREPLAYED_LOG_TS_DIFF_THRESHOLD_NS) { + if (std::max(log_ts_, rhs.log_ts_) - std::min(log_ts_, rhs.log_ts_) <= MAX_UNREPLAYED_LOG_TS_DIFF_THRESHOLD_NS) { compare_result = 0; - } else if (std::max(log_ts_.value_, rhs.log_ts_.value_) == log_ts_.value_) { + } else if (std::max(log_ts_, rhs.log_ts_) == log_ts_) { compare_result = 1; } else { compare_result = -1; diff --git a/src/observer/virtual_table/ob_all_virtual_log_stat.cpp b/src/observer/virtual_table/ob_all_virtual_log_stat.cpp index 054f489a64..450b03b205 100644 --- a/src/observer/virtual_table/ob_all_virtual_log_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_log_stat.cpp @@ -172,49 +172,34 @@ int ObAllVirtualPalfStat::insert_log_stat_(const logservice::ObLogStat &log_stat break; } case OB_APP_MIN_COLUMN_ID + 10: { - cur_row_.cells_[i].set_bool(palf_stat.allow_vote_); - break; - } - case OB_APP_MIN_COLUMN_ID + 11: { cur_row_.cells_[i].set_bool(log_stat.in_sync_); break; } - case OB_APP_MIN_COLUMN_ID + 12: { - if (OB_FAIL(palf::log_replica_type_to_string(palf_stat.replica_type_, replica_type_str_, sizeof(replica_type_str_)))) { - SERVER_LOG(WARN, "log_replica_type_to_string failed", K(ret), K(palf_stat)); - } else { - cur_row_.cells_[i].set_varchar(ObString::make_string(replica_type_str_)); - cur_row_.cells_[i].set_collation_type(ObCharset::get_default_collation( - ObCharset::get_default_charset())); - } - break; - } - case OB_APP_MIN_COLUMN_ID + 13: { - //TODO SCN + case OB_APP_MIN_COLUMN_ID + 11: { cur_row_.cells_[i].set_uint64(palf_stat.base_lsn_.val_); break; } - case OB_APP_MIN_COLUMN_ID + 14: { + case OB_APP_MIN_COLUMN_ID + 12: { cur_row_.cells_[i].set_uint64(palf_stat.begin_lsn_.val_); break; } - case OB_APP_MIN_COLUMN_ID + 15: { + case OB_APP_MIN_COLUMN_ID + 13: { cur_row_.cells_[i].set_uint64(static_cast(palf_stat.begin_ts_ns_)); break; } - case OB_APP_MIN_COLUMN_ID + 16: { + case OB_APP_MIN_COLUMN_ID + 14: { cur_row_.cells_[i].set_uint64(palf_stat.end_lsn_.val_); break; } - case OB_APP_MIN_COLUMN_ID + 17: { + case OB_APP_MIN_COLUMN_ID + 15: { cur_row_.cells_[i].set_uint64(static_cast(palf_stat.end_ts_ns_)); break; } - case OB_APP_MIN_COLUMN_ID + 18: { + case OB_APP_MIN_COLUMN_ID + 16: { cur_row_.cells_[i].set_uint64(palf_stat.max_lsn_.val_); break; } - case OB_APP_MIN_COLUMN_ID + 19: { + case OB_APP_MIN_COLUMN_ID + 17: { cur_row_.cells_[i].set_uint64(static_cast(palf_stat.max_ts_ns_)); break; } diff --git a/src/share/backup/ob_backup_struct.h b/src/share/backup/ob_backup_struct.h index 429f8fe0cc..578fc8b582 100644 --- a/src/share/backup/ob_backup_struct.h +++ b/src/share/backup/ob_backup_struct.h @@ -255,7 +255,7 @@ const char *const OB_STR_MAX_FILE_ID = "max_file_id"; const char *const OB_STR_LOG_ARCHIVE_SOURCE_ID = "id"; const char *const OB_STR_LOG_ARCHIVE_SOURCE_TYPE = "type"; const char *const OB_STR_LOG_ARCHIVE_SOURCE_VALUE = "value"; -const char *const OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_TS = "recovery_until_ts"; +const char *const OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_SCN = "recovery_until_scn"; const char *const OB_STR_TENANT = "tenant"; const char *const OB_STR_DATA = "data"; @@ -500,7 +500,7 @@ struct ObBackupSetDesc { bool is_valid() const; bool operator==(const ObBackupSetDesc &other) const; void reset(); - + TO_STRING_KV(K_(backup_set_id), K_(backup_type)); int64_t backup_set_id_; ObBackupType backup_type_; // FULL OR INC @@ -540,7 +540,7 @@ public: int get_backup_set_desc_list_format_str( common::ObIAllocator &allocator, common::ObString &str) const; - + int get_backup_piece_list_format_str( common::ObIAllocator &allocator, common::ObString &str) const; @@ -1151,11 +1151,11 @@ public: CANCELING= 4, CANCELED = 5, BACKUP_SYS_META = 6, - BACKUP_USER_META = 7, - BACKUP_DATA_SYS = 8, + BACKUP_USER_META = 7, + BACKUP_DATA_SYS = 8, BACKUP_DATA_MINOR = 9, BACKUP_DATA_MAJOR = 10, - BACKUP_LOG = 11, + BACKUP_LOG = 11, MAX_STATUS }; ObBackupStatus(): status_(MAX_STATUS) {} @@ -1296,8 +1296,8 @@ public: bool is_valid() const; int assign(const ObBackupSetTaskAttr &other); - TO_STRING_KV(K_(task_id), K_(tenant_id), K_(incarnation_id), K_(job_id), K_(backup_set_id), K_(start_ts), K_(end_ts), - K_(start_scn), K_(end_scn), K_(user_ls_start_scn), K_(data_turn_id), K_(meta_turn_id), K_(status), + TO_STRING_KV(K_(task_id), K_(tenant_id), K_(incarnation_id), K_(job_id), K_(backup_set_id), K_(start_ts), K_(end_ts), + K_(start_scn), K_(end_scn), K_(user_ls_start_scn), K_(data_turn_id), K_(meta_turn_id), K_(status), K_(encryption_mode), K_(passwd), K_(stats), K_(backup_path), K_(retry_cnt), K_(result)); int64_t task_id_; uint64_t tenant_id_; @@ -1388,7 +1388,7 @@ public: MAX, }; - enum Compatible : int64_t + enum Compatible : int64_t { COMPATIBLE_VERSION_1 = 1, // 4.0 MAX_COMPATIBLE_VERSION, @@ -1413,9 +1413,9 @@ public: int check_passwd(const char *passwd_array) const; int assign(const ObBackupSetFileDesc &other); - TO_STRING_KV(K_(backup_set_id), K_(incarnation), K_(tenant_id), K_(dest_id), K_(backup_type), K_(plus_archivelog), - K_(date), K_(prev_full_backup_set_id), K_(prev_inc_backup_set_id), K_(stats), K_(start_time), K_(end_time), - K_(status), K_(result), K_(encryption_mode), K_(passwd), K_(file_status), K_(backup_path), K_(start_replay_scn), + TO_STRING_KV(K_(backup_set_id), K_(incarnation), K_(tenant_id), K_(dest_id), K_(backup_type), K_(plus_archivelog), + K_(date), K_(prev_full_backup_set_id), K_(prev_inc_backup_set_id), K_(stats), K_(start_time), K_(end_time), + K_(status), K_(result), K_(encryption_mode), K_(passwd), K_(file_status), K_(backup_path), K_(start_replay_scn), K_(min_restore_scn), K_(tenant_compatible), K_(backup_compatible), K_(data_turn_id), K_(meta_turn_id)); int64_t backup_set_id_; @@ -1545,7 +1545,7 @@ struct ObLogArchiveDestState final PROPERTY_DECLARE_STATUS(disable, State::DISABLE); PROPERTY_DECLARE_STATUS(defer, State::DEFER); PROPERTY_DECLARE_STATUS(interrupt, State::INTERRUPT); - + #undef PROPERTY_DECLARE_STATUS TO_STRING_KV(K_(state)); diff --git a/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp b/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp index 5a62e497fe..858305c8f3 100644 --- a/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12251_12300.cpp @@ -998,21 +998,6 @@ int ObInnerTableSchema::all_virtual_log_stat_schema(ObTableSchema &table_schema) false); //is_autoincrement } - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("allow_vote", //column_name - ++column_id, //column_id - 0, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTinyIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - 1, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false); //is_autoincrement - } - if (OB_SUCC(ret)) { ADD_COLUMN_SCHEMA("in_sync", //column_name ++column_id, //column_id @@ -1028,21 +1013,6 @@ int ObInnerTableSchema::all_virtual_log_stat_schema(ObTableSchema &table_schema) false); //is_autoincrement } - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("replica_type", //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 - 32, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false); //is_autoincrement - } - if (OB_SUCC(ret)) { ADD_COLUMN_SCHEMA("base_lsn", //column_name ++column_id, //column_id diff --git a/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp b/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp index f07ce7a1f4..219b55f666 100644 --- a/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12301_12350.cpp @@ -5662,7 +5662,7 @@ int ObInnerTableSchema::all_virtual_mock_fk_parent_table_column_history_schema(O return ret; } -int ObInnerTableSchema::all_virtual_log_archive_source_schema(ObTableSchema &table_schema) +int ObInnerTableSchema::all_virtual_log_restore_source_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; @@ -5671,7 +5671,7 @@ int ObInnerTableSchema::all_virtual_log_archive_source_schema(ObTableSchema &tab 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_LOG_ARCHIVE_SOURCE_TID); + table_schema.set_table_id(OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TID); table_schema.set_rowkey_split_pos(0); table_schema.set_is_use_bloomfilter(false); table_schema.set_progressive_merge_num(0); @@ -5682,7 +5682,7 @@ int ObInnerTableSchema::all_virtual_log_archive_source_schema(ObTableSchema &tab table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_LOG_ARCHIVE_SOURCE_TNAME))) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TNAME))) { LOG_ERROR("fail to set table_name", K(ret)); } } @@ -5789,14 +5789,14 @@ int ObInnerTableSchema::all_virtual_log_archive_source_schema(ObTableSchema &tab } if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("recovery_until_ts", //column_name + ADD_COLUMN_SCHEMA("recovery_until_scn", //column_name ++column_id, //column_id 0, //rowkey_id 0, //index_id 0, //part_key_pos - ObIntType, //column_type + ObUInt64Type, //column_type CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length + sizeof(uint64_t), //column_length -1, //column_precision -1, //column_scale false, //is_nullable diff --git a/src/share/inner_table/ob_inner_table_schema.15251_15300.cpp b/src/share/inner_table/ob_inner_table_schema.15251_15300.cpp index 782fd9a35f..c587f0e3fe 100644 --- a/src/share/inner_table/ob_inner_table_schema.15251_15300.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15251_15300.cpp @@ -3124,21 +3124,6 @@ int ObInnerTableSchema::all_virtual_log_stat_ora_schema(ObTableSchema &table_sch false); //is_autoincrement } - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ALLOW_VOTE", //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)) { ADD_COLUMN_SCHEMA("IN_SYNC", //column_name ++column_id, //column_id @@ -3154,21 +3139,6 @@ int ObInnerTableSchema::all_virtual_log_stat_ora_schema(ObTableSchema &table_sch false); //is_autoincrement } - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("REPLICA_TYPE", //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 - 32, //column_length - 2, //column_precision - -1, //column_scale - false, //is_nullable - false); //is_autoincrement - } - if (OB_SUCC(ret)) { ADD_COLUMN_SCHEMA("BASE_LSN", //column_name ++column_id, //column_id diff --git a/src/share/inner_table/ob_inner_table_schema.21301_21350.cpp b/src/share/inner_table/ob_inner_table_schema.21301_21350.cpp index aa0ad38f27..f9a5cc52ce 100644 --- a/src/share/inner_table/ob_inner_table_schema.21301_21350.cpp +++ b/src/share/inner_table/ob_inner_table_schema.21301_21350.cpp @@ -59,7 +59,7 @@ int ObInnerTableSchema::gv_ob_log_stat_schema(ObTableSchema &table_schema) 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 TENANT_ID, LS_ID, SVR_IP, SVR_PORT, ROLE, PROPOSAL_ID, CONFIG_VERSION, ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, CASE allow_vote WHEN 1 THEN 'YES' ELSE 'NO' END AS ALLOW_VOTE, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, REPLICA_TYPE, BASE_LSN, BEGIN_LSN, BEGIN_SCN, END_LSN, END_SCN, MAX_LSN, MAX_SCN FROM oceanbase.__all_virtual_log_stat )__"))) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT TENANT_ID, LS_ID, SVR_IP, SVR_PORT, ROLE, PROPOSAL_ID, CONFIG_VERSION, ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, BASE_LSN, BEGIN_LSN, BEGIN_SCN, END_LSN, END_SCN, MAX_LSN, MAX_SCN FROM oceanbase.__all_virtual_log_stat )__"))) { LOG_ERROR("fail to set view_definition", K(ret)); } } diff --git a/src/share/inner_table/ob_inner_table_schema.28101_28150.cpp b/src/share/inner_table/ob_inner_table_schema.28101_28150.cpp index b4aabda29c..a21e23d014 100644 --- a/src/share/inner_table/ob_inner_table_schema.28101_28150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.28101_28150.cpp @@ -2409,7 +2409,7 @@ int ObInnerTableSchema::gv_ob_log_stat_ora_schema(ObTableSchema &table_schema) 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 TENANT_ID, LS_ID, SVR_IP, SVR_PORT, ROLE, PROPOSAL_ID, CONFIG_VERSION, ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, CASE allow_vote WHEN 1 THEN 'YES' ELSE 'NO' END AS ALLOW_VOTE, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, REPLICA_TYPE, BASE_LSN, BEGIN_LSN, BEGIN_SCN, END_LSN, END_SCN, MAX_LSN, MAX_SCN FROM SYS.ALL_VIRTUAL_LOG_STAT )__"))) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT TENANT_ID, LS_ID, SVR_IP, SVR_PORT, ROLE, PROPOSAL_ID, CONFIG_VERSION, ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, BASE_LSN, BEGIN_LSN, BEGIN_SCN, END_LSN, END_SCN, MAX_LSN, MAX_SCN FROM SYS.ALL_VIRTUAL_LOG_STAT )__"))) { LOG_ERROR("fail to set view_definition", K(ret)); } } diff --git a/src/share/inner_table/ob_inner_table_schema.401_450.cpp b/src/share/inner_table/ob_inner_table_schema.401_450.cpp index 6643772397..23941172ae 100644 --- a/src/share/inner_table/ob_inner_table_schema.401_450.cpp +++ b/src/share/inner_table/ob_inner_table_schema.401_450.cpp @@ -2038,7 +2038,7 @@ int ObInnerTableSchema::all_mock_fk_parent_table_column_history_schema(ObTableSc return ret; } -int ObInnerTableSchema::all_log_archive_source_schema(ObTableSchema &table_schema) +int ObInnerTableSchema::all_log_restore_source_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; @@ -2047,7 +2047,7 @@ int ObInnerTableSchema::all_log_archive_source_schema(ObTableSchema &table_schem table_schema.set_tenant_id(OB_SYS_TENANT_ID); table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID); table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_LOG_ARCHIVE_SOURCE_TID); + table_schema.set_table_id(OB_ALL_LOG_RESTORE_SOURCE_TID); table_schema.set_rowkey_split_pos(0); table_schema.set_is_use_bloomfilter(false); table_schema.set_progressive_merge_num(0); @@ -2058,7 +2058,7 @@ int ObInnerTableSchema::all_log_archive_source_schema(ObTableSchema &table_schem table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_ARCHIVE_SOURCE_TNAME))) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_RESTORE_SOURCE_TNAME))) { LOG_ERROR("fail to set table_name", K(ret)); } } @@ -2179,14 +2179,14 @@ int ObInnerTableSchema::all_log_archive_source_schema(ObTableSchema &table_schem } if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("recovery_until_ts", //column_name + ADD_COLUMN_SCHEMA("recovery_until_scn", //column_name ++column_id, //column_id 0, //rowkey_id 0, //index_id 0, //part_key_pos - ObIntType, //column_type + ObUInt64Type, //column_type CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length + sizeof(uint64_t), //column_length -1, //column_precision -1, //column_scale false, //is_nullable @@ -2197,9 +2197,9 @@ int ObInnerTableSchema::all_log_archive_source_schema(ObTableSchema &table_schem 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(OB_ALL_LOG_ARCHIVE_SOURCE_TID); - table_schema.set_aux_lob_meta_tid(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID); - table_schema.set_aux_lob_piece_tid(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID); + table_schema.set_tablet_id(OB_ALL_LOG_RESTORE_SOURCE_TID); + table_schema.set_aux_lob_meta_tid(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID); + table_schema.set_aux_lob_piece_tid(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID); table_schema.set_max_used_column_id(column_id); return ret; diff --git a/src/share/inner_table/ob_inner_table_schema.50401_50450.cpp b/src/share/inner_table/ob_inner_table_schema.50401_50450.cpp index b746f5cf6c..bac347b8bf 100644 --- a/src/share/inner_table/ob_inner_table_schema.50401_50450.cpp +++ b/src/share/inner_table/ob_inner_table_schema.50401_50450.cpp @@ -1239,7 +1239,7 @@ int ObInnerTableSchema::all_mock_fk_parent_table_column_history_aux_lob_meta_sch return ret; } -int ObInnerTableSchema::all_log_archive_source_aux_lob_meta_schema(ObTableSchema &table_schema) +int ObInnerTableSchema::all_log_restore_source_aux_lob_meta_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; @@ -1248,7 +1248,7 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_meta_schema(ObTableSchema table_schema.set_tenant_id(OB_SYS_TENANT_ID); table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID); table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID); + table_schema.set_table_id(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID); table_schema.set_rowkey_split_pos(0); table_schema.set_is_use_bloomfilter(false); table_schema.set_progressive_merge_num(0); @@ -1259,7 +1259,7 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_meta_schema(ObTableSchema table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TNAME))) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TNAME))) { LOG_ERROR("fail to set table_name", K(ret)); } } @@ -1367,8 +1367,8 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_meta_schema(ObTableSchema 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(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID); - table_schema.set_data_table_id(OB_ALL_LOG_ARCHIVE_SOURCE_TID); + table_schema.set_tablet_id(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID); + table_schema.set_data_table_id(OB_ALL_LOG_RESTORE_SOURCE_TID); table_schema.set_max_used_column_id(column_id); return ret; diff --git a/src/share/inner_table/ob_inner_table_schema.60401_60450.cpp b/src/share/inner_table/ob_inner_table_schema.60401_60450.cpp index c6bd30d95c..d3d0c50016 100644 --- a/src/share/inner_table/ob_inner_table_schema.60401_60450.cpp +++ b/src/share/inner_table/ob_inner_table_schema.60401_60450.cpp @@ -834,7 +834,7 @@ int ObInnerTableSchema::all_mock_fk_parent_table_column_history_aux_lob_piece_sc return ret; } -int ObInnerTableSchema::all_log_archive_source_aux_lob_piece_schema(ObTableSchema &table_schema) +int ObInnerTableSchema::all_log_restore_source_aux_lob_piece_schema(ObTableSchema &table_schema) { int ret = OB_SUCCESS; uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; @@ -843,7 +843,7 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_piece_schema(ObTableSchem table_schema.set_tenant_id(OB_SYS_TENANT_ID); table_schema.set_tablegroup_id(OB_SYS_TABLEGROUP_ID); table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID); + table_schema.set_table_id(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID); table_schema.set_rowkey_split_pos(0); table_schema.set_is_use_bloomfilter(false); table_schema.set_progressive_merge_num(0); @@ -854,7 +854,7 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_piece_schema(ObTableSchem table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TNAME))) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TNAME))) { LOG_ERROR("fail to set table_name", K(ret)); } } @@ -917,8 +917,8 @@ int ObInnerTableSchema::all_log_archive_source_aux_lob_piece_schema(ObTableSchem 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(OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID); - table_schema.set_data_table_id(OB_ALL_LOG_ARCHIVE_SOURCE_TID); + table_schema.set_tablet_id(OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID); + table_schema.set_data_table_id(OB_ALL_LOG_RESTORE_SOURCE_TID); table_schema.set_max_used_column_id(column_id); return ret; diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index df1c81a1f1..f3dfaf3b3c 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -492,7 +492,7 @@ public: static int all_mock_fk_parent_table_history_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_history_schema(share::schema::ObTableSchema &table_schema); - static int all_log_archive_source_schema(share::schema::ObTableSchema &table_schema); + static int all_log_restore_source_schema(share::schema::ObTableSchema &table_schema); static int all_service_epoch_schema(share::schema::ObTableSchema &table_schema); static int all_column_checksum_error_info_schema(share::schema::ObTableSchema &table_schema); static int tenant_virtual_all_table_schema(share::schema::ObTableSchema &table_schema); @@ -825,7 +825,7 @@ public: static int all_virtual_mock_fk_parent_table_history_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_mock_fk_parent_table_column_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_mock_fk_parent_table_column_history_schema(share::schema::ObTableSchema &table_schema); - static int all_virtual_log_archive_source_schema(share::schema::ObTableSchema &table_schema); + static int all_virtual_log_restore_source_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_query_response_time_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_column_checksum_error_info_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_kvcache_handle_leak_info_schema(share::schema::ObTableSchema &table_schema); @@ -1841,7 +1841,7 @@ public: static int all_mock_fk_parent_table_history_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_history_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); - static int all_log_archive_source_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); + static int all_log_restore_source_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_service_epoch_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_column_checksum_error_info_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_table_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); @@ -2056,7 +2056,7 @@ public: static int all_mock_fk_parent_table_history_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); static int all_mock_fk_parent_table_column_history_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); - static int all_log_archive_source_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); + static int all_log_restore_source_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); static int all_service_epoch_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); static int all_column_checksum_error_info_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_plan_cache_stat_all_virtual_plan_cache_stat_i1_schema(share::schema::ObTableSchema &table_schema); @@ -2307,7 +2307,7 @@ const schema_create_func sys_table_schema_creators [] = { ObInnerTableSchema::all_mock_fk_parent_table_history_schema, ObInnerTableSchema::all_mock_fk_parent_table_column_schema, ObInnerTableSchema::all_mock_fk_parent_table_column_history_schema, - ObInnerTableSchema::all_log_archive_source_schema, + ObInnerTableSchema::all_log_restore_source_schema, ObInnerTableSchema::all_service_epoch_schema, ObInnerTableSchema::all_column_checksum_error_info_schema, NULL,}; @@ -2643,7 +2643,7 @@ const schema_create_func virtual_table_schema_creators [] = { ObInnerTableSchema::all_virtual_mock_fk_parent_table_history_schema, ObInnerTableSchema::all_virtual_mock_fk_parent_table_column_schema, ObInnerTableSchema::all_virtual_mock_fk_parent_table_column_history_schema, - ObInnerTableSchema::all_virtual_log_archive_source_schema, + ObInnerTableSchema::all_virtual_log_restore_source_schema, ObInnerTableSchema::all_virtual_query_response_time_schema, ObInnerTableSchema::all_virtual_column_checksum_error_info_schema, ObInnerTableSchema::all_virtual_kvcache_handle_leak_info_schema, @@ -3676,7 +3676,7 @@ const uint64_t tenant_space_tables [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TID, - OB_ALL_LOG_ARCHIVE_SOURCE_TID, + OB_ALL_LOG_RESTORE_SOURCE_TID, OB_ALL_SERVICE_EPOCH_TID, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_TID, OB_TENANT_VIRTUAL_ALL_TABLE_TID, @@ -4761,7 +4761,7 @@ const uint64_t tenant_space_tables [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_META_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_META_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_META_TID, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID, OB_ALL_SERVICE_EPOCH_AUX_LOB_META_TID, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_META_TID, OB_ALL_TABLE_AUX_LOB_PIECE_TID, @@ -4953,7 +4953,7 @@ const uint64_t tenant_space_tables [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_PIECE_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_PIECE_TID, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_PIECE_TID, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID, OB_ALL_SERVICE_EPOCH_AUX_LOB_PIECE_TID, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_PIECE_TID, }; @@ -5373,7 +5373,7 @@ const char* const tenant_space_table_names [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TNAME, - OB_ALL_LOG_ARCHIVE_SOURCE_TNAME, + OB_ALL_LOG_RESTORE_SOURCE_TNAME, OB_ALL_SERVICE_EPOCH_TNAME, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_TNAME, OB_TENANT_VIRTUAL_ALL_TABLE_TNAME, @@ -6458,7 +6458,7 @@ const char* const tenant_space_table_names [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_META_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_META_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_META_TNAME, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TNAME, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TNAME, OB_ALL_SERVICE_EPOCH_AUX_LOB_META_TNAME, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_META_TNAME, OB_ALL_TABLE_AUX_LOB_PIECE_TNAME, @@ -6650,7 +6650,7 @@ const char* const tenant_space_table_names [] = { OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_PIECE_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_PIECE_TNAME, OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_PIECE_TNAME, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TNAME, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TNAME, OB_ALL_SERVICE_EPOCH_AUX_LOB_PIECE_TNAME, OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_PIECE_TNAME, }; @@ -8747,11 +8747,11 @@ LOBMapping const lob_aux_table_mappings [] = { }, { - OB_ALL_LOG_ARCHIVE_SOURCE_TID, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID, - OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID, - ObInnerTableSchema::all_log_archive_source_aux_lob_meta_schema, - ObInnerTableSchema::all_log_archive_source_aux_lob_piece_schema + OB_ALL_LOG_RESTORE_SOURCE_TID, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID, + OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID, + ObInnerTableSchema::all_log_restore_source_aux_lob_meta_schema, + ObInnerTableSchema::all_log_restore_source_aux_lob_piece_schema }, { 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 5a37b0d0c6..7fd10b414d 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -240,7 +240,7 @@ const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_TID = 405; // "__all_mock_fk_parent_t const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_TID = 406; // "__all_mock_fk_parent_table_history" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_TID = 407; // "__all_mock_fk_parent_table_column" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TID = 408; // "__all_mock_fk_parent_table_column_history" -const uint64_t OB_ALL_LOG_ARCHIVE_SOURCE_TID = 409; // "__all_log_archive_source" +const uint64_t OB_ALL_LOG_RESTORE_SOURCE_TID = 409; // "__all_log_restore_source" const uint64_t OB_ALL_SERVICE_EPOCH_TID = 412; // "__all_service_epoch" const uint64_t OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_TID = 416; // "__all_column_checksum_error_info" const uint64_t OB_TENANT_VIRTUAL_ALL_TABLE_TID = 10001; // "__tenant_virtual_all_table" @@ -573,7 +573,7 @@ const uint64_t OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_TID = 12320; // "__all_virtua const uint64_t OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_HISTORY_TID = 12321; // "__all_virtual_mock_fk_parent_table_history" const uint64_t OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_COLUMN_TID = 12322; // "__all_virtual_mock_fk_parent_table_column" const uint64_t OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TID = 12323; // "__all_virtual_mock_fk_parent_table_column_history" -const uint64_t OB_ALL_VIRTUAL_LOG_ARCHIVE_SOURCE_TID = 12324; // "__all_virtual_log_archive_source" +const uint64_t OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TID = 12324; // "__all_virtual_log_restore_source" const uint64_t OB_ALL_VIRTUAL_QUERY_RESPONSE_TIME_TID = 12325; // "__all_virtual_query_response_time" const uint64_t OB_ALL_VIRTUAL_COLUMN_CHECKSUM_ERROR_INFO_TID = 12330; // "__all_virtual_column_checksum_error_info" const uint64_t OB_ALL_VIRTUAL_KVCACHE_HANDLE_LEAK_INFO_TID = 12331; // "__all_virtual_kvcache_handle_leak_info" @@ -1589,7 +1589,7 @@ const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_AUX_LOB_META_TID = 50405; // "__all_m const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_META_TID = 50406; // "__all_mock_fk_parent_table_history_aux_lob_meta" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_META_TID = 50407; // "__all_mock_fk_parent_table_column_aux_lob_meta" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_META_TID = 50408; // "__all_mock_fk_parent_table_column_history_aux_lob_meta" -const uint64_t OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID = 50409; // "__all_log_archive_source_aux_lob_meta" +const uint64_t OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID = 50409; // "__all_log_restore_source_aux_lob_meta" const uint64_t OB_ALL_SERVICE_EPOCH_AUX_LOB_META_TID = 50412; // "__all_service_epoch_aux_lob_meta" const uint64_t OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_META_TID = 50416; // "__all_column_checksum_error_info_aux_lob_meta" const uint64_t OB_ALL_TABLE_AUX_LOB_PIECE_TID = 60003; // "__all_table_aux_lob_piece" @@ -1804,7 +1804,7 @@ const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_AUX_LOB_PIECE_TID = 60405; // "__all_ const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_PIECE_TID = 60406; // "__all_mock_fk_parent_table_history_aux_lob_piece" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_PIECE_TID = 60407; // "__all_mock_fk_parent_table_column_aux_lob_piece" const uint64_t OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_PIECE_TID = 60408; // "__all_mock_fk_parent_table_column_history_aux_lob_piece" -const uint64_t OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID = 60409; // "__all_log_archive_source_aux_lob_piece" +const uint64_t OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID = 60409; // "__all_log_restore_source_aux_lob_piece" const uint64_t OB_ALL_SERVICE_EPOCH_AUX_LOB_PIECE_TID = 60412; // "__all_service_epoch_aux_lob_piece" const uint64_t OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_PIECE_TID = 60416; // "__all_column_checksum_error_info_aux_lob_piece" const uint64_t OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TID = 14999; // "__all_virtual_plan_cache_stat" @@ -2042,7 +2042,7 @@ const char *const OB_ALL_MOCK_FK_PARENT_TABLE_TNAME = "__all_mock_fk_parent_tabl const char *const OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_TNAME = "__all_mock_fk_parent_table_history"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_TNAME = "__all_mock_fk_parent_table_column"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TNAME = "__all_mock_fk_parent_table_column_history"; -const char *const OB_ALL_LOG_ARCHIVE_SOURCE_TNAME = "__all_log_archive_source"; +const char *const OB_ALL_LOG_RESTORE_SOURCE_TNAME = "__all_log_restore_source"; const char *const OB_ALL_SERVICE_EPOCH_TNAME = "__all_service_epoch"; const char *const OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_TNAME = "__all_column_checksum_error_info"; const char *const OB_TENANT_VIRTUAL_ALL_TABLE_TNAME = "__tenant_virtual_all_table"; @@ -2375,7 +2375,7 @@ const char *const OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_TNAME = "__all_virtual_moc const char *const OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_HISTORY_TNAME = "__all_virtual_mock_fk_parent_table_history"; const char *const OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_COLUMN_TNAME = "__all_virtual_mock_fk_parent_table_column"; const char *const OB_ALL_VIRTUAL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_TNAME = "__all_virtual_mock_fk_parent_table_column_history"; -const char *const OB_ALL_VIRTUAL_LOG_ARCHIVE_SOURCE_TNAME = "__all_virtual_log_archive_source"; +const char *const OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TNAME = "__all_virtual_log_restore_source"; const char *const OB_ALL_VIRTUAL_QUERY_RESPONSE_TIME_TNAME = "__all_virtual_query_response_time"; const char *const OB_ALL_VIRTUAL_COLUMN_CHECKSUM_ERROR_INFO_TNAME = "__all_virtual_column_checksum_error_info"; const char *const OB_ALL_VIRTUAL_KVCACHE_HANDLE_LEAK_INFO_TNAME = "__all_virtual_kvcache_handle_leak_info"; @@ -3391,7 +3391,7 @@ const char *const OB_ALL_MOCK_FK_PARENT_TABLE_AUX_LOB_META_TNAME = "__all_mock_f const char *const OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_META_TNAME = "__all_mock_fk_parent_table_history_aux_lob_meta"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_META_TNAME = "__all_mock_fk_parent_table_column_aux_lob_meta"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_META_TNAME = "__all_mock_fk_parent_table_column_history_aux_lob_meta"; -const char *const OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TNAME = "__all_log_archive_source_aux_lob_meta"; +const char *const OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TNAME = "__all_log_restore_source_aux_lob_meta"; const char *const OB_ALL_SERVICE_EPOCH_AUX_LOB_META_TNAME = "__all_service_epoch_aux_lob_meta"; const char *const OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_META_TNAME = "__all_column_checksum_error_info_aux_lob_meta"; const char *const OB_ALL_TABLE_AUX_LOB_PIECE_TNAME = "__all_table_aux_lob_piece"; @@ -3606,7 +3606,7 @@ const char *const OB_ALL_MOCK_FK_PARENT_TABLE_AUX_LOB_PIECE_TNAME = "__all_mock_ const char *const OB_ALL_MOCK_FK_PARENT_TABLE_HISTORY_AUX_LOB_PIECE_TNAME = "__all_mock_fk_parent_table_history_aux_lob_piece"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_AUX_LOB_PIECE_TNAME = "__all_mock_fk_parent_table_column_aux_lob_piece"; const char *const OB_ALL_MOCK_FK_PARENT_TABLE_COLUMN_HISTORY_AUX_LOB_PIECE_TNAME = "__all_mock_fk_parent_table_column_history_aux_lob_piece"; -const char *const OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TNAME = "__all_log_archive_source_aux_lob_piece"; +const char *const OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TNAME = "__all_log_restore_source_aux_lob_piece"; const char *const OB_ALL_SERVICE_EPOCH_AUX_LOB_PIECE_TNAME = "__all_service_epoch_aux_lob_piece"; const char *const OB_ALL_COLUMN_CHECKSUM_ERROR_INFO_AUX_LOB_PIECE_TNAME = "__all_column_checksum_error_info_aux_lob_piece"; const char *const OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME = "__idx_11003_all_virtual_plan_cache_stat_i1"; 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 644a10149e..4aec2e275f 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -5023,10 +5023,10 @@ def_table_schema(**all_mock_fk_parent_table_column_def) def_table_schema(**gen_history_table_def(408, all_mock_fk_parent_table_column_def)) -# 409 : __all_log_archive_source +# 409 : __all_log_restore_source def_table_schema( owner = 'shuning.tsn', - table_name = '__all_log_archive_source', + table_name = '__all_log_restore_source', table_id = '409', table_type = 'SYSTEM_TABLE', gm_columns = ['gmt_create', 'gmt_modified'], @@ -5042,7 +5042,7 @@ def_table_schema( normal_columns = [ ('type', 'varchar:32'), ('value', 'longtext'), - ('recovery_until_ts', 'int'), + ('recovery_until_scn', 'uint'), ], ) @@ -9775,9 +9775,7 @@ def_table_schema( ('access_mode', 'varchar:32'), ('paxos_member_list', 'varchar:1024'), ('paxos_replica_num', 'int'), - ('allow_vote', 'bool'), ('in_sync', 'bool'), - ('replica_type', 'varchar:32'), ('base_lsn', 'uint'), ('begin_lsn', 'uint'), ('begin_scn', 'uint'), @@ -10600,8 +10598,8 @@ def_table_schema(**gen_iterate_virtual_table_def( def_table_schema(**gen_iterate_private_virtual_table_def( table_id = '12324', - table_name = '__all_virtual_log_archive_source', - keywords = all_def_keywords['__all_log_archive_source'])) + table_name = '__all_virtual_log_restore_source', + keywords = all_def_keywords['__all_log_restore_source'])) def_table_schema( owner = 'wangzelin.wzl', @@ -22250,15 +22248,10 @@ def_table_schema( ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, - CASE allow_vote - WHEN 1 THEN 'YES' - ELSE 'NO' END - AS ALLOW_VOTE, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, - REPLICA_TYPE, BASE_LSN, BEGIN_LSN, BEGIN_SCN, @@ -44485,15 +44478,10 @@ def_table_schema( ACCESS_MODE, PAXOS_MEMBER_LIST, PAXOS_REPLICA_NUM, - CASE allow_vote - WHEN 1 THEN 'YES' - ELSE 'NO' END - AS ALLOW_VOTE, CASE in_sync WHEN 1 THEN 'YES' ELSE 'NO' END AS IN_SYNC, - REPLICA_TYPE, BASE_LSN, BEGIN_LSN, BEGIN_SCN, diff --git a/src/share/inner_table/ob_inner_table_schema_misc.ipp b/src/share/inner_table/ob_inner_table_schema_misc.ipp index 06c89e48af..171fbfdd42 100644 --- a/src/share/inner_table/ob_inner_table_schema_misc.ipp +++ b/src/share/inner_table/ob_inner_table_schema_misc.ipp @@ -341,7 +341,7 @@ case OB_ALL_VIRTUAL_LOG_ARCHIVE_DEST_PARAMETER_TID: case OB_ALL_VIRTUAL_LOG_ARCHIVE_HISTORY_TID: case OB_ALL_VIRTUAL_LOG_ARCHIVE_PIECE_FILES_TID: case OB_ALL_VIRTUAL_LOG_ARCHIVE_PROGRESS_TID: -case OB_ALL_VIRTUAL_LOG_ARCHIVE_SOURCE_TID: +case OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TID: case OB_ALL_VIRTUAL_LS_ELECTION_REFERENCE_INFO_TID: case OB_ALL_VIRTUAL_LS_LOG_ARCHIVE_PROGRESS_TID: case OB_ALL_VIRTUAL_LS_META_TABLE_TID: @@ -848,12 +848,12 @@ case OB_ALL_VIRTUAL_ZONE_MERGE_INFO_TID: break; } - case OB_ALL_VIRTUAL_LOG_ARCHIVE_SOURCE_TID: { + case OB_ALL_VIRTUAL_LOG_RESTORE_SOURCE_TID: { ObIteratePrivateVirtualTable *iter = NULL; const bool meta_record_in_sys = false; if (OB_FAIL(NEW_VIRTUAL_TABLE(ObIteratePrivateVirtualTable, iter))) { SERVER_LOG(WARN, "create iterate private virtual table iterator failed", KR(ret)); - } else if (OB_FAIL(iter->init(OB_ALL_LOG_ARCHIVE_SOURCE_TID, meta_record_in_sys, index_schema, params))) { + } else if (OB_FAIL(iter->init(OB_ALL_LOG_RESTORE_SOURCE_TID, meta_record_in_sys, index_schema, params))) { SERVER_LOG(WARN, "iterate private virtual table iter init failed", KR(ret)); iter->~ObIteratePrivateVirtualTable(); allocator.free(iter); @@ -3341,9 +3341,9 @@ case OB_ALL_LOG_ARCHIVE_PIECE_FILES_AUX_LOB_PIECE_TID: case OB_ALL_LOG_ARCHIVE_PROGRESS_TID: case OB_ALL_LOG_ARCHIVE_PROGRESS_AUX_LOB_META_TID: case OB_ALL_LOG_ARCHIVE_PROGRESS_AUX_LOB_PIECE_TID: -case OB_ALL_LOG_ARCHIVE_SOURCE_TID: -case OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_META_TID: -case OB_ALL_LOG_ARCHIVE_SOURCE_AUX_LOB_PIECE_TID: +case OB_ALL_LOG_RESTORE_SOURCE_TID: +case OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_META_TID: +case OB_ALL_LOG_RESTORE_SOURCE_AUX_LOB_PIECE_TID: case OB_ALL_LS_ELECTION_REFERENCE_INFO_TID: case OB_ALL_LS_ELECTION_REFERENCE_INFO_AUX_LOB_META_TID: case OB_ALL_LS_ELECTION_REFERENCE_INFO_AUX_LOB_PIECE_TID: diff --git a/src/share/restore/ob_restore_table_operator.cpp b/src/share/restore/ob_restore_table_operator.cpp index 3614960140..4a426b375b 100644 --- a/src/share/restore/ob_restore_table_operator.cpp +++ b/src/share/restore/ob_restore_table_operator.cpp @@ -22,6 +22,7 @@ #include "share/inner_table/ob_inner_table_schema_constants.h" #include "ob_log_archive_source.h" #include "share/backup/ob_backup_struct.h" +#include "logservice/palf/log_define.h" using namespace oceanbase::share; using namespace oceanbase::common; @@ -63,7 +64,7 @@ int ObTenantRestoreTableOperator::insert_source(const ObLogArchiveSourceItem &it LOG_WARN("invalid argument", K(ret), K(item)); } else if (OB_FAIL(fill_log_archive_source_(item, dml))) { LOG_WARN("fill log archive source failed", K(ret), K(item)); - } else if (OB_FAIL(dml.splice_insert_update_sql(OB_ALL_LOG_ARCHIVE_SOURCE_TNAME, sql))) { + } else if (OB_FAIL(dml.splice_insert_update_sql(OB_ALL_LOG_RESTORE_SOURCE_TNAME, sql))) { LOG_WARN("splice insert update sql failed", K(ret), K(item)); } else if (OB_FAIL(proxy_->write(get_exec_tenant_id_(), sql.ptr(), affected_rows))) { LOG_WARN("exec sql failed", K(ret), K(item), K(sql), K_(user_tenant_id)); @@ -87,9 +88,9 @@ int ObTenantRestoreTableOperator::update_source_until_ts(const ObLogArchiveSourc LOG_WARN("failed to add column", K(ret), K(item.tenant_id_)); } else if (OB_FAIL(dml.add_pk_column(OB_STR_LOG_ARCHIVE_SOURCE_ID, item.id_))) { LOG_WARN("failed to add column", K(ret), K(item.id_)); - } else if (OB_FAIL(dml.add_column(OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_TS, item.until_ts_))) { + } else if (OB_FAIL(dml.add_uint64_column(OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_SCN, item.until_ts_))) { LOG_WARN("failed to add column", K(ret), K(item.until_ts_)); - } else if (OB_FAIL(dml.splice_update_sql(OB_ALL_LOG_ARCHIVE_SOURCE_TNAME, sql))) { + } else if (OB_FAIL(dml.splice_update_sql(OB_ALL_LOG_RESTORE_SOURCE_TNAME, sql))) { LOG_WARN("fill source until_ts failed", K(ret), K(item.id_), K(item.until_ts_)); } else if (OB_FAIL(proxy_->write(get_exec_tenant_id_(), sql.ptr(), affected_rows))) { LOG_WARN("failed to exec sql", K(ret), K(sql), K_(user_tenant_id)); @@ -105,7 +106,7 @@ int ObTenantRestoreTableOperator::delete_source() if (IS_NOT_INIT) { ret = OB_NOT_INIT; LOG_WARN("tenant restore table operator not init", K(ret)); - } else if (OB_FAIL(sql.append_fmt("delete from %s", OB_ALL_LOG_ARCHIVE_SOURCE_TNAME))) { + } else if (OB_FAIL(sql.append_fmt("delete from %s", OB_ALL_LOG_RESTORE_SOURCE_TNAME))) { LOG_WARN("sql append failed", K(ret)); } else if (OB_FAIL(proxy_->write(get_exec_tenant_id_(), sql.ptr(), affected_rows))) { LOG_WARN("failed to exec sql", K(ret), K(sql), K_(user_tenant_id)); @@ -160,7 +161,7 @@ int ObTenantRestoreTableOperator::fill_log_archive_source_(const ObLogArchiveSou LOG_WARN("failed to add column", K(ret), K(item)); } else if (OB_FAIL(dml.add_column(OB_STR_LOG_ARCHIVE_SOURCE_VALUE, item.value_.ptr()))) { LOG_WARN("failed to add column", K(ret), K(item)); - } else if (OB_FAIL(dml.add_column(OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_TS, item.until_ts_))) { + } else if (OB_FAIL(dml.add_uint64_column(OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_SCN, item.until_ts_))) { LOG_WARN("failed to add column", K(ret), K(item)); } return ret; @@ -177,9 +178,9 @@ int ObTenantRestoreTableOperator::fill_select_source_(common::ObSqlString &sql) LOG_WARN("sql append failed", K(ret)); } else if (OB_FAIL(sql.append_fmt(", %s", OB_STR_LOG_ARCHIVE_SOURCE_VALUE))) { LOG_WARN("sql append failed", K(ret)); - } else if (OB_FAIL(sql.append_fmt(", %s", OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_TS))) { + } else if (OB_FAIL(sql.append_fmt(", %s", OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_SCN))) { LOG_WARN("sql append failed", K(ret)); - } else if (OB_FAIL(sql.append_fmt(" from %s", OB_ALL_LOG_ARCHIVE_SOURCE_TNAME))) { + } else if (OB_FAIL(sql.append_fmt(" from %s", OB_ALL_LOG_RESTORE_SOURCE_TNAME))) { LOG_WARN("sql append failed", K(ret)); } return ret; @@ -197,7 +198,7 @@ int ObTenantRestoreTableOperator::parse_log_archive_source_(ObMySQLResult &resul item_local.type_ = ObLogArchiveSourceItem::get_source_type(type); } EXTRACT_VARCHAR_FIELD_MYSQL_SKIP_RET(result, OB_STR_LOG_ARCHIVE_SOURCE_VALUE, item_local.value_); - EXTRACT_INT_FIELD_MYSQL(result, OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_TS, item_local.until_ts_, int64_t); + EXTRACT_UINT_FIELD_MYSQL(result, OB_STR_LOG_ARCHIVE_SOURCE_UNTIL_SCN, item_local.until_ts_, uint64_t); OZ (item.deep_copy(item_local)); return ret; } 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 19d6ede907..55c2d7ce45 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 @@ -212,7 +212,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 406 __all_mock_fk_parent_table_history 0 201001 1 407 __all_mock_fk_parent_table_column 0 201001 1 408 __all_mock_fk_parent_table_column_history 0 201001 1 -409 __all_log_archive_source 0 201001 1 +409 __all_log_restore_source 0 201001 1 412 __all_service_epoch 0 201001 1 416 __all_column_checksum_error_info 0 201001 1 10001 __tenant_virtual_all_table 2 201001 1 @@ -545,7 +545,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 12321 __all_virtual_mock_fk_parent_table_history 2 201001 1 12322 __all_virtual_mock_fk_parent_table_column 2 201001 1 12323 __all_virtual_mock_fk_parent_table_column_history 2 201001 1 -12324 __all_virtual_log_archive_source 2 201001 1 +12324 __all_virtual_log_restore_source 2 201001 1 12325 __all_virtual_query_response_time 2 201001 1 12330 __all_virtual_column_checksum_error_info 2 201001 1 12331 __all_virtual_kvcache_handle_leak_info 2 201001 1