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

Data inconsistency after adding indexes with multi-schema optimization #51746

Closed
tangenta opened this issue Mar 13, 2024 · 0 comments · Fixed by #51747
Closed

Data inconsistency after adding indexes with multi-schema optimization #51746

tangenta opened this issue Mar 13, 2024 · 0 comments · Fixed by #51747
Labels
affects-7.5 affects-7.6 component/ddl This issue is related to DDL of TiDB. fuzz/schrddl severity/critical type/bug The issue is confirmed as a bug.

Comments

@tangenta
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

	store, dom := testkit.CreateMockStoreAndDomain(t)
	defer ingesttestutil.InjectMockBackendMgr(t, store)()
	tk := testkit.NewTestKit(t, store)
	tk.MustExec("use test")
	tk.MustExec("CREATE TABLE `19bbb05e` (\n  `cca4a823` smallint(6) DEFAULT '7008',\n  `b5244bf8` bigint(20) DEFAULT '6308994588244965155',\n  `32c733ce` bigint(20) DEFAULT '-1343611900857841884',\n  `5c7e9e66` datetime DEFAULT '9052-06-30 13:10:34',\n  `24e1a62a` mediumint(9) DEFAULT '-4378120',\n  `df1a2915` tinyint(4) DEFAULT '-113',\n  `90a87a70` int(11) DEFAULT '-1057258940',\n  KEY `99d84913` (`df1a2915`),\n  KEY `cb679e68` (`24e1a62a`),\n  KEY `eba0c161` (`32c733ce`),\n  KEY `d5ba3944` (`90a87a70`,`32c733ce`,`24e1a62a`)\n) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci")
	tk.MustExec("ALTER TABLE `19bbb05e` ADD  INDEX `08427bcf` (`cca4a823`), ADD  INDEX `367bc5a4` (`90a87a70`), RENAME INDEX `99d84913` to `06c5d43f`, ADD COLUMN `ae57ec09` SMALLINT NULL DEFAULT '-18721' AFTER `5c7e9e66`;")

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

Both of temp indexes get merged.

3. What did you see instead (Required)

There are two indexes, but only one "merge temp index" log is observed. It is possible that one of temp index is not merged. That means if there are workload during adding index on the this table, data must be inconsistency.

4. What is your TiDB version? (Required)

47a990e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 affects-7.6 component/ddl This issue is related to DDL of TiDB. fuzz/schrddl severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants