jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject svn commit: r1521005 - in /jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: persistence/bundle/ConsistencyCheckerImpl.java query/lucene/ConsistencyCheck.java
Date Mon, 09 Sep 2013 09:13:47 GMT
Author: unico
Date: Mon Sep  9 09:13:46 2013
New Revision: 1521005

URL: http://svn.apache.org/r1521005
Log:
JCR-3665 when the last node of the last batch does not exist anymore it means we most probably
did not read until the end of the table and need to start over

Modified:
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java?rev=1521005&r1=1521004&r2=1521005&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java
Mon Sep  9 09:13:46 2013
@@ -113,8 +113,8 @@ public class ConsistencyCheckerImpl {
                 Map<NodeId, NodeInfo> batch = pm.getAllNodeInfos(null, NODESATONCE);
                 Map<NodeId, NodeInfo> allInfos = batch;
 
+                NodeId lastId = null;
                 while (!batch.isEmpty()) {
-                    NodeId lastId = null;
 
                     for (Map.Entry<NodeId, NodeInfo> entry : batch.entrySet()) {
                         NodeId id = entry.getKey();
@@ -140,9 +140,14 @@ public class ConsistencyCheckerImpl {
                 }
 
                 if (CHECKAFTERLOADING) {
-                    // check info
-                    for (Map.Entry<NodeId, NodeInfo> entry : allInfos.entrySet()) {
-                        checkBundleConsistency(entry.getKey(), entry.getValue(), fix, lostNFound,
reports, allInfos);
+                    if (pm.exists(lastId)) {
+                        // check info
+                        for (Map.Entry<NodeId, NodeInfo> entry : allInfos.entrySet())
{
+                            checkBundleConsistency(entry.getKey(), entry.getValue(), fix,
lostNFound, reports, allInfos);
+                        }
+                    } else {
+                        log.info("Failed to read all nodes, starting over");
+                        internalCheckConsistency(uuids, recursive, fix, reports, lostNFoundId);
                     }
                 }
             } catch (ItemStateException ex) {

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java?rev=1521005&r1=1521004&r2=1521005&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ConsistencyCheck.java
Mon Sep  9 09:13:46 2013
@@ -242,8 +242,8 @@ public class ConsistencyCheck {
             int count = 0;
             Map<NodeId, Boolean> nodeIds = new HashMap<NodeId, Boolean>();
             List<NodeId> batch = pm.getAllNodeIds(null, NODESATONCE);
+            NodeId lastId = null;
             while (!batch.isEmpty()) {
-                NodeId lastId = null;
                 for (NodeId nodeId : batch) {
                     lastId = nodeId;
 
@@ -257,7 +257,12 @@ public class ConsistencyCheck {
                 }
                 batch = pm.getAllNodeIds(lastId, NODESATONCE);
             }
-            this.nodeIds = nodeIds;
+            if (pm.exists(lastId)) {
+                this.nodeIds = nodeIds;
+            } else {
+                log.info("Failed to read all nodes, starting over");
+                loadNodes();
+            }
         } catch (ItemStateException e) {
             log.error("Exception while loading items to check", e);
         } catch (RepositoryException e) {



Mime
View raw message