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

TiDB crash for concurrently multiple writes are not allowed when lighting/br import #58712

Closed
lilinghai opened this issue Jan 6, 2025 · 3 comments · Fixed by #58815
Closed
Assignees
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. impact/crash crash/fatal severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

lightning/br import million tables
a tidb crash

[2025/01/05 07:33:09.177 +00:00] [ERROR] [misc.go:116] ["panic in the recoverable goroutine"] [label=domain] [funcInfo=loadSchemaInLoop] [r="concurrently multiple writes are not allowed"] [stack="github.com/pingcap/tidb/pkg/util.Recover\n\t/workspace/source/tidb/pkg/util/misc.go:120\nruntime.gopanic\n\t/root/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.4.linux-amd64/src/runtime/panic.go:785\ngithub.com/pingcap/tidb/pkg/infoschema.btreeSet[...]\n\t/workspace/source/tidb/pkg/infoschema/infoschema_v2.go:88\ngithub.com/pingcap/tidb/pkg/infoschema.(*Data).add\n\t/workspace/source/tidb/pkg/infoschema/infoschema_v2.go:227\ngithub.com/pingcap/tidb/pkg/infoschema.(*Builder).addTable\n\t/workspace/source/tidb/pkg/infoschema/builder.go:991\ngithub.com/pingcap/tidb/pkg/infoschema.applyCreateTable\n\t/workspace/source/tidb/pkg/infoschema/builder.go:702\ngithub.com/pingcap/tidb/pkg/infoschema.(*Builder).applyTableUpdateV2\n\t/workspace/source/tidb/pkg/infoschema/infoschema_v2.go:1405\ngithub.com/pingcap/tidb/pkg/infoschema.applyTableUpdate\n\t/workspace/source/tidb/pkg/infoschema/infoschema_v2.go:1266\ngithub.com/pingcap/tidb/pkg/infoschema.applyDefaultAction\n\t/workspace/source/tidb/pkg/infoschema/builder.go:320\ngithub.com/pingcap/tidb/pkg/infoschema.(*Builder).ApplyDiff\n\t/workspace/source/tidb/pkg/infoschema/builder.go:105\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).tryLoadSchemaDiffs\n\t/workspace/source/tidb/pkg/domain/domain.go:645\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).loadInfoSchema\n\t/workspace/source/tidb/pkg/domain/domain.go:349\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Reload\n\t/workspace/source/tidb/pkg/domain/domain.go:786\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).loadSchemaInLoop\n\t/workspace/source/tidb/pkg/domain/domain.go:1149\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).Start.func2\n\t/workspace/source/tidb/pkg/domain/domain.go:1534\ngithub.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1\n\t/workspace/source/tidb/pkg/util/wait_group_wrapper.go:103"]

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v9.0.0-alpha-48-g76e0fcdfb4
Edition: Community
Git Commit Hash: 76e0fcd
Git Branch: HEAD
UTC Build Time: 2025-01-05 03:05:58
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Jan 6, 2025
@tiancaiamao tiancaiamao self-assigned this Jan 6, 2025
@tiancaiamao
Copy link
Contributor

It might be caused by multiple call of schema reload

err := s.schemaLoader.Reload()

@D3Hunter
Copy link
Contributor

D3Hunter commented Jan 8, 2025

It might be caused by multiple call of schema reload

tidb/pkg/ddl/job_scheduler.go

Line 453 in 1756a8d

err := s.schemaLoader.Reload()

see this #58722 (review)

@tiancaiamao tiancaiamao removed the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Jan 9, 2025
@tiancaiamao
Copy link
Contributor

v8.5 does contatin #58466, so this does not affect v8.5
Only master branch.

@ti-chi-bot ti-chi-bot bot closed this as completed in 43d9298 Jan 9, 2025
@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Jan 14, 2025
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. impact/crash crash/fatal severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants