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 found in the gc manager TryUpdateGCSafePoint #9895

Closed
3AceShowHand opened this issue Oct 16, 2023 · 0 comments · Fixed by #9897
Closed

data race found in the gc manager TryUpdateGCSafePoint #9895

3AceShowHand opened this issue Oct 16, 2023 · 0 comments · Fixed by #9897
Labels
affects-7.4 affects-7.5 This bug affects the 7.5.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@3AceShowHand
Copy link
Contributor

What did you do?

run one changefeed normally

What did you expect to see?

nothing special, run normally

What did you see instead?

==================
WARNING: DATA RACE
Write at 0x00c00319e0f0 by goroutine 596:
  github.com/pingcap/tiflow/pkg/txnutil/gc.(*gcManager).TryUpdateGCSafePoint()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/txnutil/gc/gc_manager.go:102 +0xac4
  github.com/pingcap/tiflow/cdc/controller.(*controllerImpl).updateGCSafepoint()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/controller/controller.go:229 +0x575
  github.com/pingcap/tiflow/cdc/controller.(*controllerImpl).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/controller/controller.go:135 +0x1fd
  github.com/pingcap/tiflow/pkg/orchestrator.(*EtcdWorker).Run()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/orchestrator/etcd_worker.go:290 +0x1d12
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).runEtcdWorker()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:580 +0x328
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner.func4()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:521 +0x275
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Previous read at 0x00c00319e0f0 by goroutine 595:
  github.com/pingcap/tiflow/pkg/txnutil/gc.(*gcManager).CheckStaleCheckpointTs()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/txnutil/gc/gc_manager.go:112 +0xc4
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).checkStaleCheckpointTs()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:302 +0x479
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:314 +0x458
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:238 +0x5fa
  github.com/pingcap/tiflow/cdc/owner.(*ownerImpl).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/owner.go:182 +0xb59
  github.com/pingcap/tiflow/pkg/orchestrator.(*EtcdWorker).Run()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/orchestrator/etcd_worker.go:290 +0x1d12
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).runEtcdWorker()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:580 +0x328
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:516 +0x630
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Goroutine 596 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:520 +0x197d
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).run.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:355 +0x69
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Goroutine 595 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:515 +0x1764
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).run.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:355 +0x69
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76
==================
==================
WARNING: DATA RACE
Write at 0x00c00319e0e8 by goroutine 596:
  github.com/pingcap/tiflow/pkg/txnutil/gc.(*gcManager).TryUpdateGCSafePoint()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/txnutil/gc/gc_manager.go:103 +0xaec
  github.com/pingcap/tiflow/cdc/controller.(*controllerImpl).updateGCSafepoint()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/controller/controller.go:229 +0x575
  github.com/pingcap/tiflow/cdc/controller.(*controllerImpl).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/controller/controller.go:135 +0x1fd
  github.com/pingcap/tiflow/pkg/orchestrator.(*EtcdWorker).Run()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/orchestrator/etcd_worker.go:290 +0x1d12
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).runEtcdWorker()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:580 +0x328
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner.func4()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:521 +0x275
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Previous read at 0x00c00319e0e8 by goroutine 595:
  github.com/pingcap/tiflow/pkg/txnutil/gc.(*gcManager).CheckStaleCheckpointTs()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/txnutil/gc/gc_manager.go:126 +0x3ca
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).checkStaleCheckpointTs()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:302 +0x479
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:314 +0x458
  github.com/pingcap/tiflow/cdc/owner.(*changefeed).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/changefeed.go:238 +0x5fa
  github.com/pingcap/tiflow/cdc/owner.(*ownerImpl).Tick()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/owner/owner.go:182 +0xb59
  github.com/pingcap/tiflow/pkg/orchestrator.(*EtcdWorker).Run()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/pkg/orchestrator/etcd_worker.go:290 +0x1d12
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).runEtcdWorker()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:580 +0x328
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:516 +0x630
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Goroutine 596 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:520 +0x197d
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).run.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:355 +0x69
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76

Goroutine 595 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).campaignOwner()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:515 +0x1764
  github.com/pingcap/tiflow/cdc/capture.(*captureImpl).run.func3()
      /home/jenkins/agent/workspace/pingcap/tiflow/pull_cdc_integration_storage_test/tiflow/cdc/capture/capture.go:355 +0x69
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x76
==================

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

master
@3AceShowHand 3AceShowHand added type/bug The issue is confirmed as a bug. area/ticdc Issues or PRs related to TiCDC. labels Oct 16, 2023
@sdojjy sdojjy added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.4 labels Oct 16, 2023
ti-chi-bot bot pushed a commit that referenced this issue Oct 17, 2023
@sdojjy sdojjy added affects-7.5 This bug affects the 7.5.x(LTS) versions. and removed affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.4 affects-7.5 This bug affects the 7.5.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/moderate type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants