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

api: add api for querying replication state for regions in the given key ranges #4215

Merged
merged 2 commits into from
Oct 27, 2021
Merged

Conversation

xhebox
Copy link
Contributor

@xhebox xhebox commented Oct 18, 2021

Signed-off-by: xhe xw897002528@gmail.com

What problem does this PR solve?

close #4241

need an exposed api to check if regions or bundles are replicated.

What is changed and how it works?

I choose to make an api that will return the replicated state for regions in the given key ranges. It is added as /regions/replicated?startKey=xx&endKey=xx.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

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

Release note

Add new api that returns the replication state of regions in the given key ranges

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Oct 18, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bufferflies
  • disksing

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 the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 18, 2021
@xhebox xhebox marked this pull request as draft October 18, 2021 04:36
@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 18, 2021
@xhebox xhebox changed the title api: add health api for rule-group api: add api for querying replication state for regions in the given key ranges Oct 18, 2021
@xhebox xhebox marked this pull request as ready for review October 20, 2021 06:21
@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 Oct 20, 2021
@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #4215 (0d76271) into master (ef9eb0c) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4215      +/-   ##
==========================================
+ Coverage   74.84%   74.96%   +0.12%     
==========================================
  Files         260      260              
  Lines       26747    26766      +19     
==========================================
+ Hits        20019    20066      +47     
+ Misses       4951     4932      -19     
+ Partials     1777     1768       -9     
Flag Coverage Δ
unittests 74.96% <100.00%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
server/api/region.go 67.86% <100.00%> (+1.55%) ⬆️
server/api/router.go 97.32% <100.00%> (+0.01%) ⬆️
server/region_syncer/server.go 83.08% <0.00%> (-5.89%) ⬇️
server/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/id/id.go 76.19% <0.00%> (-4.77%) ⬇️
server/schedulers/random_merge.go 60.00% <0.00%> (-3.34%) ⬇️
server/election/leadership.go 77.31% <0.00%> (-3.10%) ⬇️
pkg/dashboard/adapter/manager.go 82.97% <0.00%> (-2.13%) ⬇️
pkg/btree/btree.go 85.78% <0.00%> (-0.97%) ⬇️
server/server.go 71.40% <0.00%> (-0.90%) ⬇️
... and 11 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 ef9eb0c...0d76271. Read the comment docs.

@xhebox
Copy link
Contributor Author

xhebox commented Oct 20, 2021

/cc @disking @lhy1024 PTAL, ready for reviewing

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 25, 2021
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.

lgtm

@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 Oct 25, 2021
@xhebox
Copy link
Contributor Author

xhebox commented Oct 25, 2021

@disksing PLZ help merging, the new commit should complete the coverage.

@lhy1024
Copy link
Contributor

lhy1024 commented Oct 25, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: 92eeb61

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 25, 2021
@lhy1024
Copy link
Contributor

lhy1024 commented Oct 25, 2021

plz fix ci

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Oct 26, 2021
@xhebox
Copy link
Contributor Author

xhebox commented Oct 26, 2021

@lhy1024 Fixed :)

@lhy1024
Copy link
Contributor

lhy1024 commented Oct 26, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: 373bd61

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. and removed status/can-merge Indicates a PR has been approved by a committer. labels Oct 26, 2021
close #4241

ref pingcap/tidb#28199

Signed-off-by: xhe <xw897002528@gmail.com>
@xhebox
Copy link
Contributor Author

xhebox commented Oct 26, 2021

/merge

Sorry, plz merge again, fixed invalid commit message error @lhy1024

@disksing
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@disksing: 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: 0d76271

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 27, 2021
@ti-chi-bot ti-chi-bot merged commit 433d4f2 into tikv:master Oct 27, 2021
hzh0425 pushed a commit to hzh0425/pd that referenced this pull request Nov 16, 2021
…key ranges (tikv#4215)

close tikv#4241

ref pingcap/tidb#28199

Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: hzh0425 <642256541@qq.com>
@xhebox xhebox deleted the placement_1 branch December 27, 2021 02:52
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.

add api for querying replication state for regions in the given key ranges
6 participants