Skip to content

implement GlobalConfig for grpc server and client #4308

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

Merged
merged 6 commits into from
Dec 14, 2021

Conversation

LemonHX
Copy link
Contributor

@LemonHX LemonHX commented Nov 8, 2021

Signed-off-by: lemonhx lemonhx@lemonhx.tech

What problem does this PR solve?

previously we have discussions about adding global config into PD and store in etcd for easier to maintain the config and for the ease of usage of all components such as tikv tidb and tiflash

What is changed and how it works?

adding three functions into kvproto for loading ,storing and watching the global config, and implement it for etcd

Check List

  • does load information from etcd
  • does write information into etcd
  • does listen the prefix /global/config correctly

Tests

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

Side effects

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

Related changes

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 8, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • rleungx

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/invalid-commit-message 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 Nov 8, 2021
@LemonHX LemonHX force-pushed the master branch 2 times, most recently from 79fd130 to b479935 Compare November 9, 2021 07:13
@ti-chi-bot ti-chi-bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 9, 2021
@rleungx
Copy link
Member

rleungx commented Nov 11, 2021

Is there any tracking issue?

@LemonHX LemonHX force-pushed the master branch 2 times, most recently from e9ada08 to 06e954a Compare November 12, 2021 05:41
@crazycs520
Copy link
Contributor

@rleungx PTAL

@LemonHX
Copy link
Contributor Author

LemonHX commented Nov 17, 2021

PTAL

@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #4308 (1d21648) into master (b267249) will decrease coverage by 0.23%.
The diff coverage is 75.26%.

❗ Current head 1d21648 differs from pull request most recent head f302403. Consider uploading reports for the commit f302403 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4308      +/-   ##
==========================================
- Coverage   75.05%   74.81%   -0.24%     
==========================================
  Files         263      263              
  Lines       27696    27789      +93     
==========================================
+ Hits        20786    20791       +5     
- Misses       5085     5141      +56     
- Partials     1825     1857      +32     
Flag Coverage Δ
unittests 74.81% <75.26%> (-0.24%) ⬇️

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

Impacted Files Coverage Δ
server/server.go 72.50% <0.00%> (+0.04%) ⬆️
client/client.go 72.89% <75.55%> (+0.36%) ⬆️
server/grpc_service.go 51.78% <76.59%> (+1.07%) ⬆️
pkg/tempurl/tempurl.go 45.00% <0.00%> (-15.00%) ⬇️
server/schedulers/shuffle_hot_region.go 55.55% <0.00%> (-10.11%) ⬇️
server/tso/local_allocator.go 64.86% <0.00%> (-6.76%) ⬇️
server/id/id.go 76.19% <0.00%> (-4.77%) ⬇️
server/tso/allocator_manager.go 63.33% <0.00%> (-4.67%) ⬇️
server/tso/tso.go 63.63% <0.00%> (-3.98%) ⬇️
server/election/leadership.go 77.31% <0.00%> (-3.10%) ⬇️
... and 12 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 5211ada...f302403. Read the comment docs.

@JmPotato
Copy link
Member

I think we better create an issue or doc to talk about the need and design first.

rename variable `receiver` into
`globalConfigWatcherCH` due to it cause ambiguity of variable meaning

Signed-off-by: lemonhx <lemonhx@lemonhx.tech>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2021
@rleungx
Copy link
Member

rleungx commented Dec 13, 2021

PTAL @JmPotato

Signed-off-by: lemonhx <lemonhx@lemonhx.tech>
@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 Dec 13, 2021
@JmPotato
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@JmPotato: 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: 1d21648

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 13, 2021
@JmPotato
Copy link
Member

/rebuild

@JmPotato
Copy link
Member

/rebuild

@crazycs520
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@crazycs520: 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

@crazycs520: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

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 ti-chi-bot merged commit 3c626f2 into tikv:master Dec 14, 2021
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this pull request Dec 28, 2021
* add `global_config` for grpc server and client
dummy implement `SplitAndScatterRegions` and modify the kv proto deps for build
batch send and store globalconfig by using transaction

close tikv#4443

Co-authored-by: crazycs <crazycs520@gmail.com>
Signed-off-by: lemonhx <lemonhx@lemonhx.tech>

* remove unsafe code from global config test
rearrange code from global config client

Signed-off-by: lemonhx <lemonhx@lemonhx.tech>

* check transaction response in store

rename variable `receiver` into
`globalConfigWatcherCH` due to it cause ambiguity of variable meaning

Signed-off-by: lemonhx <lemonhx@lemonhx.tech>

* merged kvproto

Signed-off-by: lemonhx <lemonhx@lemonhx.tech>

Co-authored-by: crazycs <crazycs520@gmail.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
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