-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[close #227] Update BR readme #228
Conversation
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
br/README.md
Outdated
# Attach to control container to run BR | ||
docker exec -it br_control_1 bash | ||
# Restore from the backup. | ||
bin/br restore raw \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bin/br restore raw \ | |
bin/tikv-br restore raw \ |
br/README.md
Outdated
- It is recommended that you execute multiple backup operations serially. Running different backup operations in parallel reduces backup performance and also affects the online application. | ||
- It is recommended that you execute multiple restore operations serially. Running different restore operations in parallel increases Region conflicts and also reduces restore performance. | ||
- `TiKV-BR` supports checksum between `TiKV` cluster and backup files after backup or restore with the config `--checksum=true`. Note that, if checksum is enabled, please make sure no data is changed or `TTL` expired in `TiKV` cluster during backup or restore. | ||
- TiKV-BR supports [`api-version`](https://docs.pingcap.com/zh/tidb/stable/tikv-configuration-file#api-version-%E4%BB%8E-v610-%E7%89%88%E6%9C%AC%E5%BC%80%E5%A7%8B%E5%BC%95%E5%85%A5) conversion from V1 to V2 with config `--dst-api-version V2`. Then restore the backup files to APIV2 `TiKV` cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to also talk about that the conversion is mainly used for upgrade TiKV storage from v1
to v2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, PTAL~
br/README.md
Outdated
|
||
# How many row do we get? 300242 rows. | ||
mysql --host 127.0.0.1 --port 4000 -E -e "SELECT COUNT(*) FROM test.order_line" -u root -p | ||
TiKV-BR can do checksum between TiKV cluster and backup files after backup finish with the config `--checksum=true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to introduce how to verify backup & restore in a separated section. I think users will much care about the correctness.
Can also talk about the checksum function of client-go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one section "Data Verification of Backup&Restore". PTAL~
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #228 +/- ##
================================================
+ Coverage 61.0002% 61.1866% +0.1863%
================================================
Files 238 238
Lines 20195 20158 -37
================================================
+ Hits 12319 12334 +15
+ Misses 6754 6685 -69
- Partials 1122 1139 +17
*This pull request uses carry forward flags. Click here to find out more.
|
br/README.md
Outdated
--log-file "/logs/br_restore.log" | ||
TiKV-BR, TiKV nodes, and the backup storage system should provide network bandwidth that is greater than the backup speed. If the target cluster is particularly large, the threshold of backup and restoration speed is limited by the bandwidth of the backup network. | ||
The backup storage system should also provide sufficient write/read performance (IOPS). Otherwise, the IOPS might become a performance bottleneck during backup or restoration. | ||
TiKV nodes need to have at least two additional CPU cores and high performance disks for backups. Otherwise, the backup might have an impact on the services running on the cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest: "TiKV nodes need to have at least two additional spared CPU cores and disk bandwidth (related to ratelimit
parameter) for backups.
And it would be better to have a section talking about "impact of backup & restore" (maybe in another PR). I think this is another topic that user would concern much.
We can refer to https://docs.pingcap.com/tidb/stable/backup-and-restore-faq#how-much-impact-does-a-backup-operation-have-on-the-cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will add one more section to talk about the performance impact in another PR.
There was a problem hiding this 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: haojinming <[email protected]>
br/README.md
Outdated
``` | ||
|
||
## Compatibility test | ||
### Data Verification of Backup&Restore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Data Verification of Backup&Restore | |
### Data Verification of Backup & Restore |
--pd "${PDIP}:2379" \ | ||
--storage "s3://backup-data/2022-09-16/" \ | ||
--log-file backupfull.log | ||
Backup Raw <---------/................................................> 17.12%. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to also introduce the result message of backup later.
(Especially the usage of BackupTs
. And the kv size was confused to users in some past cases.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, PTAL~, thanks a lot.
--storage "s3://backup-data/2022-09-16/" \ | ||
--ratelimit 128 \ | ||
--log-file restoreraw.log | ||
Restore Raw <---------/...............................................> 17.12%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to also introduce the result message of restore later.
Signed-off-by: haojinming <[email protected]>
br/README.md
Outdated
[2022/09/20 18:01:10.125 +08:00] [INFO] [collector.go:67] ["Raw backup success summary"] [total-ranges=3] [ranges-succeed=3] [ranges-failed=0] [backup-total-regions=3] [total-take=5.050265883s] [BackupTS=436120585518448641] [total-kv=100000] [total-kv-size=108.7MB] [average-speed=21.11MB/s] [backup-data-size(after-compressed)=78.3MB] | ||
``` | ||
Explanations for the above message are as follows: | ||
- `total-ranges`: specifies the ranges' count that backup separate the task. Equals to `ranges-succeed` + `ranges-failed`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifies
: suggest to be indicates
or just remove. The same to followings.
- `total-ranges`: specifies the ranges' count that backup separate the task. Equals to `ranges-succeed` + `ranges-failed`. | |
- `total-ranges`: the number of ranges that the whole backup task is splitted to. Equals to `ranges-succeed` + `ranges-failed`. |
br/README.md
Outdated
``` | ||
Explanations for the above message are as follows: | ||
- `total-ranges`: specifies the ranges' count that backup separate the task. Equals to `ranges-succeed` + `ranges-failed`. | ||
- `ranges-succeed`: specifies the succeeded task count. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `ranges-succeed`: specifies the succeeded task count. | |
- `ranges-succeed`: the number of succeeded ranges. |
br/README.md
Outdated
- `ranges-succeed`: specifies the succeeded task count. | ||
- `ranges-failed`: specifies the failed task count. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
br/README.md
Outdated
- `ranges-failed`: specifies the failed task count. | ||
- `backup-total-regions`: specifies the tikv regions that backup takes. | ||
- `total-take`: specifies the backup duration. | ||
- `BackupTS`: specifies the backup start timestamp, only take effect for APIV2 TiKV cluster, which can be used as TiKV-CDC [start-ts](https://github.com/tikv/migration/blob/main/cdc/README.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last timestamp ?
"which can be used as start-ts
of TiKV-CDC
when creating replication tasks. Refer to Create a replication task
.
br/README.md
Outdated
- `total-take`: specifies the backup duration. | ||
- `BackupTS`: specifies the backup start timestamp, only take effect for APIV2 TiKV cluster, which can be used as TiKV-CDC [start-ts](https://github.com/tikv/migration/blob/main/cdc/README.md). | ||
- `total-kv`: specifies the total kv count in backup files. | ||
- `total-kv-size`: specifies the total kv size in backup files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `total-kv-size`: specifies the total kv size in backup files. | |
- `total-kv-size`: specifies the total kv size in backup files. Note that this is the original size before compression. |
br/README.md
Outdated
[2022/09/20 18:02:12.540 +08:00] [INFO] [collector.go:67] ["Raw restore success summary"] [total-ranges=3] [ranges-succeed=3] [ranges-failed=0] [restore-files=3] [total-take=950.460846ms] [restore-data-size(after-compressed)=78.3MB] [total-kv=100000] [total-kv-size=108.7MB] [average-speed=114.4MB/s] | ||
``` | ||
Explanations for the above message are as follows: | ||
- `total-ranges`: specifies the ranges' count that restoration separate the task. Equals to `ranges-succeed` + `ranges-failed`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
br/README.md
Outdated
# Create a bucket to save backup by mc (a MinIO Client). | ||
mc config host add minio $S3_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY && \ | ||
mc mb minio/mybucket | ||
*Note: please specify the [api-version](https://docs.pingcap.com/tidb/stable/tikv-configuration-file#api-version-new-in-v610) config of TiKV cluster. TiKV-BR supports APIV1 & APIV2 backup/restore and conversion from APIV1 to APIV2. The detail usage is as following.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the version requirement of TiKV.
Signed-off-by: haojinming <[email protected]>
Signed-off-by: haojinming <[email protected]>
There was a problem hiding this 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: haojinming [email protected]
What problem does this PR solve?
Issue Number: close #227
Problem Description:
What is changed and how does it work?
Update BR readme (rendered)
Code changes
Check List for Tests
This PR has been tested by at least one of the following methods:
Side effects
Related changes