panic when to deal with updateGlobalStats in the HandleDDLEvent #58715
Open
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create a partition table without global stats and truncate a partition.
2. What did you expect to see? (Required)
3. What did you see instead (Required)
[2024/12/19 23:06:00.995 +08:00] [ERROR] [misc.go:116] ["panic in the recoverable goroutine"] [label=domain] [funcInfo=updateStatsWorker] [r="\"invalid memory address or nil pointer dereference\""] [stack="[github.com/pingcap/tidb/util.Recover](http://github.com/pingcap/tidb/util.Recover)\n\t/src/util/misc.go:120\nruntime.gopanic\n\t/go/src/runtime/panic.go:884\nruntime.panicmem\n\t/go/src/runtime/panic.go:260\nruntime.sigpanic\n\t/go/src/runtime/signal_unix.go:835\[ngithub.com/pingcap/tidb/statistics/handle.(](http://ngithub.com/pingcap/tidb/statistics/handle.()*Handle).updateGlobalStats\n\t/src/statistics/handle/ddl.go:168\[ngithub.com/pingcap/tidb/statistics/handle.(](http://ngithub.com/pingcap/tidb/statistics/handle.()*Handle).HandleDDLEvent\n\t/src/statistics/handle/ddl.go:60\[ngithub.com/pingcap/tidb/domain.(](http://ngithub.com/pingcap/tidb/domain.()*Domain).updateStatsWorker\n\t/src/domain/domain.go:1982\[ngithub.com/pingcap/tidb/domain.(](http://ngithub.com/pingcap/tidb/domain.()*Domain).UpdateTableStatsLoop.func1\n\t/src/domain/domain.go:1851\[ngithub.com/pingcap/tidb/util.(](http://ngithub.com/pingcap/tidb/util.()*WaitGroupWrapper).Run.func1\n\t/src/util/wait_group_wrapper.go:33"]
4. What is your TiDB version? (Required)
v6.5 (6.5.3)
v7.1 without missing global status.
Activity