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 PatrolKeyspaceAssignment #6796

Closed
lhy1024 opened this issue Jul 13, 2023 · 0 comments · Fixed by #6797
Closed

Data race in PatrolKeyspaceAssignment #6796

lhy1024 opened this issue Jul 13, 2023 · 0 comments · Fixed by #6797
Labels
type/ci The issue is related to CI.

Comments

@lhy1024
Copy link
Contributor

lhy1024 commented Jul 13, 2023

Flaky Test

Which jobs are failing

==================
WARNING: DATA RACE
Write at 0x00c00435a000 by goroutine 1513:
  github.com/tikv/pd/pkg/keyspace.(*indexedHeap).Put()
      /home/lhy1024/pd/pkg/keyspace/util.go:288 +0xde
  github.com/tikv/pd/pkg/keyspace.(*GroupManager).AllocNodesForKeyspaceGroup()
      /home/lhy1024/pd/pkg/keyspace/tso_keyspace_group.go:784 +0x5de
  github.com/tikv/pd/pkg/keyspace.(*GroupManager).allocNodesToAllKeyspaceGroups()
      /home/lhy1024/pd/pkg/keyspace/tso_keyspace_group.go:192 +0x5c7
  github.com/tikv/pd/pkg/keyspace.(*GroupManager).Bootstrap.func2()
      /home/lhy1024/pd/pkg/keyspace/tso_keyspace_group.go:148 +0x58

Previous write at 0x00c00435a000 by goroutine 2085:
  github.com/tikv/pd/pkg/keyspace.(*indexedHeap).Put()
      /home/lhy1024/pd/pkg/keyspace/util.go:288 +0xde
  github.com/tikv/pd/pkg/keyspace.(*Manager).PatrolKeyspaceAssignment()
      /home/lhy1024/pd/pkg/keyspace/keyspace.go:786 +0x5cb
  github.com/tikv/pd/server/apiv2/handlers.SplitKeyspaceGroupByID()
      /home/lhy1024/pd/server/apiv2/handlers/tso_keyspace_group.go:254 +0x3b5
  github.com/gin-gonic/gin.(*Context).Next()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173 +0x1c4
  github.com/tikv/pd/server/apiv2/middlewares.BootstrapChecker.func1()
      /home/lhy1024/pd/server/apiv2/middlewares/bootstrap_checker.go:38 +0x98
  github.com/gin-gonic/gin.(*Context).Next()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173 +0xd4b
  github.com/tikv/pd/server/apiv2/middlewares.Redirector.func1()
      /home/lhy1024/pd/server/apiv2/middlewares/redirector.go:37 +0x13e
  github.com/gin-gonic/gin.(*Context).Next()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173 +0xc3
  github.com/tikv/pd/server/apiv2.NewV2Handler.func2()
      /home/lhy1024/pd/server/apiv2/router.go:61 +0x59
  github.com/gin-gonic/gin.(*Context).Next()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:173 +0xba3
  github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:616 +0x785
  github.com/gin-gonic/gin.(*Engine).ServeHTTP()
      /home/lhy1024/.go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:572 +0x44b
  net/http.(*ServeMux).ServeHTTP()
      /usr/lib/go/src/net/http/server.go:2500 +0xc5
  go.etcd.io/etcd/embed.(*accessController).ServeHTTP()
      /home/lhy1024/.go/pkg/mod/go.etcd.io/[email protected]/embed/serve.go:381 +0x964
  net/http.serverHandler.ServeHTTP()
      /usr/lib/go/src/net/http/server.go:2936 +0x682
  net/http.(*conn).serve()
      /usr/lib/go/src/net/http/server.go:1995 +0xbd4
  net/http.(*Server).Serve.func3()
      /usr/lib/go/src/net/http/server.go:3089 +0x58

Goroutine 1513 (running) created at:
  github.com/tikv/pd/pkg/keyspace.(*GroupManager).Bootstrap()
      /home/lhy1024/pd/pkg/keyspace/tso_keyspace_group.go:148 +0x653
  github.com/tikv/pd/server/cluster.(*RaftCluster).Start()
      /home/lhy1024/pd/server/cluster/cluster.go:284 +0x2f2
  github.com/tikv/pd/server.(*Server).bootstrapCluster()
      /home/lhy1024/pd/server/server.go:724 +0x15d1
  github.com/tikv/pd/server.(*GrpcServer).Bootstrap()
      /home/lhy1024/pd/server/grpc_service.go:688 +0x3ad
  github.com/tikv/pd/tests.(*TestServer).BootstrapCluster()
      /home/lhy1024/pd/tests/cluster.go:401 +0x5e4
  github.com/tikv/pd/tests/integrations/mcs/tso.TestTSOServerStartFirst()
      /home/lhy1024/pd/tests/integrations/mcs/tso/api_test.go:140 +0x5c4
  github.com/pingcap/failpoint.parseTerm()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/terms.go:149 +0x389
  github.com/pingcap/failpoint.parse()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/terms.go:126 +0xad
  github.com/pingcap/failpoint.newTerms()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/terms.go:98 +0x50
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/failpoint.go:54 +0x44
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/failpoints.go:105 +0x276
  github.com/pingcap/failpoint.Enable()
      /home/lhy1024/.go/pkg/mod/github.com/pingcap/[email protected]/failpoints.go:225 +0xb9
  github.com/tikv/pd/tests/integrations/mcs/tso.TestTSOServerStartFirst()
      /home/lhy1024/pd/tests/integrations/mcs/tso/api_test.go:114 +0xba
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      /usr/lib/go/src/testing/testing.go:1629 +0x47

Goroutine 2085 (running) created at:
  net/http.(*Server).Serve()
      /usr/lib/go/src/net/http/server.go:3089 +0x817
  go.etcd.io/etcd/embed.(*serveCtx).serve.func3()
      /home/lhy1024/.go/pkg/mod/go.etcd.io/[email protected]/embed/serve.go:141 +0x58
==================

CI link

Reason for failure (if possible)

Anything else

@lhy1024 lhy1024 added the type/ci The issue is related to CI. label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/ci The issue is related to CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant