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

The dump stats and DDL event handling may conflict #58545

Open
Rustin170506 opened this issue Dec 26, 2024 · 0 comments
Open

The dump stats and DDL event handling may conflict #58545

Rustin170506 opened this issue Dec 26, 2024 · 0 comments
Assignees
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. component/statistics severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@Rustin170506
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

func TestDumpStatsDeltaBeforeHandleDDLEvent(t *testing.T) {
	store, dom := testkit.CreateMockStoreAndDomain(t)
	tk := testkit.NewTestKit(t, store)
	tk.MustExec("use test")
	tk.MustExec("create table t (c1 int)")
	// Insert some data.
	tk.MustExec("insert into t values (1), (2), (3)")
	h := dom.StatsHandle()
	require.NoError(t, h.DumpStatsDeltaToKV(true))
	// Find the DDL event.
	event := findEvent(h.DDLEventCh(), model.ActionCreateTable)
	err := statstestutil.HandleDDLEventWithTxn(h, event)
	require.NoError(t, err)
}

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

It works well and we can tolerate the error.

3. What did you see instead (Required)

It bails out an error.

4. What is your TiDB version? (Required)

master

@Rustin170506 Rustin170506 added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner component/statistics severity/minor affects-8.5 This bug affects the 8.5.x(LTS) versions. labels Dec 26, 2024
@Rustin170506 Rustin170506 self-assigned this Dec 26, 2024
@Rustin170506 Rustin170506 moved this to 🏊WIP in 😆Stats Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. component/statistics severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant