Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Incremental Backup & Restore Project #90

Closed
5 tasks done
5kbpers opened this issue Dec 8, 2019 · 4 comments
Closed
5 tasks done

Incremental Backup & Restore Project #90

5kbpers opened this issue Dec 8, 2019 · 4 comments

Comments

@5kbpers
Copy link
Contributor

5kbpers commented Dec 8, 2019

Incremental Backup & Restore

Abstract

BR only supports full backup & restore for now, in this project we require to support incremental backup & restore, this is related to BR and TiKV.

Problem Statement

Currently, the procedure of backup is:

  1. BR gets a TSO(called BackupTS) from PD
  2. BR distributes tasks to TiKVs
  3. TiKV scans data with BackupTS, generates SSTs, store them to external storage

And the procedure of restore is:

  1. BR resets the TSO of PD with BackupTS(this will be a NOOP, if BackupTS <= current TSO of PD)
  2. BR creates the databases and tables, gets the new table schema, constructs key rewrite rules(for rewrite the table id and index id in the keys) with them
  3. BR distributes DownloadSST tasks to TiKVs
  4. TiKV downloads the given files, rewrites the keys, and save the result file
  5. BR distributes IngestSST tasks to TiKVs

Several problems are raised as we support incremental backup & restore:

  1. All the data should be scan during the incremental backup is in (last BackupTS, current BackupTS]. Then for more efficient incremental backup , we need a way to skip the unnecessary data.
  2. In full restore, There is no old data in the cluster. But in incremental restore, sometimes we need to restore data to a table which already has some records, and they should be covered by the restored data. So we must rewrite the restored data with the TSO from the new cluster, rather reset the TSO with the BackpTS.

Success Criteria

At least support the basic function of incremental backup & restore.

TODO list

  • TiKV completes DeltaScanner (500 points / medium)
  • TiKV supports backup data in specified TS range (500 points / medium)
  • BR supports incremental backup command (500 points / medium)
  • TiKV supports to skip SSTs based on MVCC properties (600 points / medium)
  • BR and TiKV supports rewrite TS in DownloadSST (600 points / medium)

Score

2700

Mentor(s)

Recommended skills

  • Golang
  • Rust
@Connor1996
Copy link
Member

I want to join in this task~

3 similar comments
@YangKeao
Copy link
Member

YangKeao commented Dec 9, 2019

I want to join in this task~

@sticnarf
Copy link
Contributor

sticnarf commented Dec 9, 2019

I want to join in this task~

@youjiali1995
Copy link

I want to join in this task~

@5kbpers 5kbpers closed this as completed Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants