Skip to content

server: race in TestAlterTenantCompleteToTime on auditlogging.UserAuditEnterpriseParamsHook #104838

@yuzefovich

Description

@yuzefovich

Seen here (on #104828 which should be unrelated):

=== RUN   TestAlterTenantCompleteToTime
    test_log_scope.go:161: test logs captured to: /artifacts/tmp/_tmp/90c1b75d835f45b8488807abb5b1092d/logTestAlterTenantCompleteToTime2659692391
    test_log_scope.go:79: use -show-logs to present logs inline
==================
WARNING: DATA RACE
Write at 0x000012efccc8 by goroutine 42:
  github.com/cockroachdb/cockroach/pkg/server.newSQLServer()
      github.com/cockroachdb/cockroach/pkg/server/server_sql.go:1383 +0xd0fe
  github.com/cockroachdb/cockroach/pkg/server.NewServer()
      github.com/cockroachdb/cockroach/pkg/server/server.go:1099 +0xa347
  github.com/cockroachdb/cockroach/pkg/server.NewServer()
      github.com/cockroachdb/cockroach/pkg/server/server.go:281 +0xf69
  github.com/cockroachdb/cockroach/pkg/server.testServerFactoryImpl.New()
      github.com/cockroachdb/cockroach/pkg/server/testserver.go:1867 +0x46e
  github.com/cockroachdb/cockroach/pkg/server.(*testServerFactoryImpl).New()
      <autogenerated>:1 +0x6f
  github.com/cockroachdb/cockroach/pkg/testutils/serverutils.NewServer()
      github.com/cockroachdb/cockroach/pkg/testutils/serverutils/test_server_shim.go:392 +0x9d
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.(*TestCluster).AddServer()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:568 +0x504
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.NewTestCluster()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:329 +0xcec
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.StartTestCluster()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:232 +0x7d
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters.func1()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:260 +0xd5
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters.func3()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:285 +0x109
  github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx.func1()
      github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:168 +0x4c
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      golang.org/x/sync/errgroup/external/org_golang_x_sync/errgroup/errgroup.go:75 +0x86

Previous write at 0x000012efccc8 by goroutine 41:
  github.com/cockroachdb/cockroach/pkg/server.newSQLServer()
      github.com/cockroachdb/cockroach/pkg/server/server_sql.go:1383 +0xd0fe
  github.com/cockroachdb/cockroach/pkg/server.NewServer()
      github.com/cockroachdb/cockroach/pkg/server/server.go:1099 +0xa347
  github.com/cockroachdb/cockroach/pkg/server.NewServer()
      github.com/cockroachdb/cockroach/pkg/server/server.go:281 +0xf69
  github.com/cockroachdb/cockroach/pkg/server.testServerFactoryImpl.New()
      github.com/cockroachdb/cockroach/pkg/server/testserver.go:1867 +0x46e
  github.com/cockroachdb/cockroach/pkg/server.(*testServerFactoryImpl).New()
      <autogenerated>:1 +0x6f
  github.com/cockroachdb/cockroach/pkg/testutils/serverutils.NewServer()
      github.com/cockroachdb/cockroach/pkg/testutils/serverutils/test_server_shim.go:392 +0x9d
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.(*TestCluster).AddServer()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:568 +0x504
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.NewTestCluster()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:329 +0xcec
  github.com/cockroachdb/cockroach/pkg/testutils/testcluster.StartTestCluster()
      github.com/cockroachdb/cockroach/pkg/testutils/testcluster/testcluster.go:232 +0x7d
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters.func1()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:260 +0xd5
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters.func2()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:277 +0x134
  github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx.func1()
      github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:168 +0x4c
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      golang.org/x/sync/errgroup/external/org_golang_x_sync/errgroup/errgroup.go:75 +0x86

Goroutine 42 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      golang.org/x/sync/errgroup/external/org_golang_x_sync/errgroup/errgroup.go:72 +0x12e
  github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx()
      github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:167 +0x109
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:283 +0xd64
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/streamingest.TestAlterTenantCompleteToTime()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/streamingest/alter_replication_job_test.go:37 +0x19a
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1493 +0x47

Goroutine 41 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      golang.org/x/sync/errgroup/external/org_golang_x_sync/errgroup/errgroup.go:72 +0x12e
  github.com/cockroachdb/cockroach/pkg/util/ctxgroup.Group.GoCtx()
      github.com/cockroachdb/cockroach/pkg/util/ctxgroup/ctxgroup.go:167 +0x109
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils.CreateTenantStreamingClusters()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/replicationtestutils/testutils.go:275 +0xa77
  github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/streamingest.TestAlterTenantCompleteToTime()
      github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/streamingest/alter_replication_job_test.go:37 +0x19a
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1493 +0x47
==================

Jira issue: CRDB-28743

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.v23.1.5

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions