diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 3b2cee357a07f..bd2043a7473bf 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -112,7 +112,7 @@ Backup and restore might go wrong when some TiDB features are enabled or disable | ---- | ---- | ----- | |GBK charset|| BR of versions earlier than v5.4.0 does not support restoring `charset=GBK` tables. No version of BR supports recovering `charset=GBK` tables to TiDB clusters earlier than v5.4.0. | | Clustered index | [#565](https://github.com/pingcap/br/issues/565) | Make sure that the value of the `tidb_enable_clustered_index` global variable during restore is consistent with that during backup. Otherwise, data inconsistency might occur, such as `default not found` error and inconsistent data index. | -| New collation | [#352](https://github.com/pingcap/br/issues/352) | Make sure that the value of the `new_collations_enabled_on_first_bootstrap` variable during restore is consistent with that during backup. Otherwise, inconsistent data index might occur and checksum might fail to pass. For more information, see [FAQ - Why does BR report `new_collations_enabled_on_first_bootstrap` mismatch?](/faq/backup-and-restore-faq.md#why-is-new_collations_enabled_on_first_bootstrap-mismatch-reported-during-restore). | +| New collation | [#352](https://github.com/pingcap/br/issues/352) | Make sure that the value of the `new_collation_enabled` variable in the `mysql.tidb` table during restore is consistent with that during backup. Otherwise, inconsistent data index might occur and checksum might fail to pass. For more information, see [FAQ - Why does BR report `new_collations_enabled_on_first_bootstrap` mismatch?](/faq/backup-and-restore-faq.md#why-is-new_collation_enabled-mismatch-reported-during-restore). | | Global temporary tables | | Make sure that you are using v5.3.0 or a later version of BR to back up and restore data. Otherwise, an error occurs in the definition of the backed global temporary tables. | | TiDB Lightning Physical Import| | If the upstream database uses the physical import mode of TiDB Lightning, data cannot be backed up in log backup. It is recommended to perform a full backup after the data import. For more information, see [When the upstream database imports data using TiDB Lightning in the physical import mode, the log backup feature becomes unavailable. Why?](/faq/backup-and-restore-faq.md#when-the-upstream-database-imports-data-using-tidb-lightning-in-the-physical-import-mode-the-log-backup-feature-becomes-unavailable-why).| diff --git a/character-set-and-collation.md b/character-set-and-collation.md index 27f45ed7b497b..76ddc824cba88 100644 --- a/character-set-and-collation.md +++ b/character-set-and-collation.md @@ -491,9 +491,13 @@ Since TiDB v4.0, a complete framework for collations is introduced. -This new framework supports semantically parsing collations and introduces the `new_collations_enabled_on_first_bootstrap` configuration item to decide whether to enable the new framework when a cluster is first initialized. To enable the new framework, set `new_collations_enabled_on_first_bootstrap` to `true`. For details, see [`new_collations_enabled_on_first_bootstrap`](/tidb-configuration-file.md#new_collations_enabled_on_first_bootstrap). If you initialize the cluster after the configuration item is enabled, you can check whether the new collation is enabled through the `new_collation_enabled` variable in the `mysql`.`tidb` table: +This new framework supports semantically parsing collations and introduces the `new_collations_enabled_on_first_bootstrap` configuration item to decide whether to enable the new framework when a cluster is first initialized. To enable the new framework, set `new_collations_enabled_on_first_bootstrap` to `true`. For details, see [`new_collations_enabled_on_first_bootstrap`](/tidb-configuration-file.md#new_collations_enabled_on_first_bootstrap). -{{< copyable "sql" >}} +For a TiDB cluster that is already initialized, you can check whether the new collation is enabled through the `new_collation_enabled` variable in the `mysql.tidb` table: + +> **Note:** +> +> If the query result of the `mysql.tidb` table is different from the value of `new_collations_enabled_on_first_bootstrap`, the result of the `mysql.tidb` table is the actual value. ```sql SELECT VARIABLE_VALUE FROM mysql.tidb WHERE VARIABLE_NAME='new_collation_enabled'; diff --git a/faq/backup-and-restore-faq.md b/faq/backup-and-restore-faq.md index 5a80e70d069ac..f7e63949864da 100644 --- a/faq/backup-and-restore-faq.md +++ b/faq/backup-and-restore-faq.md @@ -135,9 +135,9 @@ To address this problem, delete the current task using `br log stop`, and then c You can use [`filter.rules`](https://github.com/pingcap/tiflow/blob/7c3c2336f98153326912f3cf6ea2fbb7bcc4a20c/cmd/changefeed.toml#L16) to configure the block list for TiCDC and use [`syncer.ignore-table`](/tidb-binlog/tidb-binlog-configuration-file.md#ignore-table) to configure the block list for Drainer. -### Why is `new_collations_enabled_on_first_bootstrap` mismatch reported during restore? +### Why is `new_collation_enabled` mismatch reported during restore? -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`. 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 consistent, BR safely restores the data backed up in the upstream cluster to the downstream cluster. If the value is inconsistent, BR does not perform the data restore and reports an error. +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`. BR backs up the `new_collation_enabled` configuration in the `mysql.tidb` table 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 consistent, BR safely restores the data backed up in the upstream cluster to the downstream cluster. If the value is inconsistent, BR does not perform the data restore and reports an error. 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 to manually check whether the value of `new_collations_enabled_on_first_bootstrap` is consistent between the upstream and downstream clusters: diff --git a/migration-tools.md b/migration-tools.md index 16d51ee8b5a2c..94cf32d547ff0 100644 --- a/migration-tools.md +++ b/migration-tools.md @@ -56,7 +56,7 @@ This document introduces the user scenarios, supported upstreams and downstreams | **Upstream** | TiDB | | **Downstream (the output file)** | SST, backup.meta files, backup.lock files | | **Advantages** | | -| **Limitation** | | +| **Limitation** | | ## [sync-diff-inspector](/sync-diff-inspector/sync-diff-inspector-overview.md) diff --git a/mysql-schema.md b/mysql-schema.md index 929c0eb9714cc..f2144f40f9b2d 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -21,6 +21,15 @@ These system tables contain grant information about user accounts and their priv - `global_priv`: the authentication information based on certificates - `role_edges`: the relationship between roles +## Cluster status system tables + +* The `tidb` table contains some global information about TiDB: + + * `bootstrapped`: whether the TiDB cluster has been initialized. Note that this value is read-only and cannot be modified. + * `tidb_server_version`: the version information of TiDB when it is initialized. Note that this value is read-only and cannot be modified. + * `system_tz`: the system time zone of TiDB. + * `new_collation_enabled`: whether TiDB has enabled the [new framework for collations](/character-set-and-collation.md#new-framework-for-collations). Note that this value is read-only and cannot be modified. + ## Server-side help system tables Currently, the `help_topic` is NULL. @@ -72,11 +81,13 @@ Currently, the `help_topic` is NULL. ## Miscellaneous system tables -- `GLOBAL_VARIABLES`: global system variable table - -- `tidb`: to record the version information when TiDB executes `bootstrap` +> **Note:** +> +> The `tidb`, `expr_pushdown_blacklist`, `opt_rule_blacklist`, `table_cache_meta`, `tidb_import_jobs`, and `tidb_timers` system tables are only applicable to TiDB Self-Hosted and not available on [TiDB Cloud](https://docs.pingcap.com/tidbcloud/). + +- `GLOBAL_VARIABLES`: global system variable table - `expr_pushdown_blacklist`: the blocklist for expression pushdown - `opt_rule_blacklist`: the blocklist for logical optimization rules - `table_cache_meta`: the metadata of cached tables