From 267e05537cddd7c2a5b107de317a04ee28b24a97 Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 Date: Mon, 13 Sep 2021 13:04:30 +0800 Subject: [PATCH 1/2] faq: add info for schema is changed error --- faq/sql-faq.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/faq/sql-faq.md b/faq/sql-faq.md index bbbbee41e4d62..aea0a2f2355e3 100644 --- a/faq/sql-faq.md +++ b/faq/sql-faq.md @@ -193,11 +193,12 @@ SELECT column_name FROM table_name USE INDEX(index_name)WHERE where_conditio TiDB handles the SQL statement using the `schema` of the time and supports online asynchronous DDL change. A DML statement and a DDL statement might be executed at the same time and you must ensure that each statement is executed using the same `schema`. Therefore, when the DML operation meets the ongoing DDL operation, the `Information schema is changed` error might be reported. Some improvements have been made to prevent too many error reportings during the DML operation. -Now, there are still a few reasons for this error reporting (the latter two are unrelated to tables): +Now, there are still a few reasons for this error reporting (only the first one is related to tables): + Some tables involved in the DML operation are the same tables involved in the ongoing DDL operation. + The DML operation goes on for a long time. During this period, many DDL statements have been executed, which causes more than 1024 `schema` version changes. You can modify this default value by modifying the `tidb_max_delta_schema_count` variable. + The TiDB server that accepts the DML request is not able to load `schema information` for a long time (possibly caused by the connection failure between TiDB and PD or TiKV). During this period, many DDL statements have been executed, which causes more than 100 `schema` version changes. ++ -After TiDB restarts and before the first DDL operation is executed, the DML operation is executed and then encouters the first DDL operation (which means before the first DDL operation is executed, the transaction corresponding to the DML is started. And after the first `schema` version of the DDL is changed, the transaction corresponding to the DML is committed), this DML operation reports this error. > **Note:** > From c76a12cb33037ebd17cfbde14c743307ce207eec Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 15 Sep 2021 15:05:11 +0800 Subject: [PATCH 2/2] Update faq/sql-faq.md --- faq/sql-faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/sql-faq.md b/faq/sql-faq.md index aea0a2f2355e3..7739c43f6ad50 100644 --- a/faq/sql-faq.md +++ b/faq/sql-faq.md @@ -198,7 +198,7 @@ Now, there are still a few reasons for this error reporting (only the first one + Some tables involved in the DML operation are the same tables involved in the ongoing DDL operation. + The DML operation goes on for a long time. During this period, many DDL statements have been executed, which causes more than 1024 `schema` version changes. You can modify this default value by modifying the `tidb_max_delta_schema_count` variable. + The TiDB server that accepts the DML request is not able to load `schema information` for a long time (possibly caused by the connection failure between TiDB and PD or TiKV). During this period, many DDL statements have been executed, which causes more than 100 `schema` version changes. -+ -After TiDB restarts and before the first DDL operation is executed, the DML operation is executed and then encouters the first DDL operation (which means before the first DDL operation is executed, the transaction corresponding to the DML is started. And after the first `schema` version of the DDL is changed, the transaction corresponding to the DML is committed), this DML operation reports this error. ++ After TiDB restarts and before the first DDL operation is executed, the DML operation is executed and then encounters the first DDL operation (which means before the first DDL operation is executed, the transaction corresponding to the DML is started. And after the first `schema` version of the DDL is changed, the transaction corresponding to the DML is committed), this DML operation reports this error. > **Note:** >