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 re...@apache.org on 2026/06/05 09:38:10 UTC
(jackrabbit-oak) branch OAK-12239 created (now 354fe75bd0)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a change to branch OAK-12239
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at 354fe75bd0 OAK-12239: Remove FT_PREFETCH_OAK-9780 and remove 'no prefetch' code path
This branch includes the following new commits:
new 354fe75bd0 OAK-12239: Remove FT_PREFETCH_OAK-9780 and remove 'no prefetch' code path
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(jackrabbit-oak) 01/01: OAK-12239: Remove FT_PREFETCH_OAK-9780 and remove 'no prefetch' code path
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch OAK-12239
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 354fe75bd037577c0ce06ef1459e497671b8eb47
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Fri Jun 5 10:37:44 2026 +0100
OAK-12239: Remove FT_PREFETCH_OAK-9780 and remove 'no prefetch' code path
---
.../apache/jackrabbit/oak/composite/PrefetchTest.java | 16 ----------------
.../oak/plugins/document/DocumentNodeStore.java | 12 +-----------
.../oak/plugins/document/DocumentNodeStoreBuilder.java | 6 ------
.../oak/plugins/document/DocumentNodeStoreService.java | 9 +--------
.../plugins/document/ConcurrentPrefetchAndUpdateIT.java | 7 -------
.../oak/plugins/document/prefetch/CacheWarmingTest.java | 11 -----------
6 files changed, 2 insertions(+), 59 deletions(-)
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/PrefetchTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/PrefetchTest.java
index f3694f0633..403a732186 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/PrefetchTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/composite/PrefetchTest.java
@@ -36,18 +36,13 @@ import javax.jcr.query.QueryResult;
import javax.jcr.query.RowIterator;
import org.apache.jackrabbit.api.JackrabbitSession;
-import org.apache.jackrabbit.oak.commons.junit.TemporarySystemProperty;
-import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
import org.apache.jackrabbit.oak.plugins.document.prefetch.CacheWarming;
import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider;
import org.apache.jackrabbit.oak.spi.mount.Mounts;
import org.apache.jackrabbit.oak.spi.state.NodeStore;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.contrib.java.lang.system.ProvideSystemProperty;
-import org.junit.contrib.java.lang.system.RestoreSystemProperties;
import org.junit.runners.Parameterized.Parameters;
import org.slf4j.LoggerFactory;
@@ -80,21 +75,10 @@ public class PrefetchTest extends CompositeNodeStoreQueryTestBase {
private final String cacheWarmingLogger = CacheWarming.class.getName();
- @Rule
- public final ProvideSystemProperty updateSystemProperties
- = new ProvideSystemProperty(DocumentNodeStore.SYS_PROP_PREFETCH, "true");
-
- @Rule
- public final RestoreSystemProperties restoreSystemProperties
- = new RestoreSystemProperties();
-
public PrefetchTest(NodeStoreKind root, NodeStoreKind mounts) {
super(root, mounts);
}
- @Rule
- public TemporarySystemProperty temporarySystemProperty = new TemporarySystemProperty();
-
@Before
public void loggingAppenderStart() {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
index 1078b92c6f..b29534bdf7 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
@@ -216,9 +216,6 @@ public final class DocumentNodeStore
static final long DEFAULT_MAX_SERVER_TIME_DIFFERENCE = 2000L;
private final long maxTimeDiffMillis = SystemPropertySupplier.create("oak.documentMK.maxServerTimeDiffMillis", DEFAULT_MAX_SERVER_TIME_DIFFERENCE).loggingTo(LOG).get();
- public static final String SYS_PROP_PREFETCH = "oak.documentstore.prefetch";
- private final boolean prefetchEnabled = SystemPropertySupplier.create(SYS_PROP_PREFETCH, false).loggingTo(LOG).get();
-
/**
* The document store without potentially lease checking wrapper.
*/
@@ -4046,18 +4043,11 @@ public final class DocumentNodeStore
@Override
public void prefetch(java.util.Collection<String> paths, NodeState rootState) {
if (paths != null
- && rootState instanceof DocumentNodeState
- && isPrefetchEnabled()) {
+ && rootState instanceof DocumentNodeState) {
cacheWarming.prefetch(paths, (DocumentNodeState) rootState);
}
}
- private boolean isPrefetchEnabled() {
- // feature can be enabled with system property or feature toggle
- return prefetchEnabled
- || (prefetchFeature != null && prefetchFeature.isEnabled());
- }
-
/**
* Configures the performance logger with the specified info log interval.
*
diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
index 1a744b1255..947d2dcbaa 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.oak.cache.CacheLIRS;
import org.apache.jackrabbit.oak.cache.api.Cache;
import org.apache.jackrabbit.oak.cache.api.CacheBuilder;
import org.apache.jackrabbit.oak.cache.api.CacheStatsAdapter;
-import org.apache.jackrabbit.oak.cache.api.EvictionCause;
import org.apache.jackrabbit.oak.cache.api.Weigher;
import org.apache.jackrabbit.oak.cache.AbstractCacheStats;
import org.apache.jackrabbit.oak.cache.CacheValue;
@@ -466,11 +465,6 @@ public class DocumentNodeStoreBuilder<T extends DocumentNodeStoreBuilder<T>> {
return isReadOnlyMode;
}
- public T setPrefetchFeature(@Nullable Feature prefetch) {
- this.prefetchFeature = prefetch;
- return thisBuilder();
- }
-
@Nullable
public Feature getPrefetchFeature() {
return prefetchFeature;
diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
index 58b78df936..3c61daf856 100644
--- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
+++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
@@ -197,11 +197,6 @@ public class DocumentNodeStoreService {
*/
static final long DEFAULT_BLOB_SNAPSHOT_INTERVAL = 12 * 60 * 60;
- /**
- * Feature toggle name to enable prefetch operation in DocumentStore
- */
- private static final String FT_NAME_PREFETCH = "FT_PREFETCH_OAK-9780";
-
/**
* Feature toggle name to enable document store throttling for Mongo Document Store
*/
@@ -316,7 +311,6 @@ public class DocumentNodeStoreService {
executor.start(whiteboard);
customBlobStore = this.config.customBlobStore();
documentStoreType = DocumentStoreType.fromString(this.config.documentStoreType());
- prefetchFeature = Feature.newFeature(FT_NAME_PREFETCH, whiteboard);
docStoreThrottlingFeature = Feature.newFeature(FT_NAME_DOC_STORE_THROTTLING, whiteboard);
noChildOrderCleanupFeature = Feature.newFeature(FT_NAME_DOC_STORE_NOCOCLEANUP, whiteboard);
cancelInvalidationFeature = Feature.newFeature(FT_NAME_CANCEL_INVALIDATION, whiteboard);
@@ -554,7 +548,6 @@ public class DocumentNodeStoreService {
setBundlingDisabled(config.bundlingDisabled()).
setJournalPropertyHandlerFactory(journalPropertyHandlerFactory).
setLeaseCheckMode(ClusterNodeInfo.DEFAULT_LEASE_CHECK_DISABLED ? LeaseCheckMode.DISABLED : LeaseCheckMode.valueOf(config.leaseCheckMode())).
- setPrefetchFeature(prefetchFeature).
setDocStoreThrottlingFeature(docStoreThrottlingFeature).
setNoChildOrderCleanupFeature(noChildOrderCleanupFeature).
setCancelInvalidationFeature(cancelInvalidationFeature).
@@ -720,7 +713,7 @@ public class DocumentNodeStoreService {
journalPropertyHandlerFactory.stop();
}
- closeFeatures(prefetchFeature, docStoreThrottlingFeature, cancelInvalidationFeature, docStoreFullGCFeature,
+ closeFeatures(docStoreThrottlingFeature, cancelInvalidationFeature, docStoreFullGCFeature,
docStoreEmbeddedVerificationFeature, prevNoPropCacheFeature, docStoreAvoidMergeLockFeature);
unregisterNodeStore();
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentPrefetchAndUpdateIT.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentPrefetchAndUpdateIT.java
index 0d6ba7b60d..0c13e919f6 100755
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentPrefetchAndUpdateIT.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentPrefetchAndUpdateIT.java
@@ -30,7 +30,6 @@ import org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentStore;
import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -53,7 +52,6 @@ public class ConcurrentPrefetchAndUpdateIT extends AbstractMongoConnectionTest {
@Before
@Override
public void setUpConnection() throws Exception {
- System.setProperty(DocumentNodeStore.SYS_PROP_PREFETCH, String.valueOf(true));
mongoConnection = connectionFactory.getConnection();
assertNotNull(mongoConnection);
MongoDatabase db = mongoConnection.getDatabase();
@@ -64,11 +62,6 @@ public class ConcurrentPrefetchAndUpdateIT extends AbstractMongoConnectionTest {
mk = builder.setDocumentStore(store).open();
}
- @After
- public void clearSystemProperty() {
- System.clearProperty(DocumentNodeStore.SYS_PROP_PREFETCH);
- }
-
@Test
public void cacheConsistency() throws Exception {
Revision r = newRevision();
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
index 16293c67a4..49a4be1004 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.plugins.document.prefetch;
-import static org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.SYS_PROP_PREFETCH;
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getIdFromPath;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -34,7 +33,6 @@ import java.util.TreeSet;
import com.mongodb.MongoTimeoutException;
import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.commons.junit.TemporarySystemProperty;
import org.apache.jackrabbit.oak.commons.time.Stopwatch;
import org.apache.jackrabbit.oak.plugins.document.Collection;
import org.apache.jackrabbit.oak.plugins.document.CountingDocumentStore;
@@ -55,7 +53,6 @@ import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
import org.apache.jackrabbit.oak.stats.Clock;
import org.jetbrains.annotations.Nullable;
import org.junit.AfterClass;
-import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
@@ -63,9 +60,6 @@ import org.slf4j.LoggerFactory;
public class CacheWarmingTest {
- @Rule
- public TemporarySystemProperty systemProperties = new TemporarySystemProperty();
-
@Rule
public DocumentMKBuilderProvider builderProvider = new DocumentMKBuilderProvider();
@@ -78,11 +72,6 @@ public class CacheWarmingTest {
private CountingMongoDatabase db;
- @Before
- public void enablePrefetch() {
- System.setProperty(SYS_PROP_PREFETCH, "true");
- }
-
@AfterClass
public static void cleanUp() {
MongoUtils.dropCollections(MongoUtils.DB);