[ 
https://issues.apache.org/jira/browse/GEODE-8004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17099759#comment-17099759
 ] 

ASF GitHub Bot commented on GEODE-8004:
---------------------------------------

jujoramos commented on a change in pull request #4978:
URL: https://github.com/apache/geode/pull/4978#discussion_r419999012



##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/ServerLocationAndMemberId.java
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.distributed.internal;
+
+public class ServerLocationAndMemberId {
+
+  private final ServerLocation serverLocation;
+  private final String memberId;
+
+  public ServerLocationAndMemberId() {

Review comment:
       This constructor doesn't seem to be used anywhere, so we could just 
delete it.

##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java
##########
@@ -425,6 +429,22 @@ private void addGroups(Map<String, Map<ServerLocation, 
LoadHolder>> map, String[
     }
   }
 
+  private void addGroups(Map<String, Map<ServerLocationAndMemberId, 
LoadHolder>> map,

Review comment:
       This is a new method and should be, at leat, unit tested.
   You can make it package private, annotate it with `@VisibleForTesting` and 
access it directly from `LocatorLoadSnapshotJUnitTest` and/or 
`LocatorLoadSnapshotIntegrationTest`.

##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java
##########
@@ -440,6 +460,24 @@ private void removeFromMap(Map<String, Map<ServerLocation, 
LoadHolder>> map, Str
     groupMap.remove(location);
   }
 
+  private void removeFromMap(Map<String, Map<ServerLocationAndMemberId, 
LoadHolder>> map,

Review comment:
       This is a new method and should be, at leat, unit tested.
   You can make it package private, annotate it with `@VisibleForTesting` and 
access it directly from `LocatorLoadSnapshotJUnitTest` and/or 
`LocatorLoadSnapshotIntegrationTest`.

##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java
##########
@@ -448,14 +486,28 @@ private void updateMap(Map map, ServerLocation location, 
float load, float loadP
     }
   }
 
+  private void updateMap(Map map, ServerLocation location, String memberId, 
float load,
+      float loadPerConnection) {
+    Map groupMap = (Map) map.get(null);
+    ServerLocationAndMemberId locationAndMemberId =
+        new ServerLocationAndMemberId(location, memberId);
+    LoadHolder holder =
+        (LoadHolder) groupMap.get(locationAndMemberId);
+
+    if (holder != null) {
+      holder.setLoad(load, loadPerConnection);
+    }
+  }
+
   /**
    *
    * @param groupServers the servers to consider
    * @param excludedServers servers to exclude
    * @param count how many you want. a negative number means all of them in 
order of best to worst
    * @return a list of best...worst server LoadHolders
    */
-  private List<LoadHolder> findBestServers(Map<ServerLocation, LoadHolder> 
groupServers,
+  private List<LoadHolder> findBestServers(

Review comment:
       Not a new method but significantly changed, it should be, at leat, unit 
tested.
   You can make it package private, annotate it with `@VisibleForTesting` and 
access it directly from `LocatorLoadSnapshotJUnitTest` and/or 
`LocatorLoadSnapshotIntegrationTest`.

##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java
##########
@@ -497,13 +558,21 @@ private void updateMap(Map map, ServerLocation location, 
float load, float loadP
    * If it is most loaded then return its LoadHolder; otherwise return null;
    */
   private LoadHolder isCurrentServerMostLoaded(ServerLocation currentServer,
-      Map<ServerLocation, LoadHolder> groupServers) {
-    final LoadHolder currentLH = groupServers.get(currentServer);
+      Map<ServerLocationAndMemberId, LoadHolder> groupServers) {

Review comment:
       Not a new method but significantly changed, it should be, at leat, unit 
tested.
   You can make it package private, annotate it with `@VisibleForTesting` and 
access it directly from `LocatorLoadSnapshotJUnitTest` and/or 
`LocatorLoadSnapshotIntegrationTest`.

##########
File path: 
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java
##########
@@ -448,14 +486,28 @@ private void updateMap(Map map, ServerLocation location, 
float load, float loadP
     }
   }
 
+  private void updateMap(Map map, ServerLocation location, String memberId, 
float load,

Review comment:
       This is a new method and should be, at leat, unit tested.
   You can make it package private, annotate it with `@VisibleForTesting` and 
access it directly from `LocatorLoadSnapshotJUnitTest` and/or 
`LocatorLoadSnapshotIntegrationTest`.




----------------------------------------------------------------
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:
us...@infra.apache.org


> Regression Introduced Through GEODE-7565
> ----------------------------------------
>
>                 Key: GEODE-8004
>                 URL: https://issues.apache.org/jira/browse/GEODE-8004
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>            Reporter: Juan Ramos
>            Assignee: Juan Ramos
>            Priority: Major
>              Labels: GeodeCommons
>
> Intermittent errors were observed while executing some internal tests and 
> commit 
> [dd23ee8|https://github.com/apache/geode/commit/dd23ee8200cba67cea82e57e2e4ccedcdf9e8266]
>  was determined to be responsible. As of yet, no local reproduction of the 
> issue is available, but work is ongoing to provide a test that can be used to 
> debug the issue (a [PR|https://github.com/apache/geode/pull/4974] to revert 
> of the original commit has been opened and will be merged shortly, though, 
> this ticket is to investigate the root cause so the original commit can be 
> merged again into {{develop}}).
> ---
> It seems that a server is trying to read an {{ack}} response and, instead, it 
> receives a {{PING}} message:
> {noformat}
> [error 2020/04/18 23:44:22.758 PDT <poolTimer-edgeDescript-31> tid=0x165] 
> Unexpected error in pool task 
> <org.apache.geode.cache.client.internal.LiveServerPinger$PingTask@3483b110>
> org.apache.geode.InternalGemFireError: Unexpected message type PING
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.processAck(AbstractOp.java:264)
>       at 
> org.apache.geode.cache.client.internal.PingOp$PingOpImpl.processResponse(PingOp.java:82)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.processResponse(AbstractOp.java:222)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:207)
>       at 
> org.apache.geode.cache.client.internal.AbstractOp.attempt(AbstractOp.java:382)
>       at 
> org.apache.geode.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java:268)
>       at 
> org.apache.geode.cache.client.internal.pooling.PooledConnection.execute(PooledConnection.java:352)
>       at 
> org.apache.geode.cache.client.internal.OpExecutorImpl.executeWithPossibleReAuthentication(OpExecutorImpl.java:753)
>       at 
> org.apache.geode.cache.client.internal.OpExecutorImpl.executeOnServer(OpExecutorImpl.java:332)
>       at 
> org.apache.geode.cache.client.internal.OpExecutorImpl.executeOn(OpExecutorImpl.java:303)
>       at 
> org.apache.geode.cache.client.internal.PoolImpl.executeOn(PoolImpl.java:839)
>       at org.apache.geode.cache.client.internal.PingOp.execute(PingOp.java:38)
>       at 
> org.apache.geode.cache.client.internal.LiveServerPinger$PingTask.run2(LiveServerPinger.java:90)
>       at 
> org.apache.geode.cache.client.internal.PoolImpl$PoolTask.run(PoolImpl.java:1329)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>       at 
> org.apache.geode.internal.ScheduledThreadPoolExecutorWithKeepAlive$DelegatingScheduledFuture.run(ScheduledThreadPoolExecutorWithKeepAlive.java:276)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at java.lang.Thread.run(Thread.java:748)
> {noformat}
> Around the same time, another member of the distributed system logs the 
> following warning, which seems to be related to the original changes as well:
> {noformat}
> [warn 2020/04/18 23:44:22.757 PDT <ServerConnection on port 29019 Thread 1> 
> tid=0x298] Unable to ping non-member 
> rs-FullRegression19040559a2i32xlarge-hydra-client-63(bridgegemfire1_host1_4749:4749)<ec><v39>:41003
>  for client 
> identity(rs-FullRegression19040559a2i32xlarge-hydra-client-63(edgegemfire3_host1_1071:1071:loner):50046:5a182991:edgegemfire3_host1_1071,connection=2
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to