-
Notifications
You must be signed in to change notification settings - Fork 924
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
[KYUUBI #2644] Add etcd discovery client for HA #2767
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2767 +/- ##
============================================
+ Coverage 50.42% 50.55% +0.13%
Complexity 6 6
============================================
Files 454 455 +1
Lines 25480 25631 +151
Branches 3576 3589 +13
============================================
+ Hits 12848 12959 +111
- Misses 11409 11436 +27
- Partials 1223 1236 +13
Continue to review full report at Codecov.
|
val ns = DiscoveryPaths.makePath(null, namespace) | ||
create(ns, "PERSISTENT") | ||
|
||
val session = conf.get(HA_ZK_ENGINE_REF_ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename this configuration as it is used in both ETCD and ZK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for feedback late, done.
afb980e
to
0680687
Compare
dev/dependencyList
Outdated
@@ -59,6 +68,7 @@ jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar | |||
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar | |||
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar | |||
javassist/3.25.0-GA//javassist-3.25.0-GA.jar | |||
javax.annotation-api/1.3.2//javax.annotation-api-1.3.2.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this, jakarta.annotation-api
is a drop-in replacement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
@@ -87,9 +101,15 @@ metrics-json/4.2.8//metrics-json-4.2.8.jar | |||
metrics-jvm/4.2.8//metrics-jvm-4.2.8.jar | |||
netty-all/4.1.73.Final//netty-all-4.1.73.Final.jar | |||
netty-buffer/4.1.73.Final//netty-buffer-4.1.73.Final.jar | |||
netty-codec-dns/4.1.74.Final//netty-codec-dns-4.1.74.Final.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gRPC uses a shaded netty, why do we need those netty stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gRPC uses a shaded netty, why do we need those netty stuff?
These netty jars are a dependency of jetcd, had try to use netty-shaded, but got ClassNoDefException
. Classes in netty-shaded
have prefix io.grpc
, jetcd can not recognized. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etcd-io/jetcd#1068 seems going to provide an all-in-one client jar then we can get rid of those dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etcd-io/jetcd#1068 seems going to provide an all-in-one client jar then we can get rid of those dependencies.
Yep, we can provide an additional pr to change to shaded jar after it was merged and released
@@ -0,0 +1,3 @@ | |||
io.grpc.internal.PickFirstLoadBalancerProvider | |||
io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider | |||
io.grpc.grpclb.GrpclbLoadBalancerProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What doesn't relocate them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What doesn't relocate them?
Had do this, and got
Caused by: java.lang.IllegalArgumentException: cannot find a NameResolver for ip:///100.71.36.42:2389
at org.apache.kyuubi.shade.io.grpc.internal.ManagedChannelImpl.getNameResolver(ManagedChannelImpl.java:776)
at org.apache.kyuubi.shade.io.grpc.internal.ManagedChannelImpl.getNameResolver(ManagedChannelImpl.java:785)
at org.apache.kyuubi.shade.io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:665)
at org.apache.kyuubi.shade.io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:630)
at org.apache.kyuubi.shade.io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:297)
at org.apache.kyuubi.shade.io.vertx.grpc.VertxChannelBuilder.build(VertxChannelBuilder.java:302)
at io.etcd.jetcd.impl.ClientConnectionManager.getChannel(ClientConnectionManager.java:89)
Although we provide IPResolverProvider
in nameresolverprovider
, NameResolver
can not load IPResolverProvider
, we can relocate them after a solution is found.
@@ -43,7 +43,7 @@ trait DiscoveryClient extends Logging { | |||
/** | |||
* Get the stored data under path. | |||
*/ | |||
def getData(path: String): Array[Byte] | |||
def getData(path: String): String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better avoid changing the API as much as possible.
val pathPrefix = DiscoveryPaths.makePath( | ||
namespace, | ||
s"serviceUri=$instance;version=${version.getOrElse(KYUUBI_VERSION)};${session}sequence=") | ||
val znodeData = instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
znode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,3 @@ | |||
io.grpc.internal.PickFirstLoadBalancerProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license can be added here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license can be added here
Done
@@ -0,0 +1,4 @@ | |||
io.etcd.jetcd.resolver.DnsSrvResolverProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/etcd/EtcdUtils.scala
Outdated
Show resolved
Hide resolved
017cf11
to
aef68b8
Compare
297233a
to
ef0e51c
Compare
@yaooqinn @pan3793 @zwangsheng : Took some time to fix the tests, can review this again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
val conf: KyuubiConf = { | ||
KyuubiConf() | ||
.set(HA_CLIENT_CLASS, classOf[EtcdDiscoveryClient].getName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we describe the option EtcdDiscoveryClient
in the HA_CLIENT_CLASS
docs, after all, ETCD is not mentioned in the docs at present.
.rat-excludes
Outdated
**/io.grpc.LoadBalancerProvider | ||
**/io.grpc.NameResolverProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove them from rat-ex
thanks, merged to master |
Why are the changes needed?
Add etcd discovery client for HA
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request