You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/10/22 07:33:41 UTC

[GitHub] [jackrabbit-oak] thomasmueller commented on a change in pull request #393: OAK-9598: reduce server load on reindex operations

thomasmueller commented on a change in pull request #393:
URL: https://github.com/apache/jackrabbit-oak/pull/393#discussion_r734300698



##########
File path: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java
##########
@@ -223,19 +223,18 @@ private boolean shouldReindex(NodeBuilder definition, NodeState before,
             String name) {
         PropertyState type = definition.getProperty(TYPE_PROPERTY_NAME);
 
+        //Do not attempt reindex of disabled indexes
+        if (type != null && TYPE_DISABLED.equals(type.getValue(Type.STRING))) {
+            return false;
+        }
+
         //Async indexes are not considered for reindexing for sync indexing
         // Skip this check for elastic index
         // TODO : See if the check to skip elastic can be handled in a better way - maybe move isMatchingIndexNode to IndexDefinition ?
         if (!TYPE_ELASTICSEARCH.equals(type.getValue(Type.STRING)) && !isMatchingIndexMode(definition)){

Review comment:
       Could we get a NPE here if type is null? (I understand this code was there before... but now it's more obvious... Also, missing space before "{"




-- 
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-unsubscribe@jackrabbit.apache.org

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