This is an automated email from the ASF dual-hosted git repository.

mkataria pushed a commit to branch OAK-11729
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 932509d7fa6543ad8f14e4b814b2a352fc0d73b4
Author: Mohit Kataria <tiho...@gmail.com>
AuthorDate: Mon Jul 21 15:47:54 2025 +0530

    OAK-11729: If the indexing lane is behind, we should allow catch up of a 
non-failing lane
---
 .../jackrabbit/oak/plugins/index/AsyncIndexUpdate.java       |  6 ------
 .../jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java   | 12 +++++-------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git 
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
 
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
index f27f0c05d7..d663b831dc 100644
--- 
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
+++ 
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
@@ -1249,12 +1249,6 @@ public class AsyncIndexUpdate implements Runnable, 
Closeable {
                 return msg;
             }
 
-            if (!this.isFailing()) {
-                String msg = "The lane is not failing. This operation should 
only be performed if the lane is failing, it should first be allowed to catch 
up on its own.";
-                log.warn(msg);
-                return msg;
-            }
-
             try {
                 log.info("Running a forced catch-up for indexing lane [{}]. ", 
name);
                 // First we need to abort and pause the running indexing task
diff --git 
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
 
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
index 633e94bf07..55f5d59fb0 100644
--- 
a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
+++ 
b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdateTest.java
@@ -620,10 +620,8 @@ public class AsyncIndexUpdateTest {
         PropertyIndexLookup lookup = new PropertyIndexLookup(root);
         assertEquals(Set.of("testRoot", "testRoot1"), find(lookup, "foo", 
"abc"));
 
-        // Run force index catchup with correct confirm message
-        // But the async lane is NOT failing
-        // Due to this the force update should be skipped and the
-        // new node testRoot2 will  be indexed.
+        // Index catchup should work even if the async lane is not failing. 
Refer: https://issues.apache.org/jira/browse/OAK-11729
+        // So changing lane will skip indexing this node.
         builder.child("testRoot2").setProperty("foo", "abc");
         store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
         async.getIndexStats().forceIndexLaneCatchup("CONFIRM");
@@ -635,7 +633,7 @@ public class AsyncIndexUpdateTest {
         assertFalse(root.getChildNode(INDEX_DEFINITIONS_NAME).hasChildNode(
                 ":conflict"));
         lookup = new PropertyIndexLookup(root);
-        assertEquals(Set.of("testRoot", "testRoot1", "testRoot2"), 
find(lookup, "foo", "abc"));
+        assertEquals(Set.of("testRoot", "testRoot1"), find(lookup, "foo", 
"abc"));
 
 
         // Now run force index update on a failing lane with correct confirm 
message
@@ -655,9 +653,9 @@ public class AsyncIndexUpdateTest {
         assertFalse(root.getChildNode(INDEX_DEFINITIONS_NAME).hasChildNode(
                 ":conflict"));
         lookup = new PropertyIndexLookup(root);
-        // testRoot3 will not be indexed, because it was created after the 
last successfully run index update and before the forceUpdate was called.
+        // both testRoot2 and testRoot3 will not be indexed, because these 
were created after the last successfully run index update and before the 
forceUpdate.
         // So it lands in the missing content diff that needs to be reindexed.
-        assertEquals(Set.of("testRoot", "testRoot1", "testRoot2", 
"testRoot4"), find(lookup, "foo", "abc"));
+        assertEquals(Set.of("testRoot", "testRoot1", "testRoot4"), 
find(lookup, "foo", "abc"));
         // Check if failing index update is fixed
         assertFalse(async.isFailing());
     }

Reply via email to