jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1592556 - in /jackrabbit/oak/branches/1.0: ./ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java
Date Mon, 05 May 2014 15:41:54 GMT
Author: mreutegg
Date: Mon May  5 15:41:54 2014
New Revision: 1592556

URL: http://svn.apache.org/r1592556
Log:
OAK-1793: MongoMK GC removes documents with data still in use

Modified:
    jackrabbit/oak/branches/1.0/   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java

Propchange: jackrabbit/oak/branches/1.0/
------------------------------------------------------------------------------
  Merged /jackrabbit/oak/trunk:r1592487

Modified: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java?rev=1592556&r1=1592555&r2=1592556&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java
(original)
+++ jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollectorTest.java
Mon May  5 15:41:54 2014
@@ -49,6 +49,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.stats.Clock;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -298,6 +299,34 @@ public class VersionGarbageCollectorTest
         assertEquals(names, children);
     }
 
+    // OAK-1793
+    @Ignore
+    @Test
+    public void gcPrevWithMostRecentModification() throws Exception {
+        long maxAge = 1; //hrs
+        long delta = TimeUnit.MINUTES.toMillis(10);
+
+        for (int i = 0; i < NUM_REVS_THRESHOLD + 1; i++) {
+            NodeBuilder builder = store.getRoot().builder();
+            builder.child("foo").setProperty("prop", "v" + i);
+            builder.child("bar").setProperty("prop", "v" + i);
+            store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+        }
+
+        store.runBackgroundOperations();
+
+        clock.waitUntil(clock.getTime() + TimeUnit.HOURS.toMillis(maxAge) + delta);
+
+        VersionGCStats stats = gc.gc(maxAge, TimeUnit.HOURS);
+        assertEquals(2, stats.splitDocGCCount);
+
+        NodeDocument doc = getDoc("/foo");
+        assertNotNull(doc);
+        DocumentNodeState state = doc.getNodeAtRevision(
+                store, store.getHeadRevision(), null);
+        assertNotNull(state);
+    }
+
     private NodeDocument getDoc(String path){
         return store.getDocumentStore().find(NODES, Utils.getIdFromPath(path), 0);
     }



Mime
View raw message