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

PITR: support modifying the config tikv.import.memory-use-ratio online when restore point. #14408

Merged
merged 6 commits into from Mar 20, 2023

Conversation

joccau
Copy link
Contributor

@joccau joccau commented Mar 16, 2023

What is changed and how it works?

Issue Number: Close #14409

What's Changed:
As title.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Manual test

MySQL [(none)]> show config where type='tikv' and name='import.memory-use-ratio';
+------+-----------------+-------------------------+-------+
| Type | Instance        | Name                    | Value |
+------+-----------------+-------------------------+-------+
| tikv | 10.2.5.31:20162 | import.memory-use-ratio | 0.3   |
| tikv | 10.2.5.11:20160 | import.memory-use-ratio | 0.3   |
| tikv | 10.2.5.18:20161 | import.memory-use-ratio | 0.3   |
+------+-----------------+-------------------------+-------+


MySQL [(none)]> set config tikv `import.memory-use-ratio`=0.1;
MySQL [(none)]> show config where type='tikv' and name='import.memory-use-ratio';
+------+-----------------+-------------------------+-------+
| Type | Instance        | Name                    | Value |
+------+-----------------+-------------------------+-------+
| tikv | 10.2.5.31:20162 | import.memory-use-ratio | 0.1   |
| tikv | 10.2.5.11:20160 | import.memory-use-ratio | 0.1   |
| tikv | 10.2.5.18:20161 | import.memory-use-ratio | 0.1   |
+------+-----------------+-------------------------+-------+


MySQL [(none)]> set config tikv `import.memory-use-ratio`=0.2;
MySQL [(none)]> show config where type='tikv' and name='import.memory-use-ratio';
+------+-----------------+-------------------------+-------+
| Type | Instance        | Name                    | Value |
+------+-----------------+-------------------------+-------+
| tikv | 10.2.5.31:20162 | import.memory-use-ratio | 0.2   |
| tikv | 10.2.5.11:20160 | import.memory-use-ratio | 0.2   |
| tikv | 10.2.5.18:20161 | import.memory-use-ratio | 0.2   |
+------+-----------------+-------------------------+-------+

Find the message from tikv.log

[2023/03/16 19:05:03.608 +08:00] [INFO] [config.rs:76] ["import config changed"] [change="{\"memory_use_ratio\": 0.1}"]
[2023/03/16 19:05:09.598 +08:00] [INFO] [sst_importer.rs:599] ["update importer config"] [size=3435973836] [memory-use-ratio=0.1]

[2023/03/16 19:08:42.187 +08:00] [INFO] [config.rs:76] ["import config changed"] [change="{\"memory_use_ratio\": 0.2}"]
[2023/03/16 19:08:49.801 +08:00] [INFO] [sst_importer.rs:599] ["update importer config"] [size=6871947673] [memory-use-ratio=0.2]

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

Support modify the config tikv.import.memory-use-ratio online when restore point

Signed-off-by: joccau <zak.zhao@pingcap.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 16, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YuJuncen
  • overvenus

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: joccau <zak.zhao@pingcap.com>
@joccau joccau changed the title PITR: support modifying import configure online PITR: support modifying the config tikv.import.memory-use-ratio Mar 16, 2023
@joccau joccau changed the title PITR: support modifying the config tikv.import.memory-use-ratio PITR: support modify the config tikv.import.memory-use-ratio online when restore point. Mar 16, 2023
Signed-off-by: joccau <zak.zhao@pingcap.com>
Copy link
Contributor

@YuJuncen YuJuncen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm

components/sst_importer/src/sst_importer.rs Outdated Show resolved Hide resolved
src/import/sst_service.rs Outdated Show resolved Hide resolved
src/import/sst_service.rs Outdated Show resolved Hide resolved
@joccau joccau force-pushed the pitr-config-update branch 2 times, most recently from 731b339 to 34c6385 Compare March 17, 2023 07:58
@joccau joccau changed the title PITR: support modify the config tikv.import.memory-use-ratio online when restore point. PITR: support modifying the config tikv.import.memory-use-ratio online when restore point. Mar 17, 2023
@joccau joccau force-pushed the pitr-config-update branch 2 times, most recently from c92373b to e0054f1 Compare March 17, 2023 08:31
@joccau
Copy link
Contributor Author

joccau commented Mar 17, 2023

/rebuild

Signed-off-by: joccau <zak.zhao@pingcap.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Mar 17, 2023
@ti-chi-bot
Copy link
Member

@Leavrth: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Mar 20, 2023
Ok(())
}
}

impl std::ops::Deref for ConfigManager {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's generally not recommended to use Deref as it's not easy to trace the code, per my understanding.
I think in this case just use self.0.as_ref() directly seems more straightforward.

@tonyxuqqi
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@tonyxuqqi: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a6d18a4

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Mar 20, 2023
@ti-chi-bot
Copy link
Member

@joccau: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@joccau
Copy link
Contributor Author

joccau commented Mar 20, 2023

/retest

@joccau
Copy link
Contributor Author

joccau commented Mar 20, 2023

/rebuild

@ti-chi-bot ti-chi-bot merged commit 7b1fe9d into tikv:master Mar 20, 2023
1 check passed
@ti-chi-bot ti-chi-bot added this to the Pool milestone Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution Type: PR - From contributors release-note size/L status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PITR: support modify the config tikv.import.memory-use-ratio online when restore point.
6 participants