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

*: add GetOperator service #1477

Merged
merged 9 commits into from
Apr 8, 2019
Merged

*: add GetOperator service #1477

merged 9 commits into from
Apr 8, 2019

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Mar 25, 2019

What problem does this PR solve?

The lightning needs to know the scatter-region operator whether finished before import data.

What is changed and how it works?

adds a gRPC service.

Check List

Tests

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

nolouch added 3 commits March 23, 2019 13:07
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch nolouch removed the DNM label Apr 3, 2019
@nolouch nolouch requested review from rleungx and disksing April 3, 2019 03:11
@nolouch
Copy link
Contributor Author

nolouch commented Apr 3, 2019

/rebuild

@nolouch nolouch added the needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. label Apr 8, 2019
@nolouch
Copy link
Contributor Author

nolouch commented Apr 8, 2019

PTAL @disksing @rleungx

// NewOperatorRecords returns a OperatorRecords.
func NewOperatorRecords() *OperatorRecords {
return &OperatorRecords{
ttl: cache.NewTTL(time.Minute, 10*time.Minute),
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this parameter configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think no need, just keep for a while.

region = region.Clone(core.WithAddPeer(peer))
case PromoteLearner:
if region.GetStoreLearner(s.ToStore) == nil {
panic("promote peer that doesn't exist")
Copy link
Member

Choose a reason for hiding this comment

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

It will be better to keep the first letter consistent with other panic messages.

@codecov-io
Copy link

codecov-io commented Apr 8, 2019

Codecov Report

Merging #1477 into master will increase coverage by 0.13%.
The diff coverage is 58.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1477      +/-   ##
==========================================
+ Coverage   67.29%   67.43%   +0.13%     
==========================================
  Files         158      158              
  Lines       15465    15518      +53     
==========================================
+ Hits        10407    10464      +57     
- Misses       4108     4113       +5     
+ Partials      950      941       -9
Impacted Files Coverage Δ
server/schedule/operator_kind.go 100% <ø> (ø) ⬆️
server/grpc_service.go 51.22% <4.34%> (-2.54%) ⬇️
server/schedule/mockcluster.go 84.83% <67.56%> (+1.41%) ⬆️
server/schedule/operator_controller.go 92.85% <92.59%> (+1.3%) ⬆️
server/schedule/region_scatterer.go 82.35% <0%> (-5.89%) ⬇️
server/cluster.go 75.6% <0%> (+0.54%) ⬆️
server/schedule/operator.go 86.9% <0%> (+0.63%) ⬆️
server/util.go 72.97% <0%> (+2.7%) ⬆️
server/tso.go 72.72% <0%> (+3.4%) ⬆️
... and 2 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 cffb759...03b6d0f. Read the comment docs.

@nolouch nolouch merged commit 9ad0db5 into tikv:master Apr 8, 2019
@nolouch nolouch deleted the for-lightning branch April 8, 2019 12:39
nolouch added a commit to nolouch/pd that referenced this pull request Apr 22, 2019
* *: add GetOperator service

Signed-off-by: nolouch <nolouch@gmail.com>
nolouch added a commit to nolouch/pd that referenced this pull request Apr 23, 2019
* *: add GetOperator service

Signed-off-by: nolouch <nolouch@gmail.com>
nolouch added a commit that referenced this pull request Apr 23, 2019
* *: add GetOperator service (#1477)
* client: supports scatter region and get operator status (#1501)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants