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

data race in TestViewColumns #27492

Closed
xiongjiwei opened this issue Aug 23, 2021 · 2 comments
Closed

data race in TestViewColumns #27492

xiongjiwei opened this issue Aug 23, 2021 · 2 comments
Assignees
Labels
component/test severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@xiongjiwei
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

[2021-08-23T06:14:12.891Z] ==================
[2021-08-23T06:14:12.891Z] WARNING: DATA RACE
[2021-08-23T06:14:12.891Z] Read at 0x00c0047fe0a8 by goroutine 67:
[2021-08-23T06:14:12.891Z]   github.com/pingcap/parser/types.(*FieldType).EvalType()
[2021-08-23T06:14:12.891Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210819101755-48d84c1db428/types/field_type.go:96 +0x44
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/statistics.NewHistogram()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/histogram.go:97 +0x80
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/statistics.PseudoTable()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/table.go:703 +0x34c
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetPartitionStats()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:525 +0x159
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetTableStats()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:517 +0xe12
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).HandleAutoAnalyze()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/update.go:952 +0xde3
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/domain.(*Domain).autoAnalyzeWorker()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1350 +0x2ea
[2021-08-23T06:14:12.891Z] 
[2021-08-23T06:14:12.891Z] Previous write at 0x00c0047fe0a8 by goroutine 112:
[2021-08-23T06:14:12.891Z]   [failed to restore the stack]
[2021-08-23T06:14:12.891Z] 
[2021-08-23T06:14:12.891Z] Goroutine 67 (running) created at:
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/domain.(*Domain).UpdateTableStatsLoop()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1184 +0x350
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/session.BootstrapSession()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:2530 +0x653
[2021-08-23T06:14:12.891Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).SetUpSuite()
[2021-08-23T06:14:12.891Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:66 +0x15c
[2021-08-23T06:14:12.891Z]   runtime.call16()
[2021-08-23T06:14:12.891Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-23T06:14:12.891Z]   reflect.Value.Call()
[2021-08-23T06:14:12.891Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-23T06:14:12.891Z]   github.com/pingcap/check.(*suiteRunner).runFixture.func1()
[2021-08-23T06:14:12.891Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:799 +0x1d0
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-23T06:14:12.892Z] 
[2021-08-23T06:14:12.892Z] Goroutine 112 (finished) created at:
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).prepare()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:272 +0xd04
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).parallelExecute()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:209 +0x5cb
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:182 +0x10d
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*recordSet).Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:146 +0x115
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2021-08-23T06:14:12.892Z]       <autogenerated>:1 +0x84
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.GetRows4Test()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:308 +0x35e
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:326 +0xba
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:401 +0xad
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResult()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:396 +0x566
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:339 +0x571
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).TestViewColumns()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:741 +0x7b3
[2021-08-23T06:14:12.892Z]   runtime.call16()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-23T06:14:12.892Z]   reflect.Value.Call()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-23T06:14:12.892Z] ==================
[2021-08-23T06:14:12.892Z] ==================
[2021-08-23T06:14:12.892Z] WARNING: DATA RACE
[2021-08-23T06:14:12.892Z] Read at 0x00c0047fe1f0 by goroutine 67:
[2021-08-23T06:14:12.892Z]   github.com/pingcap/parser/types.(*FieldType).Clone()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/parser@v0.0.0-20210819101755-48d84c1db428/types/field_type.go:63 +0x3b5
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/statistics.NewHistogram()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/histogram.go:101 +0x4d4
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/statistics.PseudoTable()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/table.go:703 +0x34c
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetPartitionStats()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:525 +0x159
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).GetTableStats()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/handle.go:517 +0xe12
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/statistics/handle.(*Handle).HandleAutoAnalyze()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/statistics/handle/update.go:952 +0xde3
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/domain.(*Domain).autoAnalyzeWorker()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1350 +0x2ea
[2021-08-23T06:14:12.892Z] 
[2021-08-23T06:14:12.892Z] Previous write at 0x00c0047fe1f0 by goroutine 112:
[2021-08-23T06:14:12.892Z]   [failed to restore the stack]
[2021-08-23T06:14:12.892Z] 
[2021-08-23T06:14:12.892Z] Goroutine 67 (running) created at:
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/domain.(*Domain).UpdateTableStatsLoop()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:1184 +0x350
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.BootstrapSession()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:2530 +0x653
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).SetUpSuite()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:66 +0x15c
[2021-08-23T06:14:12.892Z]   runtime.call16()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-23T06:14:12.892Z]   reflect.Value.Call()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).runFixture.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:799 +0x1d0
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-23T06:14:12.892Z] 
[2021-08-23T06:14:12.892Z] Goroutine 112 (finished) created at:
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).prepare()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:272 +0xd04
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).parallelExecute()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:209 +0x5cb
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*ProjectionExec).Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:182 +0x10d
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:286 +0x2a8
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/executor.(*recordSet).Next()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/adapter.go:146 +0x115
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.(*execStmtResult).Next()
[2021-08-23T06:14:12.892Z]       <autogenerated>:1 +0x84
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.GetRows4Test()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:308 +0x35e
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/session.ResultSetToStringSlice()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:326 +0xba
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResultWithCtx()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:401 +0xad
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).ResultSetToResult()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:396 +0x566
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/util/testkit.(*TestKit).MustQuery()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:339 +0x571
[2021-08-23T06:14:12.892Z]   github.com/pingcap/tidb/table/tables_test.(*testSuite).TestViewColumns()
[2021-08-23T06:14:12.892Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/table/tables/tables_test.go:741 +0x7b3
[2021-08-23T06:14:12.892Z]   runtime.call16()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
[2021-08-23T06:14:12.892Z]   reflect.Value.Call()
[2021-08-23T06:14:12.892Z]       /usr/local/go/src/reflect/value.go:337 +0xd8
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
[2021-08-23T06:14:12.892Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2021-08-23T06:14:12.892Z]       /nfs/cache/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
[2021-08-23T06:14:12.892Z] ==================

https://ci.pingcap.net/blue/rest/organizations/jenkins/pipelines/tidb_ghpr_unit_test/runs/9831/nodes/108/steps/331/log/?start=0

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@xiongjiwei xiongjiwei added type/bug The issue is confirmed as a bug. component/test labels Aug 23, 2021
@bb7133
Copy link
Member

bb7133 commented Aug 27, 2021

Close it since it is duplicated with #26539, @tiancaiamao please take a look at #26539 if you're interested in fixing it.

@bb7133 bb7133 closed this as completed Aug 27, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants