Author: catholicon
Date: Wed Nov 16 15:42:51 2016
New Revision: 1770003

URL: http://svn.apache.org/viewvc?rev=1770003&view=rev
Log:
OAK-3001: Simplify JournalGarbageCollector using a dedicated timestamp property
Make JournalGC#gcWithCheckpoint more script to cover of head at checkpoint

OAK-3985: MongoDocumentStore: implement new conditional remove method
Review comment from Marcel Reutegger - mongo can un-atomically throw an 
exception in bulk update case. Cover for that

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java?rev=1770003&r1=1770002&r2=1770003&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java
 Wed Nov 16 15:42:51 2016
@@ -782,7 +782,7 @@ public class MongoDocumentStore implemen
                 throw DocumentStoreException.convert(e, "Remove failed for " + 
collection + ": " +
                     indexedProperty + " in (" + startValue + ", " + endValue + 
")");
             } finally {
-                if (num > 0 && collection == Collection.NODES) {
+                if (collection == Collection.NODES) {
                     // this method is currently being used only for Journal 
collection while GC.
                     // But, to keep sanctity of the API, we need to 
acknowledge that Nodes collection
                     // could've been used. But, in this signature, there's no 
useful way to invalidate

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java?rev=1770003&r1=1770002&r2=1770003&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/JournalGCTest.java
 Wed Nov 16 15:42:51 2016
@@ -44,7 +44,6 @@ public class JournalGCTest {
         DocumentNodeStore ns = builderProvider.newBuilder()
                 .clock(c).setAsyncDelay(0).getNodeStore();
 
-        String cp = ns.checkpoint(TimeUnit.DAYS.toMillis(1));
         // perform some change
         NodeBuilder builder = ns.getRoot().builder();
         builder.child("foo");
@@ -54,6 +53,7 @@ public class JournalGCTest {
 
         // trigger creation of journal entry
         ns.runBackgroundOperations();
+        String cp = ns.checkpoint(TimeUnit.DAYS.toMillis(1));
 
         JournalEntry entry = ns.getDocumentStore().find(JOURNAL, 
JournalEntry.asId(head));
         assertNotNull(entry);


Reply via email to