【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】
4.0.9
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
tidb 4.0.9 版本
业务反馈有1条数据写入tidb失败,业务日志如下
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
根据业务提供的sql信息确实没在tidb中查到这条数据
下面是tidb的日志,删除了部分敏感信息
[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]
现在的疑问是
tidb为什么没重试,官方写的这个错误不影响业务,会自动重试?
https://docs.pingcap.com/zh/tidb/stable/sql-faq#触发-information-schema-is-changed-错误的原因
说明:
上述dml期间,有一个大表加索引的ddl
【资源配置】
【附件:截图/日志/监控】