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

Cannot make more than 1000 schema change in the test #58421

Closed
YangKeao opened this issue Dec 19, 2024 · 1 comment · Fixed by #58386
Closed

Cannot make more than 1000 schema change in the test #58421

YangKeao opened this issue Dec 19, 2024 · 1 comment · Fixed by #58386
Labels
component/ddl This issue is related to DDL of TiDB. severity/minor type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

When I'm developing #58110, I found that after making more than 1000 schema change, all DDL will be blocked.

The following test can be used as a simple reproduce:

func TestCreateAndDropTable(t *testing.T) {
	store, dom := testkit.CreateMockStoreAndDomain(t)
	tk := testkit.NewTestKit(t, store)

	for i := 0; i < 600; i++ {
		logutil.BgLogger().Info("round", zap.Int("round", i))
		tk.RefreshSession()

		tk.MustExec("use test")
		tk.MustExec("DROP TABLE if exists t")
		tk.MustExec("CREATE TABLE t (id INT PRIMARY KEY, created_at DATETIME) TTL = created_at + INTERVAL 1 HOUR TTL_ENABLE='OFF'")
		tbl, err := dom.InfoSchema().TableByName(context.Background(), pmodel.NewCIStr("test"), pmodel.NewCIStr("t"))
		require.NoError(t, err)
		logutil.BgLogger().Info("create table", zap.Int64("table_id", tbl.Meta().ID))

		tk.MustExec("ALTER TABLE t TTL_ENABLE='ON'")
	}
}
@YangKeao YangKeao added the type/bug The issue is confirmed as a bug. label Dec 19, 2024
@YangKeao
Copy link
Member Author

It's caused by #57872

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

Successfully merging a pull request may close this issue.

2 participants