matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.78k stars 275 forks source link

[Bug]: data race #16331

Closed sukki37 closed 4 months ago

sukki37 commented 4 months ago

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

ed279e6

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

https://github.com/matrixorigin/matrixone/actions/runs/9180238142

==================
WARNING: DATA RACE
Read at 0x00c01f4a31a8 by goroutine 9918:
  github.com/matrixorigin/matrixone/pkg/txn/client.(*txnOperator).CloneSnapshotOp()
      /home/runner/_work/matrixone/matrixone/head/pkg/txn/client/operator.go:285 +0x465
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).expandRanges()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/compile.go:3778 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).handleRuntimeFilter()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:418 +0x13d0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:453 +0x426
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Previous write at 0x00c01f4a31a8 by goroutine 9858:
  github.com/matrixorigin/matrixone/pkg/txn/client.(*txnOperator).CloneSnapshotOp()
      /home/runner/_work/matrixone/matrixone/head/pkg/txn/client/operator.go:285 +0x5ed
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).expandRanges()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/compile.go:3778 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).handleRuntimeFilter()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:418 +0x13d0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:453 +0x426
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Goroutine 9918 (running) created at:
  github.com/panjf2000/ants/v2.(*goWorker).run()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:48 +0xe9
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:337 +0xed
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:348 +0x286
  github.com/panjf2000/ants/v2.(*Pool).Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:222 +0x96
  github.com/panjf2000/ants/v2.Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/ants.go:103 +0x56
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:213 +0x3ec
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).JoinRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:668 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:444 +0x2f0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Goroutine 9858 (running) created at:
  github.com/panjf2000/ants/v2.(*goWorker).run()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:48 +0xe9
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:337 +0xed
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:348 +0x286
  github.com/panjf2000/ants/v2.(*Pool).Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:222 +0x96
  github.com/panjf2000/ants/v2.Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/ants.go:103 +0x56
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:213 +0x3ec
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:228 +0x45d
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5
==================
==================
WARNING: DATA RACE
Write at 0x00c01f4a31a8 by goroutine 9918:
  github.com/matrixorigin/matrixone/pkg/txn/client.(*txnOperator).CloneSnapshotOp()
      /home/runner/_work/matrixone/matrixone/head/pkg/txn/client/operator.go:285 +0x5ed
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).expandRanges()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/compile.go:3778 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).handleRuntimeFilter()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:418 +0x13d0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:453 +0x426
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Previous write at 0x00c01f4a31a8 by goroutine 10116:
  github.com/matrixorigin/matrixone/pkg/txn/client.(*txnOperator).CloneSnapshotOp()
      /home/runner/_work/matrixone/matrixone/head/pkg/txn/client/operator.go:285 +0x5ed
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Compile).expandRanges()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/compile.go:3778 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).handleRuntimeFilter()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:418 +0x13d0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:453 +0x426
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Goroutine 9918 (running) created at:
  github.com/panjf2000/ants/v2.(*goWorker).run()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:48 +0xe9
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:337 +0xed
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:348 +0x286
  github.com/panjf2000/ants/v2.(*Pool).Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:222 +0x96
  github.com/panjf2000/ants/v2.Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/ants.go:103 +0x56
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:213 +0x3ec
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).JoinRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:668 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:444 +0x2f0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5

Goroutine 10116 (running) created at:
  github.com/panjf2000/ants/v2.(*goWorker).run()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:48 +0xe9
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:337 +0xed
  github.com/panjf2000/ants/v2.(*Pool).retrieveWorker()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:348 +0x286
  github.com/panjf2000/ants/v2.(*Pool).Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/pool.go:222 +0x96
  github.com/panjf2000/ants/v2.Submit()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/ants.go:103 +0x56
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:213 +0x3ec
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).JoinRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:668 +0x5f7
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:444 +0x2f0
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:296 +0x11c
  github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1()
      /home/runner/_work/matrixone/matrixone/head/pkg/sql/compile/scope.go:230 +0x31b
  github.com/panjf2000/ants/v2.(*goWorker).run.func1()
      /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.7.4/worker.go:67 +0x1a5
==================

multi-cn-e2e-with-race-linux-x86-reports.zip

Expected Behavior

No response

Steps to Reproduce

run bvt with race-enabled mo

Additional information

No response

qingxinhome commented 4 months ago

处理中....

qingxinhome commented 4 months ago

main分支pr已经合并, 1.2-dev待合并

qingxinhome commented 4 months ago

This feature has been implemented and verified through @sukki37 @aunjgr @aressu1985 @Ariznawlll @badboynt1 @daviszhen