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

tools: fix the inconsistency of available space #5670

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Nov 2, 2022

Signed-off-by: Ryan Leung rleungx@gmail.com

What problem does this PR solve?

Issue Number: Ref #5468

What is changed and how does it work?

Prevent the following situation from happening.

Screen Shot 2022-11-03 at 3 06 20 PM

Check List

Tests

  • Manual test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • lhy1024

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 do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 2, 2022
@ti-chi-bot ti-chi-bot requested review from lhy1024 and nolouch November 2, 2022 10:51
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Base: 75.82% // Head: 75.82% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (9b162a3) compared to base (fcfcda3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5670   +/-   ##
=======================================
  Coverage   75.82%   75.82%           
=======================================
  Files         329      329           
  Lines       32682    32683    +1     
=======================================
+ Hits        24781    24783    +2     
  Misses       5781     5781           
+ Partials     2120     2119    -1     
Flag Coverage Δ
unittests 75.82% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
server/schedulers/hot_region.go 85.03% <100.00%> (+0.01%) ⬆️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
pkg/metricutil/metricutil.go 82.75% <0.00%> (-10.35%) ⬇️
server/storage/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/tso/allocator_manager.go 64.51% <0.00%> (-3.07%) ⬇️
pkg/dashboard/adapter/manager.go 79.31% <0.00%> (-2.30%) ⬇️
server/region_syncer/server.go 86.26% <0.00%> (-1.10%) ⬇️
server/storage/hot_region_storage.go 78.14% <0.00%> (-1.10%) ⬇️
server/region_syncer/client.go 85.82% <0.00%> (-0.75%) ⬇️
server/tso/tso.go 70.78% <0.00%> (-0.57%) ⬇️
... and 18 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rleungx rleungx changed the title *: fix the conflict of available tools: fix the conflict of available Nov 3, 2022
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 3, 2022
@rleungx rleungx marked this pull request as ready for review November 3, 2022 02:45
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 3, 2022
@rleungx rleungx changed the title tools: fix the conflict of available tools: fix the inconsistency of available space Nov 3, 2022
ID: uint64(i),
Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Version: "2.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to change the version in master?plz,see @lhy1024

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can do it in another pr #5672

ID: id,
Status: metapb.StoreState_Up,
Capacity: 1000 * units.GiB,
Version: "2.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

how about remove this Version?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's necessary.

@bufferflies
Copy link
Contributor

BTW, I think it's very nice to use config file to describe our loads not hard code. And the store status can be remvoed from the case like state, available ,version .

Copy link
Contributor

@bufferflies bufferflies 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

ID: id,
Status: metapb.StoreState_Up,
Capacity: 1000 * units.GiB,
Version: "2.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's necessary.

ID: IDAllocator.nextID(),
Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Available: 980 * units.GiB,
Copy link
Contributor

Choose a reason for hiding this comment

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

we still need different Available, 980 * units.GiB and 1 * units.TiB

Copy link
Member Author

Choose a reason for hiding this comment

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

Does this case still work? I test it and there are only balance leader operator.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, I think this can be solved through redistributing regions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we need to use different used size?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can put ExtraUsedSpace put into case to update store status

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can put ExtraUsedSpace put into case to update store status

I think so.

Copy link
Member Author

Choose a reason for hiding this comment

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

I plan to simplify the case because we need to recompile it every time. Currently, it can also be done by using ExtraUsedSpace in the config file.

Copy link
Contributor

Choose a reason for hiding this comment

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

If so, I think we should provide default value

ID: uint64(i),
Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Version: "2.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can do it in another pr #5672

ID: IDAllocator.nextID(),
Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Available: 980 * units.GiB,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we need to use different used size?

Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Available: 900 * units.GiB,
Version: "2.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need some test to ensure release version is available for these cases

Copy link
Member Author

Choose a reason for hiding this comment

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

The store version can be configured through config file.

Copy link
Contributor

Choose a reason for hiding this comment

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

whar is its default version

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 11, 2022
Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

the rest LGTM

@rleungx rleungx requested a review from lhy1024 November 14, 2022 02:48
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
ID: IDAllocator.nextID(),
Status: metapb.StoreState_Up,
Capacity: 1 * units.TiB,
Available: 980 * units.GiB,
Copy link
Contributor

Choose a reason for hiding this comment

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

If so, I think we should provide default value

@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 Nov 14, 2022
@rleungx
Copy link
Member Author

rleungx commented Nov 14, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: 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: 9b162a3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 14, 2022
@ti-chi-bot ti-chi-bot merged commit e6eef7c into tikv:master Nov 14, 2022
@rleungx rleungx deleted the available branch November 14, 2022 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. 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