Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected "Information schema is changed" when commits #20975

Closed
wjhuang2016 opened this issue Nov 11, 2020 · 3 comments · Fixed by #20982
Closed

Unexpected "Information schema is changed" when commits #20975

wjhuang2016 opened this issue Nov 11, 2020 · 3 comments · Fixed by #20982
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> drop table t2, t1;
Query OK, 0 rows affected (0.04 sec)

mysql> create table t1(a int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 values (1);
Query OK, 1 row affected (0.00 sec)

mysql> begin pessimistic;
Query OK, 0 rows affected (0.00 sec)

mysql> update t1 set a=a;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

/* session 2 */ mysql> create table t2(a int);
Query OK, 0 rows affected (0.00 sec)

mysql> commit;
ERROR 8028 (HY000): 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]

2. What did you expect to see? (Required)

Commit successfully.

3. What did you see instead (Required)

Information schema is changed during the execution of the statement

4. What is your TiDB version? (Required)

4.0 master

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction labels Nov 11, 2020
@wjhuang2016 wjhuang2016 self-assigned this Nov 11, 2020
@wjhuang2016
Copy link
Member Author

Besides,

mysql> create table t1(a int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t1 values (1);
Query OK, 1 row affected (0.00 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> update t1 set a=a;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

/* session 2 */ mysql> drop table t1;
Query OK, 0 rows affected (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

@blacktear23
Copy link
Contributor

Seems this is related to write.go updateRecord function, when there is nothing changed, it just return without call UpdateDeltaForTable to update TxnCtx.TableDeltaMap, so when commit, Commit function will got an empty tableID list and SchemaValidator will return ResultFail.

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants