Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: Information schema is changed during the execution of the statement
[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
4.0.9
[Reproduction Path] What operations were performed to cause the issue
[Encountered Issue: Issue Phenomenon and Impact]
TiDB version 4.0.9
The business reported that one data entry failed to be written into TiDB, and the business log is as follows:
Error 8028: Information schema is changed during the execution of the statement (for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing tidb_max_delta_schema_count
. [try again later] INSERT INTO
According to the SQL information provided by the business, this data was indeed not found in TiDB.
Below are the TiDB logs, with some sensitive information removed.
[2023/01/03 10:03:43.304 +08:00] [WARN] [session.go:488] [“can not retry txn”] [conn=38494744] [label=general] [error=“[domain:8028]Information schema is changed during the execution of the statement (for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing tidb_max_delta_schema_count
. [try again later]”] [IsBatchInsert=false] [IsPessimistic=true] [InRestrictedSQL=false] [tidb_retry_limit=3] [tidb_disable_txn_auto_retry=true]
[2023/01/03 10:03:43.304 +08:00] [WARN] [session.go:1123] [“run statement failed”] [conn=38494744] [schemaVersion=1097] [error=“previous statement: INSERT INTO `: [domain:8028]Information schema is changed during the execution of the statement (for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`. [try again later]”]
[2023/01/03 10:03:43.304 +08:00] [INFO] [conn.go:793] [“command dispatched failed”] [conn=38494744] [connInfo=“id:38494744] [command=Query] [status=“inTxn:0, autocommit:1”] [sql=COMMIT] [txn_mode=PESSIMISTIC] [err=”[domain:8028]Information schema is changed during the execution of the statement (for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing tidb_max_delta_schema_count
. [try again later]
The current question is
Why didn’t TiDB retry? The official documentation states that this error does not affect the business and will automatically retry?
Explanation:
During the above DML, there was a DDL adding an index to a large table.
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]