Skip to content

Conversation

@zz-jason
Copy link
Member

@zz-jason zz-jason commented Mar 28, 2022

Signed-off-by: Jian Zhang zjsariel@gmail.com

What problem does this PR solve?

Issue Number: [to #67]

Problem Description: Not a problem. In order to backup and restore data between clusters with different API versions, we need to indicate tikv-servers about the target encoding format to either API v1 or v2.

BTW, this PR also solves the following problems:

  1. the compiled binary is named br which is the same as the backup restore tools for TiDB (https://github.com/pingcap/tidb/tree/master/br). It causes misunderstanding about br.
  2. there is a --cf flag for the backup raw command which increases the bar to use brsince users need to understand which column family their data is stored in. This PR removed this flag, making br easier to use.

What is changed and how does it work?

add a flag for users to indicate the destination API version for backup.

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Unit test
  • Integration test

Side effects

  • Increased code complexity, WHY: users need to be aware of the API versions to use BR tools

Related changes

  • Need to update the documentation

@zz-jason zz-jason marked this pull request as ready for review March 30, 2022 12:35
@zz-jason zz-jason enabled auto-merge (squash) March 30, 2022 12:36
@zz-jason zz-jason requested review from pingyu and zeminzhou March 30, 2022 12:42
@zz-jason
Copy link
Member Author

zz-jason commented Apr 1, 2022

now the help message of tikv-br backup raw is:

➜ ./bin/tikv-br backup raw --help
(experimental) backup a raw kv range from TiKV cluster

Usage:
  br backup raw [flags]

Flags:
      --dst-api-version string   The encoding method of backuped SST files for destination TiKV cluster, default to the source TiKV cluster. Available options: "v1", "v1ttl", "v2".
      --end string               The end key of the backup task, key is exclusive.
      --format string            The format of start and end key. Available options: "raw", "escaped", "hex". (default "hex")
  -h, --help                     help for raw
      --start string             The start key of the backup task, key is inclusive.

...

Copy link
Collaborator

@pingyu pingyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM~

zz-jason added 3 commits April 7, 2022 15:54
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
Signed-off-by: Jian Zhang <zjsariel@gmail.com>
zeminzhou
zeminzhou previously approved these changes Apr 11, 2022
Copy link
Contributor

@zeminzhou zeminzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

Signed-off-by: Jian Zhang <zjsariel@gmail.com>
Copy link
Collaborator

@pingyu pingyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@zz-jason zz-jason merged commit 6eaf03d into tikv:main Apr 13, 2022
@zz-jason zz-jason deleted the feature/support-api-v2 branch April 13, 2022 06:25
@pingyu pingyu mentioned this pull request Apr 30, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants