Skip to content

Commit

Permalink
faq: add info for schema is changed error (#6453) (#6487)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Sep 15, 2021
1 parent 64f4c52 commit 046f039
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,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 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:**
>
Expand Down

0 comments on commit 046f039

Please sign in to comment.