-
Notifications
You must be signed in to change notification settings - Fork 8
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
Only insert hostnames if not present for internal broadcast addrs #455
Only insert hostnames if not present for internal broadcast addrs #455
Conversation
@@ -1398,6 +1398,7 @@ public static void setCrossVpcInternodeCommunication(boolean setting) | |||
conf.cross_vpc_internode_communication_enabled = setting; | |||
} | |||
|
|||
@Deprecated |
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.
Let's file a github issue to remove this entirely at some point?
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 #456
if (DatabaseDescriptor.isCrossVpcIpSwappingEnabled() && privatePublicIpMappings.containsKey(proposedAddress)) { | ||
return maybeSwapIp(endpoint); | ||
if (DatabaseDescriptor.isCrossVpcHostnameSwappingEnabled() && privateIpToHostname.containsKey(proposedAddress)) { | ||
return maybeInsertHostname(endpoint); |
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: {
should be on the next line
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.
Same thing on a couple other places in this class
We discovered that two hostnames in a separate VPC can resolve to the same proxy IP and we were mistakenly swapping them, since we were tracking proxy/public IPs as well as private/broadcast addresses.
This PR rips out some direct IP-mapping logic, as it was quite convoluted, and focuses on hostname-related mapping only.
We now only track internal IP / broadcast address -> hostname, and will only update the endpoint we are trying to hit if the InetAddress does not contain a hostname, or has a hostname + endpoint which is from the other VPC (and therefore in our map).
If there is a hostname + we do not have the IP in the map, it must be a "public" / proxy IP, so we should leave the InetAddress as-is.
example:
For a node in another VPC hostA with broadcast address 10.100.0.1 that resolves to 10.9.0.1, 10.9.0.2, and 10.9.0.3 in the other VPC, you could have the following: