Skip to content

Conversation

@mdumandag
Copy link
Contributor

@mdumandag mdumandag commented Sep 7, 2021

This PR implements the client-side support for the external smart
client discovery. With this PR, the Python client will be able
to use public addresses reported by the cluster members even
if the client and the cluster are in different networks.

To use it, one has to enable use_public_addresses option by setting
it to True, and passing at least one public address of the cluster
members to the cluster_members config. Client will initiate the
cluster connection using the provided public address, and will
discover the rest of the cluster using the public addresses reported
by them.

Protocol PR: hazelcast/hazelcast-client-protocol#394

This PR implements the client-side support for the external smart
client discovery. With this PR, the Python client will be able
to use public addresses reported by the cluster members even
if the client and the cluster are in different networks.

To use it, one has to enable `use_public_addresses` option by setting
it to `True`, and passing at least one public address of the cluster
members to the `cluster_members` config. Client will initiate the
cluster connection using the provided public address, and will
discover the rest of the cluster using the public addresses reported
by them.
@mdumandag
Copy link
Contributor Author

Ali did the tests on Kubernetes on GKE with this branch, and the tests are passed.

Here is the link to his verification: https://github.com/alisengul53/GHActionTestRepo/runs/3542770380?check_suite_focus=true

Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

I started to review tests. Just wanted to send the reviews so far..

@yuce
Copy link
Contributor

yuce commented Sep 11, 2021

@mdumandag The Java client property that enables this feature is hazelcast.discovery.public.ip.enabled: https://hazelcast.atlassian.net/wiki/spaces/IMDG/pages/2689663054/External+Smart+Client+discovery+via+LoadBalancer+TDD I've also used config.Cluster.Discovery.UsePublicIP in the Go client. So, would it make sense to use something similar in the Python client as well?

@mdumandag
Copy link
Contributor Author

@yuce I changed it to use_public_ip to match with others. WDYT?

At first, I used use_public_addresses because it sounded better to me but I really don't have any strong opinions about it.

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2021

Codecov Report

Merging #468 (e22a08e) into master (0d1cc31) will decrease coverage by 0.10%.
The diff coverage is 89.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #468      +/-   ##
==========================================
- Coverage   94.96%   94.86%   -0.11%     
==========================================
  Files         345      345              
  Lines       17633    17685      +52     
==========================================
+ Hits        16745    16776      +31     
- Misses        888      909      +21     
Impacted Files Coverage Δ
hazelcast/client.py 99.54% <ø> (ø)
hazelcast/protocol/__init__.py 94.73% <ø> (-0.27%) ⬇️
hazelcast/core.py 92.52% <85.71%> (-1.96%) ⬇️
hazelcast/cluster.py 90.44% <87.50%> (-0.14%) ⬇️
hazelcast/connection.py 91.88% <90.90%> (-0.77%) ⬇️
hazelcast/config.py 99.38% <100.00%> (+<0.01%) ⬆️
.../protocol/codec/custom/endpoint_qualifier_codec.py 73.07% <100.00%> (ø)
hazelcast/proxy/reliable_topic.py 95.40% <100.00%> (+0.01%) ⬆️
...otocol/codec/client_authentication_custom_codec.py 50.00% <0.00%> (-23.81%) ⬇️
hazelcast/reactor.py 81.79% <0.00%> (-8.26%) ⬇️
... and 5 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 0d1cc31...e22a08e. Read the comment docs.

Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

I left one last additional comment in one of the previous review comments. Thanks for your patience and changes.

@yuce
Copy link
Contributor

yuce commented Sep 13, 2021

@mdumandag Thanks. I agree that address would be better. Not sure why the core/Java client property uses ip...

@mdumandag mdumandag merged commit d91ba71 into hazelcast:master Sep 15, 2021
@mdumandag mdumandag deleted the external-client-discovery branch September 15, 2021 08:28
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.

4 participants