Skip to content

raftstore:Fix append log entry oom#12247

Merged
ti-chi-bot merged 15 commits intotikv:masterfrom
tier-cap:fix-append-log-entry-oom
Mar 30, 2022
Merged

raftstore:Fix append log entry oom#12247
ti-chi-bot merged 15 commits intotikv:masterfrom
tier-cap:fix-append-log-entry-oom

Conversation

@tier-cap
Copy link
Collaborator

@tier-cap tier-cap commented Mar 23, 2022

What is changed and how it works?

Issue Number: Close #11598
Close #11379
Close #12107
What's Changed:

when memory usage is high water, add flow control on the append log entries.
disable log entry cache evict functions.

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

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

support append log flow control when memory usage high water to avoid oom.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 23, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 5kbpers
  • innerr

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.

Details

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

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. contribution This PR is from a community contributor. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 23, 2022
@tier-cap tier-cap requested review from 5kbpers and NingLin-P March 24, 2022 08:53
@5kbpers
Copy link
Member

5kbpers commented Mar 24, 2022

Could you open an issue and illustrate the problem this PR solved and the effect of this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe warn is better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator Author

@tier-cap tier-cap Mar 30, 2022

Choose a reason for hiding this comment

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

Changed to debug based on discussion comments with @5kbpers
Compared to metrics monitoring, the log does not have any other useful information.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks weird...

close tikv#11598
close tikv#11379

Signed-off-by: tier-cap <zhengxiaojin@pingcap.com>
@tier-cap tier-cap force-pushed the fix-append-log-entry-oom branch 3 times, most recently from 659723e to c255cd4 Compare March 24, 2022 13:44
Copy link
Contributor

@innerr innerr left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 25, 2022
@tier-cap
Copy link
Collaborator Author

Could you open an issue and illustrate the problem this PR solved and the effect of this PR?

Can refer to #11598

Copy link
Member

@5kbpers 5kbpers 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

Copy link
Member

Choose a reason for hiding this comment

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

Will this log be too verbose when memory usage is high?

Copy link
Member

@5kbpers 5kbpers Mar 29, 2022

Choose a reason for hiding this comment

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

And better to add a metric for the size of rejected messages

Copy link
Collaborator Author

@tier-cap tier-cap Mar 29, 2022

Choose a reason for hiding this comment

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

  1. Yes, we have a raft message reject metrics in handle_raft_message.
  2. If reject once, the leader will not send any log append to this peer until next heartbeat response received. The rate of heartbeat is 1s as default. So warning log may be not too much.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to debug based on discussion comments

close tikv#12107

Signed-off-by: tier-cap <zhengxiaojin@pingcap.com>
@tier-cap tier-cap force-pushed the fix-append-log-entry-oom branch from c255cd4 to 0c21919 Compare March 30, 2022 03:49
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 30, 2022
@5kbpers
Copy link
Member

5kbpers commented Mar 30, 2022

/merge

@ti-chi-bot
Copy link
Member

@5kbpers: 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.

Details

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.

DetailsCommit hash: 0c21919

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 30, 2022
@ti-chi-bot
Copy link
Member

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

At the same time I will also trigger all tests for you:

/run-all-tests

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.

Details

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 merged commit 6c67b11 into tikv:master Mar 30, 2022
CalvinNeo pushed a commit to CalvinNeo/tidb-engine-ext that referenced this pull request May 16, 2022
close tikv#11379, close tikv#11598, close tikv#12107

when memory usage is high water, add flow control on the append log entries.
disable log entry cache evict functions.

Signed-off-by: tier-cap <zhengxiaojin@pingcap.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo CalvinNeo mentioned this pull request May 16, 2022
12 tasks
CalvinNeo pushed a commit to pingcap/tidb-engine-ext that referenced this pull request Aug 2, 2022
close tikv#11379, close tikv#11598, close tikv#12107

when memory usage is high water, add flow control on the append log entries.
disable log entry cache evict functions.

Signed-off-by: tier-cap <zhengxiaojin@pingcap.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

4 participants