Skip to content

Commit

Permalink
refactor: refactor restore progress (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhao liwei authored Jun 12, 2020
1 parent c5e1e67 commit 5522d9b
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 226 deletions.
16 changes: 10 additions & 6 deletions src/dist/replication/lib/replica.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,19 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba
/////////////////////////////////////////////////////////////////
// replica restore from backup
bool read_cold_backup_metadata(const std::string &file, cold_backup_metadata &backup_metadata);
bool verify_checkpoint(const cold_backup_metadata &backup_metadata,
const std::string &chkpt_dir);
// checkpoint on cold backup media maybe contain useless file,
// we should abandon these file base cold_backup_metadata
bool remove_useless_file_under_chkpt(const std::string &chkpt_dir,
const cold_backup_metadata &metadata);
dsn::error_code download_checkpoint(const configuration_restore_request &req,
const std::string &remote_chkpt_dir,
const std::string &local_chkpt_dir);
void clear_restore_useless_files(const std::string &local_chkpt_dir,
const cold_backup_metadata &metadata);
error_code get_backup_metadata(dist::block_service::block_filesystem *fs,
const std::string &remote_chkpt_dir,
const std::string &local_chkpt_dir,
cold_backup_metadata &backup_metadata);
error_code download_checkpoint(const configuration_restore_request &req,
const std::string &remote_chkpt_dir,
const std::string &local_chkpt_dir);
dsn::error_code find_valid_checkpoint(const configuration_restore_request &req,
/*out*/ std::string &remote_chkpt_dir);
dsn::error_code restore_checkpoint();
Expand All @@ -354,7 +358,7 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba

void report_restore_status_to_meta();

void update_restore_progress();
void update_restore_progress(uint64_t f_size);

std::string query_compact_state() const;

Expand Down
Loading

0 comments on commit 5522d9b

Please sign in to comment.