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 logservice #854

Open
asddongmen opened this issue Jan 10, 2025 · 0 comments
Open

DATA RACE in logservice #854

asddongmen opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@asddongmen
Copy link
Collaborator

=== Command to ticdc(new arch).
==================
WARNING: DATA RACE
Write at 0x00c00160cc30 by goroutine 1181:
  github.com/pingcap/ticdc/logservice/logpuller.(*matcher).clearUnmatchedValue()
      /home/dongmen/tigate/logservice/logpuller/txn_matcher.go:167 +0x2f1
  github.com/pingcap/ticdc/logservice/logpuller.(*matcher).clear()
      /home/dongmen/tigate/logservice/logpuller/txn_matcher.go:173 +0x12b
  github.com/pingcap/ticdc/logservice/logpuller.(*regionFeedState).markStopped()
      /home/dongmen/tigate/logservice/logpuller/region_state.go:120 +0x1b2
  github.com/pingcap/ticdc/logservice/logpuller.newRegionRequestWorker.func2()
      /home/dongmen/tigate/logservice/logpuller/region_request_worker.go:108 +0xc26
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/dongmen/tigate/vendor/golang.org/x/sync/errgroup/errgroup.go:78 +0x91

Previous read at 0x00c00160cc30 by goroutine 796:
  github.com/pingcap/ticdc/logservice/logpuller.(*matcher).tryCleanUnmatchedValue()
      /home/dongmen/tigate/logservice/logpuller/txn_matcher.go:152 +0x95
  github.com/pingcap/ticdc/logservice/logpuller.handleResolvedTs()
      /home/dongmen/tigate/logservice/logpuller/region_event_handler.go:261 +0x18c
  github.com/pingcap/ticdc/logservice/logpuller.(*regionEventHandler).Handle()
      /home/dongmen/tigate/logservice/logpuller/region_event_handler.go:78 +0x434
  github.com/pingcap/ticdc/utils/dynstream.(*stream[go.shape.int,go.shape.uint64,go.shape.a348c19ef071e79bd5c4123305137578305e08ff7c8b0a32a0761331c6f8b1bc,go.shape.*uint8,go.shape.*uint8]).handleLoop()
      /home/dongmen/tigate/utils/dynstream/stream.go:252 +0x7fa
  github.com/pingcap/ticdc/utils/dynstream.(*stream[go.shape.int,go.shape.uint64,go.shape.a348c19ef071e79bd5c4123305137578305e08ff7c8b0a32a0761331c6f8b1bc,go.shape.*uint8,go.shape.*uint8]).start.gowrap2()
      /home/dongmen/tigate/utils/dynstream/stream.go:113 +0x44

Goroutine 1181 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /home/dongmen/tigate/vendor/golang.org/x/sync/errgroup/errgroup.go:75 +0x124
  github.com/pingcap/ticdc/logservice/logpuller.newRegionRequestWorker()
      /home/dongmen/tigate/logservice/logpuller/region_request_worker.go:98 +0x4a7
  github.com/pingcap/ticdc/logservice/logpuller.(*SubscriptionClient).handleRegions.func1()
      /home/dongmen/tigate/logservice/logpuller/subscription_client.go:441 +0x2b5
  github.com/pingcap/ticdc/logservice/logpuller.(*SubscriptionClient).handleRegions()
      /home/dongmen/tigate/logservice/logpuller/subscription_client.go:479 +0x64d
  github.com/pingcap/ticdc/logservice/logpuller.(*SubscriptionClient).Run.func3()
      /home/dongmen/tigate/logservice/logpuller/subscription_client.go:368 +0x65
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/dongmen/tigate/vendor/golang.org/x/sync/errgroup/errgroup.go:78 +0x91

Goroutine 796 (running) created at:
  github.com/pingcap/ticdc/utils/dynstream.(*stream[go.shape.int,go.shape.uint64,go.shape.a348c19ef071e79bd5c4123305137578305e08ff7c8b0a32a0761331c6f8b1bc,go.shape.*uint8,go.shape.*uint8]).start()
      /home/dongmen/tigate/utils/dynstream/stream.go:113 +0x2bc
  github.com/pingcap/ticdc/utils/dynstream.(*parallelDynamicStream[go.shape.int,go.shape.uint64,go.shape.a348c19ef071e79bd5c4123305137578305e08ff7c8b0a32a0761331c6f8b1bc,go.shape.*uint8,go.shape.*uint8]).Start()
      /home/dongmen/tigate/utils/dynstream/parallel_dynamic_stream.go:77 +0x104
  github.com/pingcap/ticdc/utils/dynstream.(*parallelDynamicStream[int,github.com/pingcap/ticdc/logservice/logpuller.SubscriptionID,github.com/pingcap/ticdc/logservice/logpuller.regionEvent,*github.com/pingcap/ticdc/logservice/logpuller.subscribedSpan,*github.com/pingcap/ticdc/logservice/logpuller.regionEventHandler]).Start()
      /home/dongmen/tigate/utils/dynstream/parallel_dynamic_stream.go:75 +0x36
  github.com/pingcap/ticdc/logservice/logpuller.NewSubscriptionClient()
      /home/dongmen/tigate/logservice/logpuller/subscription_client.go:232 +0x901
  github.com/pingcap/ticdc/server.(*server).initialize()
      /home/dongmen/tigate/server/server.go:130 +0xa87
  github.com/pingcap/ticdc/server.(*server).Run()
      /home/dongmen/tigate/server/server.go:169 +0x11b
  github.com/pingcap/ticdc/cmd/server.(*options).run()
      /home/dongmen/tigate/cmd/server/server.go:116 +0xec5
  github.com/pingcap/ticdc/cmd/server.NewCmdServer.func1()
      /home/dongmen/tigate/cmd/server/server.go:231 +0x93
  github.com/spf13/cobra.(*Command).execute()
      /home/dongmen/tigate/vendor/github.com/spf13/cobra/command.go:985 +0x10f3
  github.com/spf13/cobra.(*Command).ExecuteC()
      /home/dongmen/tigate/vendor/github.com/spf13/cobra/command.go:1117 +0x655
  github.com/spf13/cobra.(*Command).Execute()
      /home/dongmen/tigate/vendor/github.com/spf13/cobra/command.go:1041 +0x55a
  github.com/pingcap/ticdc/cmd.main()
      /home/dongmen/tigate/cmd/main.go:132 +0x560
  github.com/pingcap/ticdc/cmd.TestRunMain()
      /home/dongmen/tigate/cmd/main_test.go:35 +0x1e4
  testing.tRunner()
      /root/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /root/go/pkg/mod/golang.org/[email protected]/src/testing/testing.go:1743 +0x44
==================

@asddongmen asddongmen added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant