Closed tiancaiamao closed 2 months ago
OK, this is caused by the mock session manager. We have a background infosync worker (goroutine) checking the status of all the internal sessions:
// ReportMinStartTS reports self server min start timestamp to ETCD.
func (is *InfoSyncer) ReportMinStartTS(store kv.Storage) {
sm := is.GetSessionManager()
if sm == nil {
return
}
pl := sm.ShowProcessList()
innerSessionStartTSList := sm.GetInternalSessionStartTSList()
......
When this trying to get the session txn status, it DATA RACE with the other caller who is taking a internal session out from the session pool and using it.
Fixed already by https://github.com/pingcap/tidb/pull/54403
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Found in our CI https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_check2/detail/ghpr_check2/12427/pipeline/514/
Here is the DATA RACE stack:
2. What did you expect to see? (Required)
no data race
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master