From e8c2171e73a4243158d5300b984aeda4ad63483d Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 1 Apr 2022 17:17:05 +0800 Subject: [PATCH 1/2] add doc for new-collation-enable in br --- br/backup-and-restore-tool.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/br/backup-and-restore-tool.md b/br/backup-and-restore-tool.md index 4ec4e973f1d67..7c81d13b8925c 100644 --- a/br/backup-and-restore-tool.md +++ b/br/backup-and-restore-tool.md @@ -156,10 +156,21 @@ Note that skipping the version check might introduce incompatibility. The versio | Backup version (vertical) \ Restore version (horizontal) | Use BR nightly to restore TiDB nightly | Use BR v5.0 to restore TiDB v5.0| Use BR v4.0 to restore TiDB v4.0 | | ---- | ---- | ---- | ---- | | Use BR nightly to back up TiDB nightly | ✅ | ✅ | ❌ (If a table with the primary key of the non-integer clustered index type is restored to a TiDB v4.0 cluster, BR will cause data error without warning.) | -| Use BR v5.0 to back up TiDB v5.0 | ✅ | ✅ | ❌ (If a table with the primary key of the non-integer clustered index type is restored to a TiDB v4.0 cluster, BR will cause data error without warning.) +| Use BR v5.0 to back up TiDB v5.0 | ✅ | ✅ | ❌ (If a table with the primary key of the non-integer clustered index type is restored to a TiDB v4.0 cluster, BR will cause data error without warning.) | Use BR v4.0 to back up TiDB v4.0 | ✅ | ✅ | ✅ (If TiKV >= v4.0.0-rc.1, and if BR contains the [#233](https://github.com/pingcap/br/pull/233) bug fix and TiKV does not contain the [#7241](https://github.com/tikv/tikv/pull/7241) bug fix, BR will cause the TiKV node to restart.) | | Use BR nightly or v5.0 to back up TiDB v4.0 | ❌ (If the TiDB version is earlier than v4.0.9, the [#609](https://github.com/pingcap/br/issues/609) issue might occur.) | ❌ (If the TiDB version is earlier than v4.0.9, the [#609](https://github.com/pingcap/br/issues/609) issue might occur.) | ❌ (If the TiDB version is earlier than v4.0.9, the [#609](https://github.com/pingcap/br/issues/609) issue might occur.) | +#### Check for the `new_collations_enabled_on_first_bootstrap` variable + +Since TiDB v6.0.0, the default value of [`new_collations_enabled_on_first_bootstrap`](/tidb-configuration-file.md#new_collations_enabled_on_first_bootstrap) has changed from `false` to `true`. When the value `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters, BR safely restores the backup data of the upstream cluster to the downstream cluster. + +Since v6.0.0, BR backs up the `new_collations_enabled_on_first_bootstrap` configuration of the upstream cluster and then checks whether this configuration is consistent between the upstream and downstream clusters. If the value of `new_collations_enabled_on_first_bootstrap` is inconsistent between the upstream and downstream clusters, BR does not perform data restore and reports an error. + +If you need to restore data in a TiDB cluster of an earlier version to TiDB v6.0.0 or a later version, you need manually to check whether the value of `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters: + +- If the `new_collations_enabled_on_first_bootstrap` configuration value is consistent, you can add `--check-requirements=false` to the restore command to skip this configuration check. +- If the `new_collations_enabled_on_first_bootstrap` configuration value is inconsistent and you forcibly perform the restore, BR will report a [data validation error](/br/backup-and-restore-tool.md#usage-restrictions). + ### Back up and restore table data in the `mysql` system schema (experimental feature) > **Warning:** From ddf483893cb667849c2aa06a4c4b8bb357b469f8 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Fri, 1 Apr 2022 17:51:43 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Enwei --- br/backup-and-restore-tool.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/br/backup-and-restore-tool.md b/br/backup-and-restore-tool.md index 7c81d13b8925c..1892bdb221269 100644 --- a/br/backup-and-restore-tool.md +++ b/br/backup-and-restore-tool.md @@ -162,14 +162,14 @@ Note that skipping the version check might introduce incompatibility. The versio #### Check for the `new_collations_enabled_on_first_bootstrap` variable -Since TiDB v6.0.0, the default value of [`new_collations_enabled_on_first_bootstrap`](/tidb-configuration-file.md#new_collations_enabled_on_first_bootstrap) has changed from `false` to `true`. When the value `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters, BR safely restores the backup data of the upstream cluster to the downstream cluster. +Since TiDB v6.0.0, the default value of [`new_collations_enabled_on_first_bootstrap`](/tidb-configuration-file.md#new_collations_enabled_on_first_bootstrap) has changed from `false` to `true`. When the value of `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters, BR safely restores the data backed up in the upstream cluster to the downstream cluster. -Since v6.0.0, BR backs up the `new_collations_enabled_on_first_bootstrap` configuration of the upstream cluster and then checks whether this configuration is consistent between the upstream and downstream clusters. If the value of `new_collations_enabled_on_first_bootstrap` is inconsistent between the upstream and downstream clusters, BR does not perform data restore and reports an error. +Since v6.0.0, BR backs up the `new_collations_enabled_on_first_bootstrap` configuration of the upstream cluster and then checks whether the value of this configuration is consistent between the upstream and downstream clusters. If the value is inconsistent between the upstream and downstream clusters, BR does not perform the data restore and reports an error. -If you need to restore data in a TiDB cluster of an earlier version to TiDB v6.0.0 or a later version, you need manually to check whether the value of `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters: +Suppose that you have backed up the data in a TiDB cluster of an earlier version of v6.0.0, and you want to restore this data to a TiDB cluster of v6.0.0 or later versions. In this situation, you need manually to check whether the value of `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters: -- If the `new_collations_enabled_on_first_bootstrap` configuration value is consistent, you can add `--check-requirements=false` to the restore command to skip this configuration check. -- If the `new_collations_enabled_on_first_bootstrap` configuration value is inconsistent and you forcibly perform the restore, BR will report a [data validation error](/br/backup-and-restore-tool.md#usage-restrictions). +- If the value is consistent, you can add `--check-requirements=false` to the restore command to skip this configuration check. +- If the value is inconsistent, and you forcibly perform the restore, BR reports a [data validation error](/br/backup-and-restore-tool.md#usage-restrictions). ### Back up and restore table data in the `mysql` system schema (experimental feature)