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
[HZ-581] Address issues with hostnames #20014
Merged
ramizdundar
merged 86 commits into
hazelcast:master
from
ufukyilmaz:5.1/hostname-fix-part-1
Jan 11, 2022
Merged
Changes from 78 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
4a05f70
WIP - Handle TcpServerConnections with UUID
f8595d3
WIP - Adjust test classes
0215da4
WIP
3f43451
Update the Node#thisUuid in cluster service reset
40bcf59
Do more proper null handling in mock network classes
fbcaf94
Tidy up handshake processing
898209b
Add member uuid into MockServerContext
46f5afd
Register/deregister address-uuid entries upon membership changes
f5820d9
Small cleanup
c3d74a6
Fix style
f48d286
Tidy up LinkedAddresses and LocalAddressRegistry
e384c90
Handle uuid-address registration for the client connections
8c60b97
Fix style
3232a1e
Cleanup
c8b0256
Reflect the changes to TcpServerControlTest
d60fd90
Remove address registration stuff from MembershipManager
1dc1127
Fix style
c67a0f3
Reset address registry on split-brain-merge
vbekiaris 8b31af4
Change the address registry removal timing
3f00596
Handle duplicate connections between members
940b8c3
Fix style
3b35445
Add some tests for address registry
226bb0f
Enhance TcpServerControlTest
34987a2
Add javadoc and more tests to the address registry
601c02b
Add tests
dcbe5ae
Add local member's addresses to the address registry
3800be9
Use public address as a primary address in any case
88ba1ce
Do address registrations in ConnectionManager#register
57a2eba
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
4e24b37
Remove LocalAddressRegistry#getPrimaryAddress(Address)
7aa1f7a
Perform address registration in MockNetwork
20152e1
Add all local addresses to address registry
5e9e2da
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
33cdc0f
Handle local addresses separately in LocalAddressRegistry
815e993
Fix shouldConnectTo
fa5af7f
Fix up Handle local addresses separately in LocalAddressRegistry
20c2b73
Fix NPE in mock tests
dcdd5bb
Resolve the given address before perform lookup
4d09104
Add javadocs to address picker methods
7382ecc
Give explicit priority to the member protocol public address in addre…
ab3b931
Fix TcpIpJoiner#isLocalAddress
828d47a
Improve logging on blacklist
e114bb1
Handle blacklisted addresses in ClusterMismatchOp
7d20c8c
Fix style
70c7370
Fix local address registration issue
6070012
Add TcpIpHostnameJoinTest
5134a4e
Add trace logs to hostname join tests
da4ca54
Add null check to serverSocketChannel access
b9ba29d
Try not to lose targetAddress of the connection
a604e91
Address part of the reviews
03106c8
Add null check to registered target address
4db748c
Handle duplicate connections after addresses registered
dff3925
Fix isThisNodeMasterCandidate
a06d690
Fix style
ace549c
Adjust the address registry logs
6169f11
Fix tests that include mock logger
8044273
Remove reverse DNS lookup from address resolution
6339821
Fix any local address check
928e681
Make Node#thisUuid private
1c45ac9
Fix minor issues
2855d25
Remove ip address resolution from hot path
a2ac119
Improve the javadocs of ServerConnectionManager
a65d437
Do not skip any network interfaces
e142559
Try to handle self connections
b5bbbbf
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
9856887
Handle self connections second attempt
c36a8fa
Handle error cases inside connection registration
e369dff
Revert unnecessary change on join
8910935
Refactor connection manager
71c6482
Address parts of the review
55d88e7
fixup! Address parts of the review
dd70a03
Reduce the number of hostname->ip resolutions
7f3153f
Remove synchronized block from removeConnectionInProgress
95aae26
Fixup
6e0fd77
Fix npe in mock server
6919437
Remove stale todo item
28e10c4
Capture remove connection in progress into synchronized block
ea1ead2
Improve duplicate connection handling
f508686
Fix TcpIpJoiner#searchForOtherClusters
2d28144
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
aff02d3
Revert connection in progress handling
5f5c6c3
Remove duplicate connections handling
a068eb6
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
0b0caad
Remove one unnecessary LocalAddressRegistry#uuidOf call
6825d69
Adapt address registry integration test to duplicate conns
1860672
Merge remote-tracking branch 'upstream/master' into 5.1/hostname-fix-…
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,8 +53,28 @@ public interface AddressPicker { | |
*/ | ||
Address getPublicAddress(EndpointQualifier qualifier); | ||
|
||
/** | ||
* Returns all public {@link Address}es of this member which are advertised to other | ||
* members, mapped by corresponding {@link EndpointQualifier}. Also, see | ||
* {@link com.hazelcast.internal.cluster.impl.MemberHandshake} and | ||
* {@link com.hazelcast.internal.server.tcp.SendMemberHandshakeTask}. | ||
* | ||
* @return a {@code Map<EndpointQualifier, Address>} of this member's public addresses | ||
* or an empty map if called before {@link #pickAddress()} | ||
* @since 3.12 | ||
*/ | ||
Map<EndpointQualifier, Address> getPublicAddressMap(); | ||
|
||
/** | ||
* Returns all bound server socket {@link Address}es of this member, mapped by | ||
* corresponding {@link EndpointQualifier} | ||
* | ||
* @return a {@code Map<EndpointQualifier, Address>} of the bound addresses of | ||
* this member's server sockets or an empty map if called before {@link #pickAddress()} | ||
* @since 5.1 | ||
*/ | ||
Map<EndpointQualifier, Address> getBindAddressMap(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add the javadoc (and also fill the missing one in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added related javadocs. |
||
|
||
/** | ||
* Returns a server channel. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
in which case can
endpoint.getUuid()
benull
?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 have this value after the client endpoint is authenticated, it has no chance of being null in the production code. But if the some staff is mocked, it can be.