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.log-backup.max-flush-interval online. #14425

Merged
merged 7 commits into from Mar 29, 2023

Conversation

joccau
Copy link
Contributor

@joccau joccau commented Mar 18, 2023

What is changed and how it works?

Issue Number: Close #14433

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='log-backup.max-flush-interval';
+------+-----------------+-------------------------------+-------+
| Type | Instance        | Name                          | Value |
+------+-----------------+-------------------------------+-------+
| tikv | 10.2.5.31:20162 | log-backup.max-flush-interval | 3m    |
| tikv | 10.2.5.11:20160 | log-backup.max-flush-interval | 3m    |
| tikv | 10.2.5.18:20161 | log-backup.max-flush-interval | 3m    |
+------+-----------------+-------------------------------+-------+


MySQL [(none)]> set config tikv `log-backup.max-flush-interval`="2m";
MySQL [(none)]> show config where type='tikv' and name='log-backup.max-flush-interval';
+------+-----------------+-------------------------------+-------+
| Type | Instance        | Name                          | Value |
+------+-----------------+-------------------------------+-------+
| tikv | 10.2.5.31:20162 | log-backup.max-flush-interval | 2m    |
| tikv | 10.2.5.11:20160 | log-backup.max-flush-interval | 2m    |
| tikv | 10.2.5.18:20161 | log-backup.max-flush-interval | 2m    |
+------+-----------------+-------------------------------+-------+

MySQL [(none)]> set config tikv `log-backup.max-flush-interval`="1m";
MySQL [(none)]> show config where type='tikv' and name='log-backup.max-flush-interval';
+------+-----------------+-------------------------------+-------+
| Type | Instance        | Name                          | Value |
+------+-----------------+-------------------------------+-------+
| tikv | 10.2.5.31:20162 | log-backup.max-flush-interval | 1m    |
| tikv | 10.2.5.11:20160 | log-backup.max-flush-interval | 1m    |
| tikv | 10.2.5.18:20161 | log-backup.max-flush-interval | 1m    |
+------+-----------------+-------------------------------+-------+

MySQL [(none)]> set config tikv `log-backup.max-flush-interval`="0m";
Query OK, 0 rows affected, 3 warnings (0.02 sec)

MySQL [(none)]> show warnings;
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                 |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | bad request to http://10.2.5.31:20182/config: failed to update, error: "the max_flush_interval is too small, it is 0s, and should be greater than 10s." |
| Warning | 1105 | bad request to http://10.2.5.11:20180/config: failed to update, error: "the max_flush_interval is too small, it is 0s, and should be greater than 10s." |
| Warning | 1105 | bad request to http://10.2.5.18:20181/config: failed to update, error: "the max_flush_interval is too small, it is 0s, and should be greater than 10s." |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------+

Find message from tikv.log

[2023/03/20 19:21:33.708 +08:00] [INFO] [config.rs:29] [" log backup config changed"] [change="{\"max_flush_interval\": 120000ms}"]
[2023/03/20 19:29:02.639 +08:00] [INFO] [config.rs:29] [" log backup config changed"] [change="{\"max_flush_interval\": 60000ms}"]

Side effects

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

Release note

PITR supports modifying the config tikv.log-backup.max-flush-interval online.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 18, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • YuJuncen
  • tonyxuqqi

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.

@joccau joccau force-pushed the pitr-update-flush-interval branch from 217fbbf to 7a21a32 Compare March 20, 2023 06:46
Signed-off-by: joccau <zak.zhao@pingcap.com>
Signed-off-by: joccau <zak.zhao@pingcap.com>
joccau and others added 2 commits March 20, 2023 19:31
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.

generally lgtm

src/config/mod.rs Outdated Show resolved Hide resolved
components/backup-stream/src/router.rs Outdated Show resolved Hide resolved
Remove useless code.

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Signed-off-by: Zak Zhao <57036248+joccau@users.noreply.github.com>
@joccau joccau force-pushed the pitr-update-flush-interval branch from 5644a10 to 68ce713 Compare March 28, 2023 09:07
@joccau joccau requested a review from YuJuncen March 28, 2023 09:09
@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Mar 28, 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.

Signed-off-by: Zak Zhao <57036248+joccau@users.noreply.github.com>
@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

@tonyxuqqi: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

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 29, 2023
@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: a7d1fcb

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Mar 29, 2023
@joccau
Copy link
Contributor Author

joccau commented Mar 29, 2023

/retest

@joccau
Copy link
Contributor Author

joccau commented Mar 29, 2023

/rebuild

@ti-chi-bot ti-chi-bot merged commit 6f0f814 into tikv:master Mar 29, 2023
5 of 7 checks passed
@ti-chi-bot ti-chi-bot added this to the Pool milestone Mar 29, 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 updating the config tikv.log-backup.max-flush-interval when backuping log
5 participants