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

owner: fix memory accumulated when owner consume etcd update slow (#1225) #1227

Merged
merged 3 commits into from
Dec 24, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #1225 to release-4.0


What problem does this PR solve?

Fix for a memory accumulated issue in owner

https://github.com/pingcap/ticdc/blob/eed57c94491fd140f0a8a0528acc574bc542bb0b/cdc/owner.go#L1024-L1039

The output channel consume speed (which relays on how often L1035 can be run) may be much slower than the etcd key update frequency, which will lead to data accumulated in etcd watch client

If changefeed number is equal or larger than 2, the bug is 100% triggered.

What is changed and how it works?

use notifier to work as the event trigger

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below) (Have tested in an internal test cluster)
    • setup a ticdc cluster, create one or more changefeeds
    • running cdc for 10mins, get memory profile of cdc owner by http://<ip>:<port>/debug/pprof/heap
    • find the memory usage of etcd.clientv3, should be less than 5MB

before fix:

after:

image

Release note

  • Fix a bug that the cdc owner might consume too much memory in the etcd watch client

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 24, 2020
@amyangfei
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 24, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit 6b7fb14 into pingcap:release-4.0 Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants