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

config: add hot region history configurations #4019

Merged
merged 7 commits into from
Sep 3, 2021

Conversation

qidi1
Copy link
Contributor

@qidi1 qidi1 commented Aug 23, 2021

…onfg

Signed-off-by: qidi1 1083369179@qq.com

What problem does this PR solve?

origin pr is here #3989
This PR is oversize and splited into three small one:

#4019
#4020
#4021

Proposal: pingcap/tidb#27487
Associated PR:tikv/tidb#27224
Associated Issue: pingcap/tidb#25281
pingcap/tidb#27373
pingcap/tidb#27374
pingcap/tidb#27374

What is changed and how it works?

add config for hot_region_storage,add hot_regions_write_interval&hot_regions_remian_days in to config

Check List

Tests

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

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

Please add a release note.

If you don't think this PR needs a release note then fill it with None.

…onfg

Signed-off-by: qidi1 <1083369179@qq.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 23, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • nolouch

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.

@@ -29,3 +29,6 @@ leader-schedule-limit = 32
region-schedule-limit = 128
replica-schedule-limit = 32
merge-schedule-limit = 32
## TODO:Find a better place to put this config
Copy link
Member

Choose a reason for hiding this comment

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

Seem we don't need to add these configurations here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can remove it in simconfig.

HotRegionsWriteInterval typeutil.Duration `toml:"hot-regions-write-interval" json:"hot-regions-write-interval"`

// The day of hot regions data to be reserved.0 means close
HotRegionsResevervedDays int64 `toml:"hot-regions-reserved-days" json:"hot-regions-reserved-days"`
Copy link
Member

Choose a reason for hiding this comment

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

Why not use typeutil.Duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The unit of this is days, does toml support days?

Copy link
Member

Choose a reason for hiding this comment

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

So, the minimum time of reserving the hot regions is 1 day?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,the minimum time of reserving the hot regions is 1 day

Copy link
Member

Choose a reason for hiding this comment

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

What if we just want to keep the history for several hours?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we delete history hot region every 24 hours,if we want reserve several hours,we must change delete function

server/config/config.go Outdated Show resolved Hide resolved
@disksing disksing changed the title config:add hot_regions_write_interval&hot_regions_remian_days in to c… config: add hot region history configurations Aug 23, 2021
conf/config.toml Outdated Show resolved Hide resolved
Signed-off-by: qidi1 <1083369179@qq.com>
conf/simconfig.toml Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #4019 (210ba1b) into master (c43115e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4019      +/-   ##
==========================================
- Coverage   74.53%   74.53%   -0.01%     
==========================================
  Files         258      258              
  Lines       26075    26079       +4     
==========================================
+ Hits        19436    19438       +2     
- Misses       4901     4902       +1     
- Partials     1738     1739       +1     
Flag Coverage Δ
unittests 74.53% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/config/config.go 75.05% <100.00%> (+0.20%) ⬆️
server/schedule/region_scatterer.go 80.70% <0.00%> (-4.39%) ⬇️
server/region_syncer/client.go 77.46% <0.00%> (-4.23%) ⬇️
server/schedulers/shuffle_hot_region.go 53.53% <0.00%> (-2.03%) ⬇️
server/schedule/operator/step.go 67.44% <0.00%> (-1.67%) ⬇️
server/cluster/coordinator.go 72.74% <0.00%> (-0.91%) ⬇️
server/tso/tso.go 61.93% <0.00%> (-0.57%) ⬇️
server/grpc_service.go 47.05% <0.00%> (-0.46%) ⬇️
client/client.go 71.54% <0.00%> (-0.42%) ⬇️
server/server.go 71.58% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c43115e...210ba1b. Read the comment docs.

Signed-off-by: qidi1 <1083369179@qq.com>
Signed-off-by: qidi1 <1083369179@qq.com>
Signed-off-by: qidi1 <1083369179@qq.com>
server/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: qidi1 <1083369179@qq.com>
@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 Sep 3, 2021
@nolouch
Copy link
Contributor

nolouch commented Sep 3, 2021

/merge

@ti-chi-bot
Copy link
Member

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

/run-all-tests

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: d42ac6f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 3, 2021
@ti-chi-bot ti-chi-bot merged commit 2591987 into tikv:master Sep 3, 2021
v01dstar pushed a commit to v01dstar/pd that referenced this pull request Oct 28, 2021
* config:add hot_regions_write_interval&hot_regions_remian_days in to confg

Signed-off-by: qidi1 <1083369179@qq.com>

* change config part

Signed-off-by: qidi1 <1083369179@qq.com>

* config:merge from remote

Signed-off-by: qidi1 <1083369179@qq.com>

* config:remove old code

Signed-off-by: qidi1 <1083369179@qq.com>

* config:change discprtion

Signed-off-by: qidi1 <1083369179@qq.com>

* config:change default

Signed-off-by: qidi1 <1083369179@qq.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
release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants