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

sysbench oltp_read_write on cached table, tidb panic #33169

Closed
tiancaiamao opened this issue Mar 16, 2022 · 0 comments · Fixed by #33171
Closed

sysbench oltp_read_write on cached table, tidb panic #33169

tiancaiamao opened this issue Mar 16, 2022 · 0 comments · Fixed by #33171
Labels
feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

sysbench --config-file=config oltp_read_write --tables=32 --table-size=100000 prepare

use sbtest;
alter table sbtest1 cache;
alter table sbtest2 cache;
...
alter table sbtest32 cache;

sysbench --config-file=config oltp_read_write --tables=32 --table-size=100000 run

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

No error

3. What did you see instead (Required)

fatal error: concurrent map read and map write

goroutine 379911 [running]:
runtime.throw({0x37f9191?, 0x203000?})
	/home/genius/project/go/src/runtime/panic.go:992 +0x71 fp=0xc03e471028 sp=0xc03e470ff8 pc=0x1271811
runtime.mapaccess2(0x0?, 0x0?, 0x0?)
	/home/genius/project/go/src/runtime/map.go:476 +0x205 fp=0xc03e471068 sp=0xc03e471028 pc=0x124a2a5
github.com/pingcap/tidb/planner.Optimize({0x3d02840, 0xc0000540b8}, {0x3d556b0, 0xc002c24240}, {0x3d0fc30, 0xc03ed10f00}, {0x3d216e0, 0xc0012bea80})
	/home/genius/project/src/github.com/pingcap/tidb/planner/optimize.go:136 +0x50e fp=0xc03e471750 sp=0xc03e471068 pc=0x27b578e
github.com/pingcap/tidb/executor.(*Compiler).Compile(0xc03e4719d0, {0x3d02840, 0xc0000540b8}, {0x3d13da8, 0xc03ed10f00})
	/home/genius/project/src/github.com/pingcap/tidb/executor/compiler.go:77 +0x485 fp=0xc03e4718c0 sp=0xc03e471750 pc=0x2d7f6a5
github.com/pingcap/tidb/session.(*session).ExecuteStmt(0xc002c24240, {0x3d02840, 0xc0000540b8}, {0x3d13da8, 0xc03ed10f00?})
	/home/genius/project/src/github.com/pingcap/tidb/session/session.go:1865 +0x62b fp=0xc03e471c00 sp=0xc03e4718c0 pc=0x2ee66ab
github.com/pingcap/tidb/session.(*session).ExecuteInternal(0xc002c24240, {0x3d02840, 0xc0000540b8}, {0x37fda31, 0x22}, {0x0, 0x0, 0x0})
	/home/genius/project/src/github.com/pingcap/tidb/session/session.go:1499 +0x3f2 fp=0xc03e471d10 sp=0xc03e471c00 pc=0x2ee1c52
github.com/pingcap/tidb/table/tables.(*stateRemoteHandle).execSQL(0x12837d3?, {0x3d02840, 0xc0000540b8}, {0x37fda31?, 0x12848e5?}, {0x0?, 0xc042600ea0?, 0x2?})
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/state_remote.go:363 +0x7c fp=0xc03e471db0 sp=0xc03e471d10 pc=0x2350dbc
github.com/pingcap/tidb/table/tables.(*stateRemoteHandle).runInTxn(0x1?, {0x3d02840, 0xc0000540b8}, 0xc03e471e68)
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/state_remote.go:317 +0x98 fp=0xc03e471e40 sp=0xc03e471db0 pc=0x2350818
github.com/pingcap/tidb/table/tables.(*stateRemoteHandle).RenewReadLease(0xc037cb6600?, {0x3d02840?, 0xc0000540b8?}, 0x128525a?, 0xc005bb22a0?, 0x1284e80?)
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/state_remote.go:224 +0x6d fp=0xc03e471ea8 sp=0xc03e471e40 pc=0x23501cd
github.com/pingcap/tidb/table/tables.(*cachedTable).renewLease(0xc0022ba780, 0x13?, 0xc004c16ae0, 0xc001a27680?)
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/cache.go:259 +0xd7 fp=0xc03e471fb0 sp=0xc03e471ea8 pc=0x233f2d7
github.com/pingcap/tidb/table/tables.(*cachedTable).TryReadFromCache.func2()
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/cache.go:93 +0x32 fp=0xc03e471fe0 sp=0xc03e471fb0 pc=0x233d952
runtime.goexit()
	/home/genius/project/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc03e471fe8 sp=0xc03e471fe0 pc=0x12a5761
created by github.com/pingcap/tidb/table/tables.(*cachedTable).TryReadFromCache
	/home/genius/project/src/github.com/pingcap/tidb/table/tables/cache.go:93 +0x297

goroutine 1 [chan receive, 2 minutes]:
github.com/pingcap/tidb/server.(*Server).Run(0xc0001e8680)
	/home/genius/project/src/github.com/pingcap/tidb/server/server.go:365 +0x1f0
main.main()
	/home/genius/project/src/github.com/pingcap/tidb/tidb-server/main.go:220 +0x5b9

goroutine 15 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc000b7d080)
	/home/genius/go/pkg/mod/[email protected]/stats/view/worker.go:276 +0xad
created by go.opencensus.io/stats/view.init.0
	/home/genius/go/pkg/mod/[email protected]/stats/view/worker.go:34 +0x8d

goroutine 257 [select]:
github.com/pingcap/tidb/util/cpuprofile.(*parallelCPUProfiler).profilingLoop(0xc0005dc1e0)
	/home/genius/project/src/github.com/pingcap/tidb/util/cpuprofile/cpuprofile.go:166 +0x105
github.com/pingcap/tidb/util.WithRecovery(0x0?, 0xc000eb7bc0?)
	/home/genius/project/src/github.com/pingcap/tidb/util/misc.go:100 +0x53
created by github.com/pingcap/tidb/util/cpuprofile.(*parallelCPUProfiler).start
	/home/genius/project/src/github.com/pingcap/tidb/util/cpuprofile/cpuprofile.go:113 +0x165

goroutine 258 [chan receive]:
github.com/pingcap/tidb/util/systimemon.StartMonitor(0x38d45a8, 0x38d3c58, 0xc000edc2d0)
	/home/genius/project/src/github.com/pingcap/tidb/util/systimemon/systime_mon.go:32 +0x185
created by main.setupMetrics
	/home/genius/project/src/github.com/pingcap/tidb/tidb-server/main.go:716 +0x115

4. What is your TiDB version? (Required)

master 2ae7132

@tiancaiamao tiancaiamao added type/bug The issue is confirmed as a bug. feature/developing the related feature is in development severity/major labels Mar 16, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Mar 16, 2022
@tiancaiamao tiancaiamao removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants