Skip to content

Make the max expected number of legacy files and max valid rate configurable#2187

Merged
ti-srebot merged 4 commits intopingcap:masterfrom
JaySon-Huang:fix_page_file_duplicated
Jun 18, 2021
Merged

Make the max expected number of legacy files and max valid rate configurable#2187
ti-srebot merged 4 commits intopingcap:masterfrom
JaySon-Huang:fix_page_file_duplicated

Conversation

@JaySon-Huang
Copy link
Contributor

Signed-off-by: JaySon-Huang jayson.hjs@gmail.com

What problem does this PR solve?

Issue Number: related to #2169 , #1552

Problem Summary:
In #1552, we introduce an adaptive aggressive GC strategy for PageStorage. If there are more than 100 legacy files, we will set the gc_max_valid_rate to 1.0 try to compact all PageFiles even if there are no invalid pages inside one PageFile.
It brings some trouble in extreme cases like #2169 more worst and generates more write flow.

What is changed and how it works?

  • Add two (no public) variables dt_page_num_max_expect_legacy_files and dt_page_num_max_gc_valid_rate to make then configurable.
  • Change the default value of gc_max_valid_rate_bound from 1.00 to 0.95
  • Apply those variables for RegionPersister

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

Release note

  • No release note

…gurable

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang JaySon-Huang force-pushed the fix_page_file_duplicated branch from a4455f8 to da40bde Compare June 17, 2021 10:35
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Copy link
Contributor

@flowbehappy flowbehappy 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 18, 2021
@flowbehappy flowbehappy added needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 labels Jun 18, 2021
@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Collaborator

Your auto merge job has been accepted, waiting for:

  • 2173

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 18, 2021
@ti-srebot
Copy link
Collaborator

/run-all-tests

@ti-srebot
Copy link
Collaborator

cherry pick to release-5.0 in PR #2204

@ti-srebot
Copy link
Collaborator

cherry pick to release-5.1 in PR #2205

@JaySon-Huang JaySon-Huang deleted the fix_page_file_duplicated branch June 18, 2021 05:01
@JaySon-Huang JaySon-Huang added the needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 label Jun 18, 2021
@ti-srebot
Copy link
Collaborator

cherry pick to release-4.0 in PR #2206

JaySon-Huang added a commit that referenced this pull request Jun 28, 2021
…gurable (#2187) #2205

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: JaySon <tshent@qq.com>
LittleFall pushed a commit that referenced this pull request Jun 28, 2021
…gurable (#2187) #2205

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: JaySon <tshent@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-4.0 PR which needs to be cherry-picked to release-4.0 needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants