From df6c294a4dbf85ab945c0ecc0cd19e6be49058d6 Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Fri, 31 Jul 2020 13:20:37 +0800 Subject: [PATCH 1/5] cherry pick #3431 to release-4.0 Signed-off-by: ti-srebot --- TOC.md | 1 + information-schema/information-schema-sql-diagnostics.md | 4 ++++ troubleshoot-tidb-lightning.md | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/TOC.md b/TOC.md index 3b8222816d6cb..7c1f680415b56 100644 --- a/TOC.md +++ b/TOC.md @@ -14,6 +14,7 @@ + Quick Start + [Try Out TiDB](/quick-start-with-tidb.md) + [Learn TiDB SQL](/basic-sql-operations.md) + + [Import Example Database](/import-example-data.md) + Deploy + [Software and Hardware Requirements](/hardware-and-software-requirements.md) + [Environment Configuration Checklist](/check-before-deployment.md) diff --git a/information-schema/information-schema-sql-diagnostics.md b/information-schema/information-schema-sql-diagnostics.md index 55733409710de..d17dc690c9513 100644 --- a/information-schema/information-schema-sql-diagnostics.md +++ b/information-schema/information-schema-sql-diagnostics.md @@ -1,7 +1,11 @@ --- title: SQL Diagnostics summary: Understand SQL diagnostics in TiDB. +<<<<<<< HEAD aliases: ['/docs/stable/system-tables/system-table-sql-diagnostics/','/docs/v4.0/system-tables/system-table-sql-diagnostics/','/docs/stable/reference/system-databases/sql-diagnosis/','/docs/stable/system-tables/system-table-sql-diagnosis/','/tidb/stable/system-table-sql-diagnostics/'] +======= +aliases: ['/docs/dev/system-tables/system-table-sql-diagnostics/','/docs/dev/reference/system-databases/sql-diagnosis/','/docs/dev/system-tables/system-table-sql-diagnosis/','/tidb/dev/system-table-sql-diagnostics/','/tidb/dev/check-cluster-status-using-sql-statements','/docs/dev/check-cluster-status-using-sql-statements/','/docs/dev/reference/performance/check-cluster-status-using-sql-statements/'] +>>>>>>> 9b47c3e... resolve docs that are not in TOC (#3431) --- # SQL Diagnostics diff --git a/troubleshoot-tidb-lightning.md b/troubleshoot-tidb-lightning.md index e6d3a87fae90d..f73849d77bfdd 100644 --- a/troubleshoot-tidb-lightning.md +++ b/troubleshoot-tidb-lightning.md @@ -1,7 +1,11 @@ --- title: TiDB Lightning Troubleshooting summary: Learn about common errors and solutions of TiDB Lightning. +<<<<<<< HEAD aliases: ['/docs/stable/troubleshoot-tidb-lightning/','/docs/v4.0/troubleshoot-tidb-lightning/','/docs/stable/how-to/troubleshoot/tidb-lightning/'] +======= +aliases: ['/docs/dev/troubleshoot-tidb-lightning/','/docs/dev/how-to/troubleshoot/tidb-lightning/','/docs/dev/tidb-lightning/tidb-lightning-misuse-handling/','/docs/dev/reference/tools/error-case-handling/lightning-misuse-handling/','/tidb/dev/tidb-lightning-misuse-handling'] +>>>>>>> 9b47c3e... resolve docs that are not in TOC (#3431) --- # TiDB Lightning Troubleshooting From b5c361bfbca2d6d7d8928256fcdca63a66e21c32 Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 31 Jul 2020 13:42:54 +0800 Subject: [PATCH 2/5] delete two files --- check-cluster-status-using-sql-statements.md | 28 --------------- .../tidb-lightning-misuse-handling.md | 36 ------------------- 2 files changed, 64 deletions(-) delete mode 100644 check-cluster-status-using-sql-statements.md delete mode 100644 tidb-lightning/tidb-lightning-misuse-handling.md diff --git a/check-cluster-status-using-sql-statements.md b/check-cluster-status-using-sql-statements.md deleted file mode 100644 index 44e79255eafc8..0000000000000 --- a/check-cluster-status-using-sql-statements.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Check the TiDB Cluster Status Using SQL Statements -summary: This document introduces that TiDB offers some SQL statements and system tables to check the TiDB cluster status. -aliases: ['/docs/stable/check-cluster-status-using-sql-statements/','/docs/v4.0/check-cluster-status-using-sql-statements/','/docs/stable/reference/performance/check-cluster-status-using-sql-statements/'] ---- - -# Check the TiDB Cluster Status Using SQL Statements - -TiDB offers some SQL statements and system tables to check the TiDB cluster status. - -The `INFORMATION_SCHEMA` system database offers system tables as follows to query the cluster status and diagnose common cluster issues: - -- [`TABLES`](/information-schema/information-schema-tables.md) -- [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) -- [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) -- [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) -- [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) -- [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) -- [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) - -You can also use the following statements to obtain some useful information for troubleshooting and querying the TiDB cluster status. - -- `ADMIN SHOW DDL`: obtains the ID of TiDB with the `DDL owner` role and `IP:PORT`. -- The feature of `SHOW ANALYZE STATUS` is the same with that of [the `ANALYZE_STATUS` table](/information-schema/information-schema-analyze-status.md). -- Specific `EXPLAIN` statements - - `EXPLAIN ANALYZE`: obtains some detailed information for execution of a SQL statement. - - `EXPLAIN FOR CONNECTION`: obtains the execution plan for the query executed last in a connection. Can be used along with `SHOW PROCESSLIST`. - - For more information about `EXPLAIN`, see [Understand the Query Execution Plan](/query-execution-plan.md). diff --git a/tidb-lightning/tidb-lightning-misuse-handling.md b/tidb-lightning/tidb-lightning-misuse-handling.md deleted file mode 100644 index 319cdc6d36fb2..0000000000000 --- a/tidb-lightning/tidb-lightning-misuse-handling.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Common Misuses of TiDB Lightning -aliases: ['/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/v4.0/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/reference/tools/error-case-handling/lightning-misuse-handling/'] ---- - -# Common Misuses of TiDB Lightning - -This document introduces common error scenarios in using [TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md), and also provides their reasons and solutions. - -## Error: `checksum mismatched remote vs local` - -The following error is reported during data import: - -```log -Error: checksum mismatched remote vs local => (checksum: 3828723015727756136 vs 7895534721177712659) (total_kvs: 1221416844 vs 1501500000) (total_bytes:237660308510 vs 292158203078) -``` - -### Reasons - -* TiDB Lightning was used to import data previously, and the corresponding [`checkpoint`](/tidb-lightning/tidb-lightning-checkpoints.md) data was not cleaned up. To confirm this, you can check the log at the first launch of TiDB Lightning: - - * When `[checkpoint] driver = file`, if the log that marks the beginning of data import using TiDB Lightning shows `open checkpoint file failed, going to create a new one`, then the `checkpoint` is cleaned correctly. Otherwise, the remaining data might lead to imported data missing. - * When `[checkpoint] driver = mysql`, you can run `curl http://{TiDBIP}:10080/schema/{checkpoint.schema}/{checkpoint.table}` through TiDB API to query the creation time of `checkpoint table`. Then you can confirm whether the `checkpoint` is cleaned correctly. - -* There is conflicting data from the data source imported by TiDB Lightning. - * Data in different rows have the same primary key or unique key. - -### Solutions - -* Delete data from tables with `checksum mismatch` error. - - ``` - tidb-lightning-ctl --config conf/tidb-lightning.toml --checkpoint-error-destroy=all - ``` - -* Find a way to detect whether there is conflicting data in the data source. TiDB Lightning generally processes large amounts of data, so currently there is no effective conflict detection mechanism or solution yet. \ No newline at end of file From 7f5251830698967628e5be27dded177c832e2433 Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Fri, 31 Jul 2020 13:46:04 +0800 Subject: [PATCH 3/5] Update information-schema/information-schema-sql-diagnostics.md --- information-schema/information-schema-sql-diagnostics.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/information-schema/information-schema-sql-diagnostics.md b/information-schema/information-schema-sql-diagnostics.md index d17dc690c9513..b2cc29cb7ab99 100644 --- a/information-schema/information-schema-sql-diagnostics.md +++ b/information-schema/information-schema-sql-diagnostics.md @@ -1,11 +1,7 @@ --- title: SQL Diagnostics summary: Understand SQL diagnostics in TiDB. -<<<<<<< HEAD -aliases: ['/docs/stable/system-tables/system-table-sql-diagnostics/','/docs/v4.0/system-tables/system-table-sql-diagnostics/','/docs/stable/reference/system-databases/sql-diagnosis/','/docs/stable/system-tables/system-table-sql-diagnosis/','/tidb/stable/system-table-sql-diagnostics/'] -======= -aliases: ['/docs/dev/system-tables/system-table-sql-diagnostics/','/docs/dev/reference/system-databases/sql-diagnosis/','/docs/dev/system-tables/system-table-sql-diagnosis/','/tidb/dev/system-table-sql-diagnostics/','/tidb/dev/check-cluster-status-using-sql-statements','/docs/dev/check-cluster-status-using-sql-statements/','/docs/dev/reference/performance/check-cluster-status-using-sql-statements/'] ->>>>>>> 9b47c3e... resolve docs that are not in TOC (#3431) +aliases: ['/docs/stable/system-tables/system-table-sql-diagnostics/','/docs/v4.0/system-tables/system-table-sql-diagnostics/','/docs/stable/reference/system-databases/sql-diagnosis/','/docs/stable/system-tables/system-table-sql-diagnosis/','/tidb/stable/system-table-sql-diagnostics/','/docs/stable/check-cluster-status-using-sql-statements/','/docs/v4.0/check-cluster-status-using-sql-statements/','/docs/stable/reference/performance/check-cluster-status-using-sql-statements/','/tidb/stable/check-cluster-status-using-sql-statements'] --- # SQL Diagnostics From 405953348c84786e915130cd75eec1d6069fe299 Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Fri, 31 Jul 2020 13:48:20 +0800 Subject: [PATCH 4/5] Update troubleshoot-tidb-lightning.md --- troubleshoot-tidb-lightning.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/troubleshoot-tidb-lightning.md b/troubleshoot-tidb-lightning.md index f73849d77bfdd..fd70115ffaffd 100644 --- a/troubleshoot-tidb-lightning.md +++ b/troubleshoot-tidb-lightning.md @@ -1,11 +1,7 @@ --- title: TiDB Lightning Troubleshooting summary: Learn about common errors and solutions of TiDB Lightning. -<<<<<<< HEAD -aliases: ['/docs/stable/troubleshoot-tidb-lightning/','/docs/v4.0/troubleshoot-tidb-lightning/','/docs/stable/how-to/troubleshoot/tidb-lightning/'] -======= -aliases: ['/docs/dev/troubleshoot-tidb-lightning/','/docs/dev/how-to/troubleshoot/tidb-lightning/','/docs/dev/tidb-lightning/tidb-lightning-misuse-handling/','/docs/dev/reference/tools/error-case-handling/lightning-misuse-handling/','/tidb/dev/tidb-lightning-misuse-handling'] ->>>>>>> 9b47c3e... resolve docs that are not in TOC (#3431) +aliases: ['/docs/stable/troubleshoot-tidb-lightning/','/docs/v4.0/troubleshoot-tidb-lightning/','/docs/stable/how-to/troubleshoot/tidb-lightning/','/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/v4.0/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/reference/tools/error-case-handling/lightning-misuse-handling/','/tidb/stable/tidb-lightning-misuse-handling'] --- # TiDB Lightning Troubleshooting From 08ed36aa00359d01c4f25a2ccb43823845a4e32a Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Fri, 31 Jul 2020 13:49:07 +0800 Subject: [PATCH 5/5] Update troubleshoot-tidb-lightning.md --- troubleshoot-tidb-lightning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/troubleshoot-tidb-lightning.md b/troubleshoot-tidb-lightning.md index fd70115ffaffd..a299de2172a6a 100644 --- a/troubleshoot-tidb-lightning.md +++ b/troubleshoot-tidb-lightning.md @@ -1,7 +1,7 @@ --- title: TiDB Lightning Troubleshooting summary: Learn about common errors and solutions of TiDB Lightning. -aliases: ['/docs/stable/troubleshoot-tidb-lightning/','/docs/v4.0/troubleshoot-tidb-lightning/','/docs/stable/how-to/troubleshoot/tidb-lightning/','/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/v4.0/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/reference/tools/error-case-handling/lightning-misuse-handling/','/tidb/stable/tidb-lightning-misuse-handling'] +aliases: ['/docs/stable/troubleshoot-tidb-lightning/','/docs/v4.0/troubleshoot-tidb-lightning/','/docs/stable/how-to/troubleshoot/tidb-lightning/','/docs/stable/tidb-lightning/tidb-lightning-misuse-handling/','/docs/v4.0/tidb-lightning/tidb-lightning-misuse-handling/','/docs/stable/reference/tools/error-case-handling/lightning-misuse-handling/','/tidb/stable/tidb-lightning-misuse-handling'] --- # TiDB Lightning Troubleshooting