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

multi-schema-change ADD INDEX may cause data-index inconsistency #53792

Closed
lance6716 opened this issue Jun 4, 2024 · 3 comments
Closed

multi-schema-change ADD INDEX may cause data-index inconsistency #53792

lance6716 opened this issue Jun 4, 2024 · 3 comments
Assignees
Labels
component/ddl This issue is related to DDL of TiDB. found/automation Found by automation tests type/question The issue belongs to a question.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Jun 4, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

found by CI, failed to build writer does not fail the DDL job

[2024/06/03 19:01:11.373 +08:00] [INFO] [engine_mgr.go:96] ["open an engine for index reorg task"] ["job ID"=130] ["index IDs"="[13,14,15,16,17,18,19,20,21,22,23,24]"] ["current memory usage"=6442452808] ["memory limitation"=8589934592]
...
[2024/06/03 19:01:11.451 +08:00] [WARN] [message.go:80] ["allocate memory failed"] ["job ID"=130] ["index ID"=13] ["current memory usage"=8468302240] ["max memory quota"=8589934592]
[2024/06/03 19:01:11.451 +08:00] [ERROR] [engine.go:200] ["build ingest writer context failed"] [error="[ddl:8247]Ingest failed: memory used up"] ["job ID"=130] ["index ID"=13] ["worker ID"=18]
[2024/06/03 19:01:11.451 +08:00] [ERROR] [backfilling_operators.go:597] ["create index ingest worker failed"] [task-id=1] [subtask-id=1] [error="[ddl:8247]Ingest failed: memory used up"]
[2024/06/03 19:01:11.451 +08:00] [INFO] [backfilling_operators.go:700] ["finish a index ingest task"] [task-id=1] [subtask-id=1] [id=1]
...
[2024/06/03 19:01:11.468 +08:00] [INFO] [backend.go:225] ["acquire distributed flush lock success"] [jobID=130]

just reading the code

writer, err := engines[i].CreateWriter(writerID)
if err != nil {
logutil.Logger(ctx).Error("create index ingest worker failed", zap.Error(err))
return nil

we should not ignore the error

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@lance6716 lance6716 added the type/bug The issue is confirmed as a bug. label Jun 4, 2024
@jebter jebter added severity/critical component/ddl This issue is related to DDL of TiDB. impact/inconsistency incorrect/inconsistency/inconsistent labels Jun 4, 2024
@lance6716
Copy link
Contributor Author

After I run lightning CI locally, can verify that data-index inconsistency

MySQL [add_index]> admin check table multi_indexes;
ERROR 8223 (HY000): data inconsistency in table: multi_indexes, index: idx_c2, handle: 1, index-values:"" != record-values:"handle: 1, values: [KindString R001_2]"

@lance6716
Copy link
Contributor Author

Seems it's a problem of my own PR 😂

@tangenta tangenta added type/question The issue belongs to a question. and 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 type/bug The issue is confirmed as a bug. severity/critical impact/inconsistency incorrect/inconsistency/inconsistent labels Jun 7, 2024
@seiya-annie
Copy link

/found customer

@ti-chi-bot ti-chi-bot bot added the report/customer Customers have encountered this bug. label Jun 19, 2024
@lance6716 lance6716 added found/automation Found by automation tests and removed report/customer Customers have encountered this bug. labels Jun 19, 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. found/automation Found by automation tests type/question The issue belongs to a question.
Projects
None yet
Development

No branches or pull requests

4 participants