You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "shodaaan (via GitHub)" <gi...@apache.org> on 2024/06/17 14:02:55 UTC
[PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
shodaaan opened a new pull request, #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539
- create class FullGCOptions which will hold the different parameters used for running full GC
- added variables to Configuration.java for 2 full GC modes: GAP_ORPHANS and EMPTY_PROPERTIES
- updated VersionGarbageCollector constructor, as well as DocumentNodeStore Builder / Service and DocumentNodeStore to get values received from Configuration via the FullGCOptions class
- applied the new full GC mode options in VersionGarbageCollector via the fullGCOptions parameter passed in the constructor
- added unit test methods for testing feature toggle and configuration options set in DocumentNodeStoreBuilder, based on existing testing of feature toggles and configuration settings in unit tests
- fixed CommitBuilderTest test failures by changing expected exception type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650887782
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java:
##########
@@ -238,6 +239,8 @@ static DocumentStoreType fromString(String type) {
private Feature cancelInvalidationFeature;
private Feature docStoreFullGCFeature;
private Feature docStoreEmbeddedVerificationFeature;
+ private Feature docStoreFullGCModeGapOrphansFeature;
+ private Feature docStoreFullGCModeEmptyPropertiesFeature;
Review Comment:
Fixed, thank you for the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650889773
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCTest.java:
##########
@@ -531,6 +531,57 @@ public void testResetFullGCDryRunMode() throws Exception {
// OAK-10370 END
+ // OAK-10896
+
+ @Test
+ public void testVersionGCLoadGCModeConfigurationNotApplicable() throws Exception {
+ int fullGcModeNotAllowedValue = 5;
+ int fullGcModeGapOrphans = 2;
+
+ // set fullGcMode to allowed value that is different than NONE
+ VersionGarbageCollector.setFullGcMode(fullGcModeGapOrphans);
+
+ // reinitialize VersionGarbageCollector with not allowed value
+ VersionGarbageCollector gc = new VersionGarbageCollector(
+ ns, new VersionGCSupport(store), true, false, false,
+ fullGcModeNotAllowedValue);
+
+ assertEquals("Starting VersionGarbageCollector with not applicable / not allowed value" +
+ "will set fullGcMode to default NONE", gc.getFullGcMode(), VersionGarbageCollector.FullGCMode.NONE);
Review Comment:
Fixed the comment, unit tests and static change, thank you for the suggestions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651122588
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/Utils.java:
##########
@@ -1009,6 +1009,16 @@ public static boolean isEmbeddedVerificationEnabled(final DocumentNodeStoreBuild
return builder.isEmbeddedVerificationEnabled() || (docStoreEmbeddedVerificationFeature != null && docStoreEmbeddedVerificationFeature.isEnabled());
}
+ /**
+ * Returns the full GC mode value for the DocumentNodeStore.
+ *
+ * @param builder instance for DocumentNodeStoreBuilder
+ * @return true if full GC is enabled else false
+ */
+ public static int getFullGCMode(final DocumentNodeStoreBuilder<?> builder) {
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651096514
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -692,7 +694,7 @@ public int getMemory() {
diffCache = builder.getDiffCache(this.clusterId);
// check if root node exists
- NodeDocument rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ NodeDocument rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "stefan-egli (via GitHub)" <gi...@apache.org>.
stefan-egli commented on PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#issuecomment-2186194768
PS: I think we should adjust jira/pr titles to talk about osgi config instead of feature toggle (to avoid future confusion)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "stefan-egli (via GitHub)" <gi...@apache.org>.
stefan-egli commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650969435
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -692,7 +694,7 @@ public int getMemory() {
diffCache = builder.getDiffCache(this.clusterId);
// check if root node exists
- NodeDocument rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ NodeDocument rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
but it's in a random unrelated code - which is against our goal to not do unrelated changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651111738
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -47,13 +47,13 @@
import org.apache.jackrabbit.oak.plugins.document.NodeDocument;
import org.apache.jackrabbit.oak.plugins.document.RevisionContextWrapper;
import org.apache.jackrabbit.oak.plugins.document.SweepHelper;
+import org.apache.jackrabbit.oak.plugins.document.VersionGCOptions;
import org.apache.jackrabbit.oak.plugins.document.VersionGCSupport;
+import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector;
import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCInfo;
import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCStats;
import org.apache.jackrabbit.oak.plugins.document.util.MongoConnection;
import org.apache.jackrabbit.oak.run.commons.Command;
-import org.apache.jackrabbit.oak.plugins.document.VersionGCOptions;
-import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector;
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650887172
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -692,7 +694,7 @@ public int getMemory() {
diffCache = builder.getDiffCache(this.clusterId);
// check if root node exists
- NodeDocument rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ NodeDocument rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
This is consistent with how we are using static method calls. The consistent approach would be IMHO to actually do this everywhere, but I think a refactoring ticket is the best place for that.
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -716,7 +718,7 @@ public int getMemory() {
setRoot(head);
// make sure _lastRev is written back to store
backgroundWrite();
- rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
This is consistent with how we are using static method calls. The consistent approach would be IMHO to actually do this everywhere, but I think a refactoring ticket is the best place for that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651080682
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -69,10 +69,11 @@
import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
import static org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreHelper.createVersionGC;
import static org.apache.jackrabbit.oak.plugins.document.FormatVersion.versionOf;
+import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getFullGCMode;
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getIdFromPath;
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getRootDocument;
-import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isFullGCEnabled;
Review Comment:
same as above.
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java:
##########
@@ -211,6 +211,29 @@ static FullGCMode getFullGcMode() {
return fullGcMode;
}
+ /**
+ * Set the full GC mode to be used according to the provided configuration value.
+ * The configuration value will be ignored and fullGCMode will be reset to NONE
+ * if it is set to any other values than the supported ones.
+ * @param fullGcModeConfig
+ */
+ static void setFullGcMode(int fullGcModeConfig) {
Review Comment:
I would suggest renaming variable name to `fullGcMode`
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java:
##########
@@ -236,6 +237,30 @@ public void fullGCDisabledForRDB() {
assertFalse("Full GC is disabled for RDB Document Store", fullGCEnabled);
}
+ @Test
+ public void fullGCModeDefaultValue() {
+ int fullGCModeDefaultValue = getFullGCMode(newDocumentNodeStoreBuilder());
+ final int FULL_GC_MODE_NONE = 0;
Review Comment:
please use camelCase here.
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/Utils.java:
##########
@@ -1009,6 +1009,16 @@ public static boolean isEmbeddedVerificationEnabled(final DocumentNodeStoreBuild
return builder.isEmbeddedVerificationEnabled() || (docStoreEmbeddedVerificationFeature != null && docStoreEmbeddedVerificationFeature.isEnabled());
}
+ /**
+ * Returns the full GC mode value for the DocumentNodeStore.
+ *
+ * @param builder instance for DocumentNodeStoreBuilder
+ * @return true if full GC is enabled else false
+ */
+ public static int getFullGCMode(final DocumentNodeStoreBuilder<?> builder) {
Review Comment:
This utility method doesn't make sense, it only returns `fullGcMode` from the `builder` object. I would remove this.
##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -47,13 +47,13 @@
import org.apache.jackrabbit.oak.plugins.document.NodeDocument;
import org.apache.jackrabbit.oak.plugins.document.RevisionContextWrapper;
import org.apache.jackrabbit.oak.plugins.document.SweepHelper;
+import org.apache.jackrabbit.oak.plugins.document.VersionGCOptions;
import org.apache.jackrabbit.oak.plugins.document.VersionGCSupport;
+import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector;
import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCInfo;
import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCStats;
import org.apache.jackrabbit.oak.plugins.document.util.MongoConnection;
import org.apache.jackrabbit.oak.run.commons.Command;
-import org.apache.jackrabbit.oak.plugins.document.VersionGCOptions;
-import org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector;
Review Comment:
please revert these import changes.
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java:
##########
@@ -236,6 +237,30 @@ public void fullGCDisabledForRDB() {
assertFalse("Full GC is disabled for RDB Document Store", fullGCEnabled);
}
+ @Test
+ public void fullGCModeDefaultValue() {
+ int fullGCModeDefaultValue = getFullGCMode(newDocumentNodeStoreBuilder());
+ final int FULL_GC_MODE_NONE = 0;
+ assertEquals("Full GC mode has NONE value by default", fullGCModeDefaultValue, FULL_GC_MODE_NONE);
+ }
+
+ @Test
+ public void fullGCModeSetViaConfiguration() {
+ DocumentNodeStoreBuilder<?> builder = newDocumentNodeStoreBuilder();
+ final int FULL_GC_MODE_GAP_ORPHANS = 2;
Review Comment:
same as above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651098372
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -2603,7 +2605,7 @@ private void cleanOrphanedBranches() {
}
private void cleanRootCollisions() {
- String id = Utils.getIdFromPath(ROOT);
+ String id = getIdFromPath(ROOT);
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650451430
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCTest.java:
##########
@@ -531,6 +531,51 @@ public void testResetFullGCDryRunMode() throws Exception {
// OAK-10370 END
+ // OAK-10896
+
+ @Test
+ public void testVersionGCLoadGCModeConfigurationNotApplicable() throws Exception {
+ int FULL_GC_MODE_NOT_ALLOWED_VALUE = 5;
Review Comment:
Fixed, thank you for the comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add feature toggle for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "stefan-egli (via GitHub)" <gi...@apache.org>.
stefan-egli commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1650729569
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -692,7 +694,7 @@ public int getMemory() {
diffCache = builder.getDiffCache(this.clusterId);
// check if root node exists
- NodeDocument rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ NodeDocument rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
I think we should try to avoid making unrelated changes like these, they make the PR change surface unnecessarily larger (and in this particular case I don't think it is an improvement - but I guess that is a controversial topic)
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -716,7 +718,7 @@ public int getMemory() {
setRoot(head);
// make sure _lastRev is written back to store
backgroundWrite();
- rootDoc = store.find(NODES, Utils.getIdFromPath(ROOT));
+ rootDoc = store.find(NODES, getIdFromPath(ROOT));
Review Comment:
(same as above)
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java:
##########
@@ -238,6 +239,8 @@ static DocumentStoreType fromString(String type) {
private Feature cancelInvalidationFeature;
private Feature docStoreFullGCFeature;
private Feature docStoreEmbeddedVerificationFeature;
+ private Feature docStoreFullGCModeGapOrphansFeature;
+ private Feature docStoreFullGCModeEmptyPropertiesFeature;
Review Comment:
I think we aimed to remove the features here?
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/CommitBuilderTest.java:
##########
@@ -83,8 +83,8 @@ public void buildWithNullRevision() {
CommitBuilder builder = new CommitBuilder(ns, null);
try {
builder.build(null);
- expectNPE();
- } catch (NullPointerException e) {
+ expectIllegalArgumentException();
+ } catch (IllegalArgumentException e) {
Review Comment:
it fails with a NPE for me though
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGCTest.java:
##########
@@ -531,6 +531,57 @@ public void testResetFullGCDryRunMode() throws Exception {
// OAK-10370 END
+ // OAK-10896
+
+ @Test
+ public void testVersionGCLoadGCModeConfigurationNotApplicable() throws Exception {
+ int fullGcModeNotAllowedValue = 5;
+ int fullGcModeGapOrphans = 2;
+
+ // set fullGcMode to allowed value that is different than NONE
+ VersionGarbageCollector.setFullGcMode(fullGcModeGapOrphans);
+
+ // reinitialize VersionGarbageCollector with not allowed value
+ VersionGarbageCollector gc = new VersionGarbageCollector(
+ ns, new VersionGCSupport(store), true, false, false,
+ fullGcModeNotAllowedValue);
+
+ assertEquals("Starting VersionGarbageCollector with not applicable / not allowed value" +
+ "will set fullGcMode to default NONE", gc.getFullGcMode(), VersionGarbageCollector.FullGCMode.NONE);
Review Comment:
```suggestion
"will set fullGcMode to default NONE", VersionGarbageCollector.getFullGcMode(), VersionGarbageCollector.FullGCMode.NONE);
```
static method should be accessed in a static way
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -2603,7 +2605,7 @@ private void cleanOrphanedBranches() {
}
private void cleanRootCollisions() {
- String id = Utils.getIdFromPath(ROOT);
+ String id = getIdFromPath(ROOT);
Review Comment:
(same as above throughout this class)
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java:
##########
@@ -1092,61 +1124,63 @@ public void collectGarbage(final NodeDocument doc, final GCPhases phases) {
}
if (!isDeletedOrOrphanedNode(traversedState, greatestExistingAncestorOrSelf, phases, doc)) {
+
// here the node is not orphaned which means that we can reach the node from root
- switch(fullGcMode) {
- case NONE : {
+ switch (fullGcMode) {
+ case NONE: {
Review Comment:
still, this in unrelated and we should not increase PR change surface when that is not necessary or part of the PR
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java:
##########
@@ -1226,7 +1260,10 @@ private boolean isDeletedOrOrphanedNode(final NodeState traversedState, final Pa
phases.stop(GCPhase.FULL_GC_COLLECT_ORPHAN_NODES);
return false;
}
+
+ // first check if gapOrphansModeEnabled is set in fullGCOptions, then check in fullGCMode enum
Review Comment:
but the comment is still here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-10896: - Add OSGI configuration variable for removal of deleted properties and orphaned nodes [jackrabbit-oak]
Posted by "shodaaan (via GitHub)" <gi...@apache.org>.
shodaaan commented on code in PR #1539:
URL: https://github.com/apache/jackrabbit-oak/pull/1539#discussion_r1651122982
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java:
##########
@@ -236,6 +237,30 @@ public void fullGCDisabledForRDB() {
assertFalse("Full GC is disabled for RDB Document Store", fullGCEnabled);
}
+ @Test
+ public void fullGCModeDefaultValue() {
+ int fullGCModeDefaultValue = getFullGCMode(newDocumentNodeStoreBuilder());
+ final int FULL_GC_MODE_NONE = 0;
Review Comment:
Done.
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java:
##########
@@ -236,6 +237,30 @@ public void fullGCDisabledForRDB() {
assertFalse("Full GC is disabled for RDB Document Store", fullGCEnabled);
}
+ @Test
+ public void fullGCModeDefaultValue() {
+ int fullGCModeDefaultValue = getFullGCMode(newDocumentNodeStoreBuilder());
+ final int FULL_GC_MODE_NONE = 0;
+ assertEquals("Full GC mode has NONE value by default", fullGCModeDefaultValue, FULL_GC_MODE_NONE);
+ }
+
+ @Test
+ public void fullGCModeSetViaConfiguration() {
+ DocumentNodeStoreBuilder<?> builder = newDocumentNodeStoreBuilder();
+ final int FULL_GC_MODE_GAP_ORPHANS = 2;
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org