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

Caught panic when canceling DDL jobs #54687

Closed
lance6716 opened this issue Jul 17, 2024 · 1 comment · Fixed by #54685
Closed

Caught panic when canceling DDL jobs #54687

lance6716 opened this issue Jul 17, 2024 · 1 comment · Fixed by #54685
Labels
component/ddl This issue is related to DDL of TiDB. impact/panic severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

check the error message of

// test PD connection issue causes failure after tidb_ddl_error_count_limit
testfailpoint.Enable(t, "github.com/pingcap/tidb/pkg/ddl/mockClearTablePlacementAndBundlesErr", `return()`)
// TODO(lance6716): fix it later
//tk.MustGetErrMsg("flashback database test_flashback", "[ddl:-1]DDL job rollback, error msg: mock error for clearTablePlacementAndBundles")
tk.MustExecToErr("flashback database test_flashback")

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

no panic message

3. What did you see instead (Required)

[ddl:-1]panic in handling DDL logic and error count beyond the limitation 2, cancelled

4. What is your TiDB version? (Required)

@lance6716
Copy link
Contributor Author

The reason is when a job can't be converted to rollingback job in convertJob2RollbackJob, the returned error is nil. And nil error will cause needUpdateRawArgs returns true. Then the RawArgs will be marshalled from Args but Args is nil and not initialized. Then the new job will panic when unmarshal from empty RawArgs.

@jebter jebter added component/ddl This issue is related to DDL of TiDB. impact/panic labels Jul 18, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in f774ef6 Jul 23, 2024
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. impact/panic severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants