jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1539030 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
Date Tue, 05 Nov 2013 15:28:18 GMT
Author: jukka
Date: Tue Nov  5 15:28:17 2013
New Revision: 1539030

URL: http://svn.apache.org/r1539030
Log:
JCR-3691: Search index consistency check logs unnecessary warnings for repairable errors

Skip extra sanity checks for nodes that are to be deleted.
Also avoid the warning for the missing parent node of /jcr:system

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java?rev=1539030&r1=1539029&r2=1539030&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
Tue Nov  5 15:28:17 2013
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.jackrabbit.core.HierarchyManager;
+import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.cluster.ClusterException;
 import org.apache.jackrabbit.core.cluster.ClusterNode;
 import org.apache.jackrabbit.core.persistence.IterablePersistenceManager;
@@ -35,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.RepositoryException;
+
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -318,6 +320,9 @@ public class ConsistencyCheck {
                 }
                 Document d = reader.document(i, FieldSelectors.UUID_AND_PARENT);
                 NodeId id = new NodeId(d.get(FieldNames.UUID));
+                if (!nodeIds.containsKey(id)) {
+                    continue; // this node was already marked for deletion
+                }
                 String parent = d.get(FieldNames.PARENT);
                 if (parent == null || parent.isEmpty()) {
                     continue;
@@ -328,6 +333,9 @@ public class ConsistencyCheck {
                 boolean parentIndexed = parentExists && nodeIds.get(parentId);
                 if (parentIndexed) {
                     continue;
+                } else if (id.equals(RepositoryImpl.SYSTEM_ROOT_NODE_ID)
+                        && parentId.equals(RepositoryImpl.ROOT_NODE_ID)) {
+                    continue; // special case for the /jcr:system node
                 }
 
                 // parent is missing from index



Mime
View raw message