You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ch...@apache.org on 2016/11/23 06:17:50 UTC

svn commit: r1770922 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index: AsyncIndexUpdate.java AsyncIndexerService.java

Author: chetanm
Date: Wed Nov 23 06:17:50 2016
New Revision: 1770922

URL: http://svn.apache.org/viewvc?rev=1770922&view=rev
Log:
OAK-4939 - Isolate corrupted index and make async indexer more resilient

Distinguish between index marked fail due to presence of skipped corrupt index and a failure where indexing cycle fails. If index cycle succeeds but there are corrupt indexes present then success message would have list of corrupt indexes

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexerService.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1770922&r1=1770921&r2=1770922&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Wed Nov 23 06:17:50 2016
@@ -536,7 +536,7 @@ public class AsyncIndexUpdate implements
                     afterCheckpoint, afterTime, callback);
 
             // the update succeeded, i.e. it no longer fails
-            if (indexStats.isFailing()) {
+            if (indexStats.didLastIndexingCycleFailed()) {
                 indexStats.fixed();
             }
 
@@ -941,7 +941,13 @@ public class AsyncIndexUpdate implements
         }
 
         public void fixed() {
-            log.info("[{}] Index update no longer fails", name);
+            if (corruptIndexHandler.isFailing(name)){
+                log.info("[{}] Index update no longer fails but some corrupt indexes have been skipped {}", name,
+                        corruptIndexHandler.getCorruptIndexData(name).keySet());
+            } else {
+                log.info("[{}] Index update no longer fails", name);
+            }
+
             failing = false;
             failingSince = "";
             consecutiveFailures = 0;
@@ -954,6 +960,10 @@ public class AsyncIndexUpdate implements
             return failing || corruptIndexHandler.isFailing(name);
         }
 
+        public boolean didLastIndexingCycleFailed(){
+            return failing;
+        }
+
         @Override
         public String getStart() {
             return start;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexerService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexerService.java?rev=1770922&r1=1770921&r2=1770922&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexerService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexerService.java Wed Nov 23 06:17:50 2016
@@ -160,8 +160,9 @@ public class AsyncIndexerService {
                             "logged every {} s",
                     PROP_FAILING_INDEX_TIMEOUT, failingIndexTimeoutSeconds, errorWarnIntervalSeconds);
         } else {
-            log.info("Auto corrupt index isolation handling is enabled. Any async index which fails for [{}]s would " +
-                    "be marked as corrupted and would be skipped from further indexing", failingIndexTimeoutSeconds);
+            log.info("Auto corrupt index isolation handling is enabled. Any async index which fails for {}s would " +
+                    "be marked as corrupted and would be skipped from further indexing. A warning log would be " +
+                    "logged every {} s", failingIndexTimeoutSeconds, errorWarnIntervalSeconds);
         }
         return corruptIndexHandler;
     }