[
https://issues.apache.org/jira/browse/GEODE-7565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091521#comment-17091521
]
ASF GitHub Bot commented on GEODE-7565:
---------------------------------------
jujoramos commented on a change in pull request #4978:
URL: https://github.com/apache/geode/pull/4978#discussion_r414535620
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/Ping.java
##########
@@ -50,11 +51,17 @@ public void cmdExecute(final Message clientMessage, final
ServerConnection serve
}
if (clientMessage.getNumberOfParts() > 0) {
try {
- DistributedMember targetServer = (DistributedMember)
clientMessage.getPart(0).getObject();
- DistributedMember myID = serverConnection.getCache().getMyId();
+ InternalDistributedMember targetServer =
+ (InternalDistributedMember) clientMessage.getPart(0).getObject();
+ InternalDistributedMember myID = serverConnection.getCache().getMyId();
if (!myID.equals(targetServer)) {
- pingCorrectServer(clientMessage, targetServer, serverConnection);
- writeReply(clientMessage, serverConnection);
+ if (myID.compareTo(targetServer.getMemberIdentifier(), true, false)
== 0) {
Review comment:
The issue described
[here](https://issues.apache.org/jira/browse/GEODE-8004?focusedCommentId=17090468&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17090468)
still remains, you're comparing `myID` (instance of
`InternalDistributedMember`) against `targetServer.getMemberIdentifier()`
(instance of `MemberIdentifier`), so the comparison fails with a
`ClassCastException` and the client logs the following:
```
[warn 2020/04/24 01:33:02.869 PDT <poolTimer-edgeDescript-29> tid=0x112]
Pool unexpected java.lang.ClassCastException: [B cannot be cast to
java.lang.Throwable connection=Pooled Connection to
rs-GEM-2885-0120a0i32xlarge-hydra-client-4:20245: Connection[DESTROYED]).
Server unreachable: could not connect after 1 attempts
```
##########
File path:
geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
##########
@@ -641,4 +641,8 @@ public UUID getUUID() {
public interface HostnameResolver {
InetAddress getInetAddress(ServerLocation location) throws
UnknownHostException;
}
+
+ public MemberIdentifier getMemberIdentifier() {
+ return memberIdentifier;
+ }
Review comment:
You don't need to expose the `MemberIdentifier` here, you can directly
use `InternalDistributedMember.compareTo(DistributedMember o, boolean
compareMemberData, boolean compareViewIds)`, which internally delegates to the
`MemberIdentifier` class.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Wrong management of receivers with same hostname-for-senders
> ------------------------------------------------------------
>
> Key: GEODE-7565
> URL: https://issues.apache.org/jira/browse/GEODE-7565
> Project: Geode
> Issue Type: Improvement
> Components: wan
> Reporter: Alberto Bustamante Reyes
> Assignee: Alberto Bustamante Reyes
> Priority: Major
> Labels: pull
> Time Spent: 8h
> Remaining Estimate: 0h
>
> There is a problem with Geode WAN replication when GW receivers are
> configured with the same hostname-for-senders and port on all servers. [ 1 ]
> The problem experienced is that shutting down one server is stopping
> replication to this cluster until the server is up again. This is because
> Geode incorrectly assumes there are no more alive servers when just one of
> them is down, because since they share hostname-for-senders and port, they
> are treated as one same server.
> Our proposal consists on expanding internal data in locators with enough
> information to distinguish servers in the beforementioned use case. The same
> intervention is likely needed in the client pools and possibly elsewhere in
> the source code.
> ----
> [ 1 ] : The reason for such a setup is deploying Geode cluster on a
> Kubernetes cluster where all GW receivers are reachable from the outside
> world on the same VIP and port. Other kinds of configuration (different
> hostname and/or different port for each GW receiver) are not cheap from OAM
> and resources perspective in cloud native environments and also limit some
> important use-cases (like scaling).
>
> Link to thread in DEV mailing list:
> [https://markmail.org/thread/6qakx67rxiokdsec]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)