Skip to content

Conversation

@sunxiaoguang
Copy link
Member

Signed-off-by: Xiaoguang Sun sunxiaoguang@zhihu.com

What problem does this PR solve?

Pass in more meta data so ReplicaSelector can make better decision at runtime

What is changed and how it works?

Pass in more meta data so ReplicaSelector can make better decision at runtime

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has interface methods change

Side effects

  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to update the documentation
  • Need to be included in the release note

@sunxiaoguang sunxiaoguang changed the title Support select replica with rich meta data [DNM] Support select replica with rich meta data May 19, 2021
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
@sunxiaoguang sunxiaoguang force-pushed the rich_replica_select branch from 353571f to bfca20b Compare May 19, 2021 09:36
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
@sunxiaoguang sunxiaoguang changed the title [DNM] Support select replica with rich meta data Support select replica with rich meta data Jun 12, 2021
@sunxiaoguang
Copy link
Member Author

sunxiaoguang commented Jun 12, 2021

Please be aware, In addition to implement feature requested in issue #193, there is an extra change to support custom HostMapping implementation to make it possible to map cluster local names in K8S cluster into global names that are accessible out side of K8S cluster.

@sunxiaoguang
Copy link
Member Author

sunxiaoguang commented Jun 12, 2021

Please be aware, In addition to implement feature requested in issue #193, there is an extra change to support custom HostMapping implementation to make it possible to map cluster local names in K8S cluster into global names that are accessible out side of K8S cluster.

There is an example of HostMapping implementation here: https://github.com/tidb-incubator/TiBigData/blob/662469a66ab951fcdf557ab461fceaa90a27b595/tidb/src/main/java/io/tidb/bigdata/tidb/DnsSearchHostMapping.java

@sunxiaoguang
Copy link
Member Author

sunxiaoguang commented Jun 13, 2021

Changes to ReplicaSelector interface made this PR binary incompatible with existing code. Even though I doubt if this feature was actually used anywhere, we can still support the old interface by some extra amount of work. Would like to hear feedbacks.

Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

@marsishandsome
Copy link
Collaborator

/run-all-tests

@marsishandsome marsishandsome requested a review from birdstorm June 15, 2021 02:52
@marsishandsome
Copy link
Collaborator

@sunxiaoguang test failed.

[2021-06-15T02:53:55.007Z] [ERROR] /home/jenkins/agent/git/client-java/src/test/java/org/tikv/common/MockServerTest.java:[32,13] cannot find symbol

[2021-06-15T02:53:55.007Z]   symbol:   method of(org.tikv.kvproto.Metapb.Store)

[2021-06-15T02:53:55.007Z]   location: interface java.util.List

@sunxiaoguang
Copy link
Member Author

@sunxiaoguang test failed.

[2021-06-15T02:53:55.007Z] [ERROR] /home/jenkins/agent/git/client-java/src/test/java/org/tikv/common/MockServerTest.java:[32,13] cannot find symbol

[2021-06-15T02:53:55.007Z]   symbol:   method of(org.tikv.kvproto.Metapb.Store)

[2021-06-15T02:53:55.007Z]   location: interface java.util.List

Sure, let me fix it.

Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
@sunxiaoguang
Copy link
Member Author

/run-all-tests

2 similar comments
@sunxiaoguang
Copy link
Member Author

/run-all-tests

@sunxiaoguang
Copy link
Member Author

/run-all-tests

Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
@sunxiaoguang
Copy link
Member Author

/run-all-tests

Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@birdstorm birdstorm left a comment

Choose a reason for hiding this comment

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

LGTM

@sunxiaoguang
Copy link
Member Author

/merge

@ti-srebot
Copy link
Collaborator

/run-all-tests

@ti-srebot ti-srebot merged commit fe6617e into tikv:master Jun 23, 2021
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Jun 30, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator

cherry pick to release-3.1 in PR #225

birdstorm added a commit that referenced this pull request Jun 30, 2021
* cherry pick #171 to release-3.1

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

* fix test

Signed-off-by: birdstorm <samuelwyf@hotmail.com>

Co-authored-by: Xiaoguang Sun <sunxiaoguang@users.noreply.github.com>
Co-authored-by: birdstorm <samuelwyf@hotmail.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.

5 participants