This is an automated email from the ASF dual-hosted git repository.
mkataria pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new d43466fe52 OAK-11729: If the indexing lane is behind, we should allow
catch up of a non-failing lane (#2397)
d43466fe52 is described below
commit d43466fe528788b5cb04f94bbf86aec74a86bbcb
Author: Mohit Kataria <[email protected]>
AuthorDate: Tue Jul 22 14:03:21 2025 +0530
OAK-11729: If the indexing lane is behind, we should allow catch up of a
non-failing lane (#2397)
* OAK-11729: If the indexing lane is behind, we should allow catch up of a
non-failing lane
* 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 | 13 ++++++-------
2 files changed, 6 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..825680c09d 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 force catchup 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,10 @@ 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 force catchup.
// 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());
}