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 TestStore_CreateShard/tsi1 #21571

Open
danxmoran opened this issue May 26, 2021 · 2 comments
Open

Data race in TestStore_CreateShard/tsi1 #21571

danxmoran opened this issue May 26, 2021 · 2 comments
Labels
area/2.x OSS 2.0 related issues and PRs flaky test This is a flaky test. These issues should be groomed at the next opportunity kind/bug

Comments

@danxmoran
Copy link
Contributor

See for example: https://app.circleci.com/pipelines/github/influxdata/influxdb/20846/workflows/1dbb815e-f78c-496f-ae8b-4cc5bd7be179/jobs/192711

The full race output was:

WARNING: DATA RACE
Read at 0x00c000892043 by goroutine 30:
  testing.(*common).logDepth()
      /usr/local/go/src/testing/testing.go:759 +0x164
  testing.(*common).log()
      /usr/local/go/src/testing/testing.go:746 +0x8f
  testing.(*common).Logf()
      /usr/local/go/src/testing/testing.go:792 +0x21
  testing.(*T).Logf()
      <autogenerated>:1 +0x75
  go.uber.org/zap/zaptest.testingWriter.Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zaptest/logger.go:130 +0x153
  go.uber.org/zap/zaptest.(*testingWriter).Write()
      <autogenerated>:1 +0xad
  go.uber.org/zap/zapcore.(*ioCore).Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zapcore/core.go:90 +0x1e7
  go.uber.org/zap/zapcore.(*CheckedEntry).Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:216 +0x1f1
  go.uber.org/zap.(*Logger).Info()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/logger.go:187 +0x9a
  github.com/influxdata/influxdb/v2/tsdb.(*Store).loadShards.func1()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:399 +0x15f2

Previous write at 0x00c000892043 by goroutine 8:
  testing.tRunner.func1()
      /usr/local/go/src/testing/testing.go:1180 +0x52c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1197 +0x22a

Goroutine 30 (running) created at:
  github.com/influxdata/influxdb/v2/tsdb.(*Store).loadShards()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:355 +0x256a
  github.com/influxdata/influxdb/v2/tsdb.(*Store).Open()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:220 +0x384
  github.com/influxdata/influxdb/v2/tsdb_test.(*Store).Reopen()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:2367 +0x3b8
  github.com/influxdata/influxdb/v2/tsdb_test.TestStore_DeleteRetentionPolicy.func1()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:90 +0x724
  github.com/influxdata/influxdb/v2/tsdb_test.TestStore_DeleteRetentionPolicy.func2()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:106 +0x78
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1193 +0x202

Goroutine 8 (finished) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1238 +0x5d7
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1511 +0xa6
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1193 +0x202
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1509 +0x612
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1417 +0x3b3
  main.main()
      _testmain.go:373 +0x236
@danxmoran danxmoran added kind/bug flaky test This is a flaky test. These issues should be groomed at the next opportunity area/2.x OSS 2.0 related issues and PRs labels May 26, 2021
@danxmoran
Copy link
Contributor Author

I see effectively the same race in a different test: https://app.circleci.com/pipelines/github/influxdata/influxdb/20846/workflows/1dbb815e-f78c-496f-ae8b-4cc5bd7be179/jobs/192709/tests#failed-test-2

WARNING: DATA RACE
Read at 0x00c000867e43 by goroutine 54:
  testing.(*common).logDepth()
      /usr/local/go/src/testing/testing.go:759 +0xf8
  testing.(*common).log()
      /usr/local/go/src/testing/testing.go:746 +0x6c
  testing.(*common).Logf()
      /usr/local/go/src/testing/testing.go:792 +0x1c
  testing.(*T).Logf()
      <autogenerated>:1 +0x5c
  go.uber.org/zap/zaptest.testingWriter.Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zaptest/logger.go:130 +0x10c
  go.uber.org/zap/zaptest.(*testingWriter).Write()
      <autogenerated>:1 +0x78
  go.uber.org/zap/zapcore.(*ioCore).Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zapcore/core.go:90 +0x134
  go.uber.org/zap/zapcore.(*CheckedEntry).Write()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:216 +0x148
  go.uber.org/zap.(*Logger).Info()
      /home/circleci/go/pkg/mod/go.uber.org/[email protected]/logger.go:187 +0x74
  github.com/influxdata/influxdb/v2/tsdb.(*Store).loadShards.func1()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:399 +0xf48

Previous write at 0x00c000867e43 by goroutine 122:
  testing.tRunner.func1()
      /usr/local/go/src/testing/testing.go:1180 +0x36c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1197 +0x190

Goroutine 54 (running) created at:
  github.com/influxdata/influxdb/v2/tsdb.(*Store).loadShards()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:355 +0x1a20
  github.com/influxdata/influxdb/v2/tsdb.(*Store).Open()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store.go:220 +0x260
  github.com/influxdata/influxdb/v2/tsdb_test.(*Store).Reopen()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:2367 +0x2c4
  github.com/influxdata/influxdb/v2/tsdb_test.TestStore_CreateMixedShards.func1()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:173 +0x308
  github.com/influxdata/influxdb/v2/tsdb_test.TestStore_CreateMixedShards.func2()
      /home/circleci/go/src/github.com/influxdata/influxdb/tsdb/store_test.go:197 +0x58
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1193 +0x170

Goroutine 122 (finished) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1238 +0x438
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1511 +0x90
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1193 +0x170
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1509 +0x510
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1417 +0x2d0
  main.main()
      _testmain.go:373 +0x224
==================

@danxmoran
Copy link
Contributor Author

I suspect we're running into uber-go/zap#687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/2.x OSS 2.0 related issues and PRs flaky test This is a flaky test. These issues should be groomed at the next opportunity kind/bug
Projects
None yet
Development

No branches or pull requests

1 participant