FrancoisZhang commented on code in PR #562:
URL: https://github.com/apache/jackrabbit-oak/pull/562#discussion_r867005027


##########
oak-run/src/main/java/org/apache/jackrabbit/oak/indexversion/IndexVersionOperation.java:
##########
@@ -86,42 +92,65 @@ public static List<IndexVersionOperation> 
generateIndexVersionOperationList(Node
         }
 
         if (!reverseSortedIndexNameList.isEmpty()) {
-            IndexName activeIndexNameObject = 
reverseSortedIndexNameList.remove(0);
-            NodeState activeIndexNode = 
indexDefParentNode.getChildNode(PathUtils.getName(activeIndexNameObject.getNodeName()));
-            boolean isActiveIndexLongEnough = 
isIndexPurgeReady(activeIndexNameObject, activeIndexNode, purgeThresholdMillis);
-            int activeProductVersion = 
activeIndexNameObject.getProductVersion();
-            indexVersionOperationList.add(new 
IndexVersionOperation(activeIndexNameObject));
+            IndexName activeIndexNameObject = 
getActiveIndex(reverseSortedIndexNameList, parentPath, rootNode);
+            if (activeIndexNameObject == null) {
+                LOG.warn("Cannot find any active index from the list: {}", 
reverseSortedIndexNameList);

Review Comment:
   @thomasmueller good points, yeah makes sense just to leave a warning message 
as is for now. we can check further later based on the log analysis.
   For now, it will be too risky to simply remove all indexes when no active 
index.



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to