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

drainer: reduce memory usage when restart #1030

Closed
wants to merge 12 commits into from

Conversation

you06
Copy link
Contributor

@you06 you06 commented Dec 29, 2020

What problem does this PR solve?

close #978

When drainer restart, it'll load all DDL history from TiDB cluster, this will cause a large memory usage.

What is changed and how it works?

This PR change the DDL history load strategy, load only recently DDLs into drainer, for the stale DDLs, load from a snapshot schema.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release note

  • Reduce memory usage when drainer restart

@sre-bot
Copy link

sre-bot commented Dec 29, 2020

@you06 you06 force-pushed the reduce-memory-usage branch from e68b624 to 9483ff8 Compare December 29, 2020 07:56
@sre-bot
Copy link

sre-bot commented Dec 29, 2020

Signed-off-by: you06 <[email protected]>
@you06
Copy link
Contributor Author

you06 commented Dec 29, 2020

This is a draft implementation.

Because the relationship between job.BinlogInfo.SchemaVersion and job.ID is unknowable, drainer still to load all DDL history to check whether it's schema version is newer than current binlog, the most work we do makes non sense, and it'll cost a long time loading history.

@you06
Copy link
Contributor Author

you06 commented Dec 29, 2020

/run-all-tests

@you06
Copy link
Contributor Author

you06 commented Dec 29, 2020

/run-integration-test

@you06
Copy link
Contributor Author

you06 commented Dec 29, 2020

/run-all-tests

@ti-chi-bot
Copy link
Member

@you06: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

ti-chi-bot bot commented Feb 7, 2025

@you06: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-binlog/build e6bbe2f link true /test pull-build
idc-jenkins-ci-binlog/check e6bbe2f link true /test pull-check
idc-jenkins-ci-tidb-binlog/unit-test e6bbe2f link true /test pull-unit-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@you06 you06 closed this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please help reduce use system memory when drainer startup
5 participants