From 332ee3c56ac4495a6b7ff50fe7ef8324ffb1c711 Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 15 Jan 2019 13:33:13 +0800 Subject: [PATCH 1/3] FAQ: update slow log, DDL and Syncer related questions Via: https://github.com/pingcap/docs-cn/pull/1083 --- FAQ.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/FAQ.md b/FAQ.md index 992543cb9714c..edbe1c88c598c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -257,6 +257,8 @@ You can use Docker Compose to build a TiDB cluster locally, including the cluste 2. If a slow query occurs, you can locate the `tidb-server` instance where the slow query is and the slow query time point using Grafana and find the SQL statement information recorded in the log on the corresponding node. +3. Besides the log, you can also view the slow query using the `admin show slow` command. For details, see [`admin show slow` command](sql/slow-query.md#admin-show-slow-command). + #### How to add the `label` configuration if `label` of TiKV was not configured when I deployed the TiDB cluster for the first time? The configuration of TiDB `label` is related to the cluster deployment architecture. It is important and is the basis for PD to execute global management and scheduling. If you did not configure `label` when deploying the cluster previously, you should adjust the deployment structure by manually adding the `location-labels` information using the PD management tool `pd-ctl`, for example, `config set location-labels "zone, rack, host"` (you should configure it based on the practical `label` level name). @@ -749,6 +751,10 @@ CREATE TABLE if not exists mysql.user ( INSERT INTO mysql.user VALUES ("%", "root", "", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y"); ``` +#### 4.1.5 Can TiDB provide services while Loader is running? + + Since Loader inserts the data logically, TiDB can provide services while it's running. But do not perform the related DDL operations. + #### How to export the data in TiDB? Currently, TiDB does not support `select into outfile`. You can use the following methods to export the data in TiDB: @@ -788,6 +794,10 @@ Two solutions: - You can also increase the limited number of statements in a single TiDB transaction, but this will consume more memory. +#### Does TiDB have a function like the Flashback Query in Oracle? Does it support DDL? + + Yes, it does. And it supports DDL as well. For details, see [how TiDB reads data from history versions](op-guide/history-read). + ### Migrate the data online #### Syncer @@ -829,6 +839,11 @@ Two solutions: - Put the `syncer.meta` file in a relatively secure disk. For example, use disks with RAID 1. - Restore the location information of history synchronization according to the monitoring data that Syncer reports to Prometheus regularly. But the location information might be inaccurate due to the delay when a large amount of data is synchronized. +##### If the downstream TiDB data is not consistent with the MySQL data during Syncer's synchronization process, will DML operations cause exits? + +- If data exists in the upstream MySQL and doesn't exist in the downstream TiDB, and the upstream MySQL performs the `UPDATE` or `DELETE` operation on this piece of data, it will not cause errors or exits and the data will not exist during Syncer's synchronization process. +- If conflicts exist in the primary key indexes or the unique indexes in the downstream, preforming `UPDATE` will cause exits while performing `INSERT` will not. + ### Migrate the traffic #### How to migrate the traffic quickly? From 4d0c9360d219ec1197ca661df33ca650bfee2909 Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 15 Jan 2019 13:46:54 +0800 Subject: [PATCH 2/3] FAQ: fix the broken link --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index edbe1c88c598c..cc66bf4950399 100644 --- a/FAQ.md +++ b/FAQ.md @@ -796,7 +796,7 @@ Two solutions: #### Does TiDB have a function like the Flashback Query in Oracle? Does it support DDL? - Yes, it does. And it supports DDL as well. For details, see [how TiDB reads data from history versions](op-guide/history-read). + Yes, it does. And it supports DDL as well. For details, see [how TiDB reads data from history versions](op-guide/history-read.md). ### Migrate the data online From 6beaa3cb51759c4374ce7862e1c8b31be3e66dc9 Mon Sep 17 00:00:00 2001 From: yikeke Date: Thu, 17 Jan 2019 15:03:52 +0800 Subject: [PATCH 3/3] FAQ: address the comment --- FAQ.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FAQ.md b/FAQ.md index cc66bf4950399..91e4e1ba62a56 100644 --- a/FAQ.md +++ b/FAQ.md @@ -257,7 +257,7 @@ You can use Docker Compose to build a TiDB cluster locally, including the cluste 2. If a slow query occurs, you can locate the `tidb-server` instance where the slow query is and the slow query time point using Grafana and find the SQL statement information recorded in the log on the corresponding node. -3. Besides the log, you can also view the slow query using the `admin show slow` command. For details, see [`admin show slow` command](sql/slow-query.md#admin-show-slow-command). +3. In addition to the log, you can also view the slow query using the `admin show slow` command. For details, see [`admin show slow` command](sql/slow-query.md#admin-show-slow-command). #### How to add the `label` configuration if `label` of TiKV was not configured when I deployed the TiDB cluster for the first time? @@ -751,9 +751,9 @@ CREATE TABLE if not exists mysql.user ( INSERT INTO mysql.user VALUES ("%", "root", "", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y", "Y"); ``` -#### 4.1.5 Can TiDB provide services while Loader is running? +#### Can TiDB provide services while Loader is running? - Since Loader inserts the data logically, TiDB can provide services while it's running. But do not perform the related DDL operations. + TiDB can provide services while Loader is running because Loader inserts the data logically. But do not perform the related DDL operations. #### How to export the data in TiDB? @@ -839,10 +839,10 @@ Two solutions: - Put the `syncer.meta` file in a relatively secure disk. For example, use disks with RAID 1. - Restore the location information of history synchronization according to the monitoring data that Syncer reports to Prometheus regularly. But the location information might be inaccurate due to the delay when a large amount of data is synchronized. -##### If the downstream TiDB data is not consistent with the MySQL data during Syncer's synchronization process, will DML operations cause exits? +##### If the downstream TiDB data is not consistent with the MySQL data during the synchronization process of Syncer, will DML operations cause exits? -- If data exists in the upstream MySQL and doesn't exist in the downstream TiDB, and the upstream MySQL performs the `UPDATE` or `DELETE` operation on this piece of data, it will not cause errors or exits and the data will not exist during Syncer's synchronization process. -- If conflicts exist in the primary key indexes or the unique indexes in the downstream, preforming `UPDATE` will cause exits while performing `INSERT` will not. +- If the data exists in the upstream MySQL but does not exist in the downstream TiDB, when the upstream MySQL performs the `UPDATE` or `DELETE` operation on this row of data, Syncer will not report an error and the synchronization process will not exit, and this row of data does not exist in the downstream. +- If a conflict exists in the primary key indexes or the unique indexes in the downstream, preforming the `UPDATE` operation will cause an exit and performing the `INSERT` operation will not cause an exit. ### Migrate the traffic