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 store labels #3784

Merged
merged 10 commits into from Feb 25, 2021
Merged

add store labels #3784

merged 10 commits into from Feb 25, 2021

Conversation

L3T
Copy link
Contributor

@L3T L3T commented Feb 5, 2021

What problem does this PR solve?

Fix #3783

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

Support setting customized store labels according to the node labels

L3T and others added 4 commits February 23, 2021 16:12
@DanielZhangQD
Copy link
Contributor

@L3T Could you please fix the CI and update the test result in the PR description?

@codecov-io
Copy link

codecov-io commented Feb 24, 2021

Codecov Report

Merging #3784 (cd5caca) into master (ff03e86) will not change coverage.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##           master    #3784   +/-   ##
=======================================
  Coverage   62.35%   62.35%           
=======================================
  Files         169      169           
  Lines       17962    17962           
=======================================
  Hits        11200    11200           
  Misses       5677     5677           
  Partials     1085     1085           
Flag Coverage Δ
unittest 62.35% <66.66%> (?)

@DanielZhangQD
Copy link
Contributor

/run-all-tests

@DanielZhangQD
Copy link
Contributor

@L3T Please fix the CI.

@DanielZhangQD
Copy link
Contributor

/run-all-tests

@DanielZhangQD
Copy link
Contributor

/run-all-tests

@L3T
Copy link
Contributor Author

L3T commented Feb 24, 2021

手动进行测试,更新 crd 以及 operator 版本到本分支
为 tikv 添加
storeLabels:
- testLabel
观察 operator 日志
image
为 tikv-0 tikv-1 所在节点添加 testLabel:x label
观察operator 日志
image

观察 store 状态
image

观察operator确认设置成功后没有重复设置
image

@DanielZhangQD
Copy link
Contributor

@L3T There is not location labels in the test result, could you please verify the case including the location labels and customized labels?

Copy link
Contributor

@DanielZhangQD DanielZhangQD left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -816,8 +816,8 @@ func (m *tikvMemberManager) setStoreLabelsForTiKV(tc *v1alpha1.TidbCluster) (int
return setCount, err
}

locationLabels := []string(config.Replication.LocationLabels)
if locationLabels == nil {
storeLabels := append(config.Replication.LocationLabels, tc.Spec.TiKV.StoreLabels...)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if there are some duplicated labels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里重复的话,下面逻辑都是根据 storeLabels 对 map 赋值,所以对下面逻辑不会有影响,改了还要多几行代码(,这里就不改了吧(

@L3T
Copy link
Contributor Author

L3T commented Feb 25, 2021

添加 host location_labels
image
观察 store label
image
能争取设置 store labels 和 location labels

@lonng
Copy link
Contributor

lonng commented Feb 25, 2021

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • DanielZhangQD
  • lonng

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@DanielZhangQD
Copy link
Contributor

/run-all-tests

@DanielZhangQD
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: cd5caca

@ti-chi-bot ti-chi-bot merged commit a3b0e6c into pingcap:master Feb 25, 2021
ti-srebot pushed a commit to ti-srebot/tidb-operator that referenced this pull request Feb 25, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot mentioned this pull request Feb 25, 2021
10 tasks
@ti-srebot
Copy link
Contributor

cherry pick to release-1.1 in PR #3813

ti-chi-bot added a commit that referenced this pull request Feb 25, 2021
* cherry pick #3784 to release-1.1

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* resolve conflict

Co-authored-by: zyy <zhangyunyu@zhihu.com>
Co-authored-by: DanielZhangQD <zhanghailong810@aliyun.com>
Co-authored-by: Ti Chi Robot <71242396+ti-chi-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support adding label to TiKV based on node label
6 participants