-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
unexpected assertion failed using global index #56535
Labels
affects-8.5
This bug affects the 8.5.x(LTS) versions.
fuzz/schrddl
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Comments
Do DMLs during add global index (ingest mode) while trigger this problem |
jebter
added
sig/sql-infra
SIG: SQL Infra
severity/major
feature/developing
the related feature is in development
labels
Oct 11, 2024
ti-chi-bot
bot
added
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
labels
Oct 11, 2024
Defined2014
removed
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
labels
Oct 11, 2024
13 tasks
Found a new bug, it seems like the global index key is double deleted.
|
func TestAddGlobalIndexInIngest(t *testing.T) {
store := testkit.CreateMockStore(t)
defer ingesttestutil.InjectMockBackendMgr(t, store)()
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t (a int, b int) partition by hash(a) partitions 5")
tk.MustExec("insert into t (a, b) values (1, 1), (2, 2), (3, 3)")
var i atomic.Int32
i.Store(3)
testfailpoint.EnableCall(t, "github.com/pingcap/tidb/pkg/ddl/onJobUpdated", func(job *model.Job) {
tk2 := testkit.NewTestKit(t, store)
tmp := i.Add(1)
_, err := tk2.Exec(fmt.Sprintf("insert into test.t values (%d, %d)", tmp, tmp))
assert.Nil(t, err)
_, err = tk2.Exec(fmt.Sprintf("update test.t set b = b + 11, a = b where b = %d", tmp-1))
assert.Nil(t, err)
// _, err = tk2.Exec(fmt.Sprintf("delete from test.t where b = %d", tmp-1))
// assert.Nil(t, err)
})
tk.MustExec("alter table t add unique index idx_2(b) global")
rsGlobalIndex := tk.MustQuery("select * from t use index(idx_2)").Sort()
rsTable := tk.MustQuery("select * from t use index()").Sort()
// rsNormalIndex := tk.MustQuery("select * from t use index(idx_1)").Sort()
// num := len(rsGlobalIndex.Rows())
// require.Greater(t, num, 3)
require.Equal(t, rsGlobalIndex.String(), rsTable.String())
// require.Equal(t, rsGlobalIndex.String(), rsNormalIndex.String())
} |
13 tasks
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.
fuzz/schrddl
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Here is the log from our internal test schrddl.
2. What did you expect to see? (Required)
No error
3. What did you see instead (Required)
assertion failed
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: