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

ddl: do not unset involving schema on EntryTooLarge error #51963

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pkg/ddl/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,3 +1063,20 @@ func TestMDLTruncateTable(t *testing.T) {
require.True(t, timetk2.After(timeMain))
require.True(t, timetk3.After(timeMain))
}

func TestDDLJobErrEntrySizeTooLarge(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)

tk.MustExec("use test")
tk.MustExec("create table t (a int);")

require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/ddl/mockErrEntrySizeTooLarge", `1*return(true)`))
t.Cleanup(func() {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/ddl/mockErrEntrySizeTooLarge"))
})

tk.MustGetErrCode("rename table t to t1;", errno.ErrEntryTooLarge)
tk.MustExec("create table t1 (a int);")
tk.MustExec("alter table t add column b int;") // Should not block.
}
1 change: 0 additions & 1 deletion pkg/ddl/ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ func (w *worker) handleUpdateJobError(t *meta.Meta, job *model.Job, err error) e
}
// Reduce this txn entry size.
job.BinlogInfo.Clean()
job.InvolvingSchemaInfo = nil
job.Error = toTError(err)
job.ErrorCount++
job.SchemaState = model.StateNone
Expand Down