[FEAT MERGE] merge transfer
Co-authored-by: wxhwang <wxhwang@126.com> Co-authored-by: godyangfight <godyangfight@gmail.com> Co-authored-by: Tyshawn <tuyunshan@gmail.com>
This commit is contained in:
@ -17,6 +17,15 @@
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace share
|
||||
{
|
||||
class ObAllTenantInfo;
|
||||
struct ObBackupDataLSAttrDesc;
|
||||
}
|
||||
namespace storage
|
||||
{
|
||||
class ObTabletMeta;
|
||||
}
|
||||
namespace rootserver
|
||||
{
|
||||
|
||||
@ -31,86 +40,76 @@ public:
|
||||
common::ObMySQLProxy &sql_proxy,
|
||||
obrpc::ObSrvRpcProxy &rpc_proxy,
|
||||
ObBackupTaskScheduler &task_scheduler,
|
||||
ObBackupLeaseService &lease_service,
|
||||
ObMultiVersionSchemaService &schema_service,
|
||||
ObBackupService &backup_service);
|
||||
ObBackupDataService &backup_service);
|
||||
int process();
|
||||
int do_clean_up(ObMySQLTransaction &trans);
|
||||
int deal_failed_set_task(ObMySQLTransaction &trans);
|
||||
bool is_force_cancel() const;
|
||||
bool can_write_extern_infos(const int err) const;
|
||||
int write_extern_infos();
|
||||
int write_backup_set_placeholder(const bool is_start);
|
||||
share::ObBackupStatus::Status get_status() const { return next_status_.status_; }
|
||||
share::ObBackupStatus::Status get_status() const { return set_task_attr_.status_.status_; }
|
||||
TO_STRING_KV(K_(meta_tenant_id), K_(set_task_attr));
|
||||
private:
|
||||
int persist_sys_ls_task_();
|
||||
int do_persist_sys_ls_task_();
|
||||
int persist_ls_attr_info_(ObIArray<share::ObLSID> &ls_ids);
|
||||
int persist_ls_attr_info_(const share::ObBackupLSTaskAttr &sys_ls_task, ObIArray<share::ObLSID> &ls_ids);
|
||||
int sync_wait_backup_user_ls_scn_(const share::ObBackupLSTaskAttr &sys_ls_task, share::SCN &scn);
|
||||
int generate_ls_tasks_(const ObIArray<share::ObLSID> &ls_ids, const share::ObBackupDataTaskType &type);
|
||||
|
||||
int calc_task_turn_(const ObBackupDataTaskType &type, int64_t &turn_id);
|
||||
int backup_sys_meta_();
|
||||
int do_backup_meta_(ObIArray<share::ObBackupLSTaskAttr> &ls_task, int64_t &finish_cnt);
|
||||
int backup_user_meta_();
|
||||
int change_meta_turn_();
|
||||
// TODO: need the enbale/disable transfer
|
||||
int disable_transfer_();
|
||||
int enable_transfer_();
|
||||
int do_backup_meta_(ObArray<share::ObBackupLSTaskAttr> &ls_task, int64_t &finish_cnt);
|
||||
int do_backup_root_key_();
|
||||
int merge_tablet_to_ls_info_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks);
|
||||
int construct_ls_task_map_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks,
|
||||
hash::ObHashMap<share::ObLSID, const share::ObBackupLSTaskAttr *> &ls_map);
|
||||
int get_extern_tablet_info_(const share::ObLSID &ls_id, const int64_t &retry_cnt,
|
||||
share::ObBackupDataTabletToLSInfo &tablet_to_ls_info, share::SCN &backup_scn);
|
||||
int check_tablets_match_(const share::ObLSID &ls_id, const ObIArray<ObTabletID> &cur_tablet_ids,
|
||||
const ObIArray<ObTabletID> &user_tablet_ids, const share::SCN &backup_scn);
|
||||
int do_check_inc_tablets_(const share::ObLSID &ls_id, const ObIArray<ObTabletID> &inc_tablets,
|
||||
const share::SCN &backup_scn);
|
||||
int get_dst_server_(const share::ObLSID &ls_id, ObAddr &dst);
|
||||
int check_need_change_meta_turn_(ObIArray<share::ObBackupLSTaskAttr> &ls_tasks, bool &need_change_turn);
|
||||
int change_meta_turn_(const share::ObBackupLSTaskAttr &sys_ls_task);
|
||||
int get_backup_user_meta_task_(ObIArray<share::ObBackupLSTaskAttr> &ls_task);
|
||||
int merge_tablet_to_ls_info_(const share::SCN &consistent_scn, const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks);
|
||||
int get_tablet_list_by_snapshot(
|
||||
const share::SCN &consistent_scn, common::hash::ObHashMap<share::ObLSID, ObArray<ObTabletID>> &latest_ls_tablet_map);
|
||||
int fill_map_with_sys_tablets_(common::hash::ObHashMap<share::ObLSID, ObArray<ObTabletID>> &latest_ls_tablet_map);
|
||||
int update_tablet_id_backup_scn_(const share::SCN &backup_scn);
|
||||
int get_extern_tablet_info_(const share::ObLSID &ls_id,
|
||||
ObIArray<ObTabletID> &user_tablet_ids, share::SCN &backup_scn);
|
||||
int merge_ls_meta_infos_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks);
|
||||
|
||||
int do_backup_root_key_();
|
||||
int backup_data_();
|
||||
int do_backup_data_(ObArray<share::ObBackupLSTaskAttr> &ls_task, int64_t &finish_cnt,
|
||||
share::ObBackupLSTaskAttr *& build_index_attr);
|
||||
int build_index_(share::ObBackupLSTaskAttr *build_index_attr, const int64_t turn_id, const int64_t task_id,
|
||||
bool &finish_build_index);
|
||||
int build_index_(share::ObBackupLSTaskAttr *build_index_attr, bool &finish_build_index);
|
||||
int check_change_task_turn_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks, bool &need_change_turn,
|
||||
ObIArray<share::ObBackupDataTabletToLSInfo> &tablets_to_ls, ObIArray<share::ObLSID> &new_ls_array);
|
||||
ObIArray<storage::ObBackupDataTabletToLSInfo> &tablets_to_ls, ObIArray<share::ObLSID> &new_ls_array);
|
||||
int change_task_turn_(ObIArray<share::ObBackupLSTaskAttr> &ls_task,
|
||||
ObIArray<share::ObBackupDataTabletToLSInfo> &tablets_to_ls, ObIArray<share::ObLSID> &new_ls_array);
|
||||
ObIArray<storage::ObBackupDataTabletToLSInfo> &tablets_to_ls, ObIArray<share::ObLSID> &new_ls_array);
|
||||
int get_next_turn_id_(int64_t &next_turn_id);
|
||||
int get_change_turn_tablets_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks,
|
||||
ObIArray<share::ObBackupDataTabletToLSInfo> &tablet_to_ls, ObIArray<share::ObLSID> &new_ls_ids);
|
||||
ObIArray<storage::ObBackupDataTabletToLSInfo> &tablet_to_ls, ObIArray<share::ObLSID> &new_ls_ids);
|
||||
int get_tablets_of_deleted_ls_(
|
||||
const ObIArray<ObBackupLSTaskAttr> &ls_tasks, common::hash::ObHashSet<ObBackupSkipTabletAttr> &skip_tablets);
|
||||
int do_get_change_turn_tablets_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks,
|
||||
const ObIArray<share::ObBackupSkipTabletAttr> &all_tablets,
|
||||
ObIArray<share::ObBackupDataTabletToLSInfo> &tablet_to_ls, ObIArray<share::ObLSID> &new_ls_ids);
|
||||
const common::hash::ObHashSet<ObBackupSkipTabletAttr> &skip_tablets,
|
||||
ObIArray<storage::ObBackupDataTabletToLSInfo> &tablet_to_ls, ObIArray<share::ObLSID> &new_ls_ids);
|
||||
int construct_cur_ls_set_(const ObIArray<share::ObBackupLSTaskAttr> &ls_tasks,
|
||||
common::hash::ObHashSet<share::ObLSID> &ls_id_set);
|
||||
int get_change_turn_ls_(ObIArray<share::ObBackupLSTaskAttr> &ls_task,
|
||||
const ObIArray<share::ObBackupDataTabletToLSInfo> &tablets_to_ls,
|
||||
const ObIArray<storage::ObBackupDataTabletToLSInfo> &tablets_to_ls,
|
||||
ObIArray<share::ObBackupLSTaskAttr *> &need_change_turn_ls_tasks);
|
||||
int persist_deleted_tablets_info_(const common::ObIArray<share::ObBackupSkipTabletAttr> &skip_tablets);
|
||||
int update_inner_task_(const ObIArray<share::ObLSID> &new_ls_ids,
|
||||
const ObIArray<share::ObBackupLSTaskAttr *> &need_change_turn_ls_tasks);
|
||||
int update_task_type_(const ObIArray<share::ObBackupLSTaskAttr> &ls_task);
|
||||
|
||||
int convert_task_type_(const ObIArray<share::ObBackupLSTaskAttr> &ls_task);
|
||||
int backup_completing_log_();
|
||||
int do_backup_completing_log_(ObArray<share::ObBackupLSTaskAttr> &ls_task, int64_t &finish_cnt);
|
||||
int calculate_start_replay_scn_(share::SCN &start_replay_scn);
|
||||
|
||||
int do_cancel_();
|
||||
|
||||
int do_failed_ls_task_(ObMySQLTransaction &trans, const ObIArray<share::ObBackupLSTaskAttr> &ls_task);
|
||||
int write_backup_set_placeholder_(const bool is_start);
|
||||
int write_extern_infos_();
|
||||
int write_tenant_backup_set_infos_();
|
||||
int write_extern_locality_info_(share::ObExternTenantLocalityInfoDesc &locality_info);
|
||||
int write_extern_locality_info_(storage::ObExternTenantLocalityInfoDesc &locality_info);
|
||||
int write_backup_set_info_(const share::ObBackupSetTaskAttr &set_task_attr,
|
||||
share::ObExternBackupSetInfoDesc &backup_set_info);
|
||||
int write_extern_diagnose_info_(const share::ObExternTenantLocalityInfoDesc &locality_info,
|
||||
const share::ObExternBackupSetInfoDesc &backup_set_info);
|
||||
storage::ObExternBackupSetInfoDesc &backup_set_info);
|
||||
int write_extern_diagnose_info_(const storage::ObExternTenantLocalityInfoDesc &locality_info,
|
||||
const storage::ObExternBackupSetInfoDesc &backup_set_info);
|
||||
int write_log_format_file_();
|
||||
|
||||
int write_extern_ls_info_(const ObArray<share::ObBackupLSTaskAttr> &ls_tasks);
|
||||
int write_tablet_to_ls_infos_(const ObIArray<share::ObBackupDataTabletToLSInfo> &tablets_to_ls, const int64_t turn_id);
|
||||
int write_deleted_tablet_infos_();
|
||||
int write_tablet_to_ls_infos_(const ObIArray<storage::ObBackupDataTabletToLSInfo> &tablets_to_ls);
|
||||
|
||||
int set_backup_set_files_failed_(ObMySQLTransaction &trans);
|
||||
int advance_status_(ObMySQLTransaction &trans, const share::ObBackupStatus &next_status, const int result = OB_SUCCESS,
|
||||
@ -119,16 +118,14 @@ private:
|
||||
private:
|
||||
bool is_inited_;
|
||||
uint64_t meta_tenant_id_;
|
||||
share::ObBackupStatus next_status_;
|
||||
share::ObBackupSetTaskAttr set_task_attr_;
|
||||
share::ObBackupJobAttr *job_attr_;
|
||||
common::ObMySQLProxy *sql_proxy_;
|
||||
obrpc::ObSrvRpcProxy *rpc_proxy_;
|
||||
ObBackupLeaseService *lease_service_;
|
||||
ObBackupTaskScheduler *task_scheduler_;
|
||||
ObMultiVersionSchemaService *schema_service_;
|
||||
ObBackupService *backup_service_;
|
||||
share::ObBackupDataStore store_;
|
||||
ObBackupDataService *backup_service_;
|
||||
storage::ObBackupDataStore store_;
|
||||
ObMySQLTransaction trans_;
|
||||
DISALLOW_COPY_AND_ASSIGN(ObBackupSetTaskMgr);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user