You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/07/09 22:48:43 UTC

[GitHub] [geode] agingade commented on a change in pull request #5350: GEODE-8200: Rebalance operations stuck in "IN_PROGRESS" state forever

agingade commented on a change in pull request #5350:
URL: https://github.com/apache/geode/pull/5350#discussion_r452518577



##########
File path: geode-core/src/main/java/org/apache/geode/management/internal/operation/OperationHistoryManager.java
##########
@@ -90,6 +95,27 @@ private static boolean isExpired(long expirationTime, OperationState<?, ?> opera
     return operationEnd.getTime() <= expirationTime;
   }
 
+  private OperationState<?, ?> validateLocator(OperationState<?, ?> operationState) {
+    if (isLocatorOffline(operationState)) {
+      operationState.setOperationEnd(new Date(), null,
+          new RuntimeException("Locator that initiated the Rest API operation is offline: "
+              + operationState.getLocator()));
+    }
+
+    return operationState;
+  }
+
+  private boolean isLocatorOffline(OperationState operationState) {
+    if (operationState.getOperationEnd() == null
+        && (operationState.getLocator() != null)
+        && cache.getMyId().toString().compareTo(operationState.getLocator()) != 0

Review comment:
       Does it need to be compared? can it be changed to "equals"....

##########
File path: geode-core/src/main/java/org/apache/geode/management/internal/operation/OperationState.java
##########
@@ -28,12 +28,25 @@
  */
 public class OperationState<A extends ClusterManagementOperation<V>, V extends OperationResult>
     implements Identifiable<String> {
+  private static final long serialVersionUID = 8212319653561969588L;
   private final String opId;
   private final A operation;
   private final Date operationStart;
   private Date operationEnd;
   private V result;
   private Throwable throwable;
+  private String locator;

Review comment:
       Can this be DistributedID than a String ID. That way we can avoid converting to string in other places?




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