Skip to content

config: add region-max-size property #4635

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

Closed

Conversation

bufferflies
Copy link
Contributor

Signed-off-by: bufferflies 1045931706@qq.com

What problem does this PR solve?

Issue Number: Close #4459

What is changed and how it works?

config.PersistOptions should save the initial config and not update it .

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

Release note

config adds`region-max-size ` property 

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

[REVIEW NOTIFICATION]

This pull request has not been approved.

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.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 11, 2022
@rleungx
Copy link
Member

rleungx commented Feb 11, 2022

Please add a unit test to check if changing the parameter in the config file works.

Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2022
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch from 4d6f139 to 29a8db6 Compare February 11, 2022 09:43
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #4635 (9b5f342) into master (4b6f00c) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4635      +/-   ##
==========================================
- Coverage   74.75%   74.70%   -0.06%     
==========================================
  Files         284      285       +1     
  Lines       27816    27835      +19     
==========================================
  Hits        20795    20795              
- Misses       5149     5160      +11     
- Partials     1872     1880       +8     
Flag Coverage Δ
unittests 74.70% <100.00%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
pkg/mock/mockcluster/mockcluster.go 94.98% <100.00%> (+0.02%) ⬆️
server/cluster/cluster.go 84.82% <100.00%> (+0.44%) ⬆️
server/config/config.go 77.94% <100.00%> (+0.09%) ⬆️
server/config/immutable_options.go 100.00% <100.00%> (ø)
server/config/util.go 87.50% <100.00%> (+1.29%) ⬆️
server/schedule/checker/merge_checker.go 74.40% <100.00%> (+0.84%) ⬆️
server/server.go 74.87% <100.00%> (-0.29%) ⬇️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/tso/tso.go 62.50% <0.00%> (-2.85%) ⬇️
server/storage/hot_region_storage.go 79.88% <0.00%> (-2.30%) ⬇️
... and 14 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 4b6f00c...9b5f342. Read the comment docs.

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch from 29a8db6 to f9df236 Compare February 11, 2022 09:50
@bufferflies bufferflies requested a review from rleungx February 18, 2022 08:35
@nolouch
Copy link
Contributor

nolouch commented Feb 22, 2022

How this config influence the TiKV?

IDAllocator: mockid.NewIDAllocator(),
HotStat: statistics.NewHotStat(ctx),
PersistOptions: opts,
ImmutableConfig: config.NewTestImmutableOptions(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Does immutable means that it cannot be updated by pd-ctl?

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, pd will reload config after restarting.

@@ -78,6 +80,11 @@ func (mc *Cluster) GetOpts() *config.PersistOptions {
return mc.PersistOptions
}

// GetConfig returns the cluster immutable configuration.
func (mc *Cluster) GetConfig() *config.ImmutableConfig {
Copy link
Member

Choose a reason for hiding this comment

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

Prefer to change the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix to GetImmutableCfg

// ImmutableConfig is a readonly config.
type ImmutableConfig struct {
maxRegionSize uint64
leaderLease int64
Copy link
Member

Choose a reason for hiding this comment

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

Why only leaderLease?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leaderLease will be remove and add max-split-size.

@bufferflies
Copy link
Contributor Author

How this config influence the TiKV?

the configuration will not influence the TiKVs, maybe can consider this pr:#4308

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch 2 times, most recently from 0471d73 to 41f7f79 Compare February 23, 2022 11:22
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch 3 times, most recently from 3a01315 to 2fbeb24 Compare February 24, 2022 08:58
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch from 2fbeb24 to 3dcf9e1 Compare February 24, 2022 09:10
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2022
Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2022
Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies bufferflies force-pushed the feature/add-region-max-size branch from 0cdd667 to dc5f07a Compare February 24, 2022 09:27
@bufferflies
Copy link
Contributor Author

It is not graceful to add some tikv config into the config file, so I will use call back tikv to get this config.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sync tikv config
5 participants