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

Open
wants to merge 12 commits into
base: master
Choose a base branch
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 and others added 11 commits December 29, 2020 15:34
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
@sre-bot
Copy link

sre-bot commented Dec 29, 2020

Signed-off-by: you06 <you1474600@gmail.com>
@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.

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