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 mr...@apache.org on 2016/06/27 07:47:01 UTC
svn commit: r1750292 - in /jackrabbit/oak/branches/1.4: ./
oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java
Author: mreutegg
Date: Mon Jun 27 07:47:01 2016
New Revision: 1750292
URL: http://svn.apache.org/viewvc?rev=1750292&view=rev
Log:
OAK-4494: Stale documents after revision GC in cluster
Merged revision 1750287 from trunk
Modified:
jackrabbit/oak/branches/1.4/ (props changed)
jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java
Propchange: jackrabbit/oak/branches/1.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 27 07:47:01 2016
@@ -1,3 +1,3 @@
/jackrabbit/oak/branches/1.0:1665962
-/jackrabbit/oak/trunk:1733615,1733875,1733913,1733929,1734230,1734254,1734279,1734941,1735052,1735405,1735484,1735549,1735564,1735588,1735622,1735638,1735919,1735983,1736176,1737309-1737310,1737334,1737349,1737998,1738004,1738775,1738795,1738833,1738950,1738957,1738963,1739894,1740116,1740625-1740626,1740971,1741032,1741339,1741343,1742520,1742888,1742916,1743097,1743172,1743343,1744265,1744959,1745038,1745197,1745368,1746086,1746117,1746342,1746345,1746696,1746981,1747341-1747342,1747492,1747512,1748505,1748553,1748870,1749275,1749350,1749464,1749475,1749645,1749662,1749815,1749872,1749875,1749899
+/jackrabbit/oak/trunk:1733615,1733875,1733913,1733929,1734230,1734254,1734279,1734941,1735052,1735405,1735484,1735549,1735564,1735588,1735622,1735638,1735919,1735983,1736176,1737309-1737310,1737334,1737349,1737998,1738004,1738775,1738795,1738833,1738950,1738957,1738963,1739894,1740116,1740625-1740626,1740971,1741032,1741339,1741343,1742520,1742888,1742916,1743097,1743172,1743343,1744265,1744959,1745038,1745197,1745368,1746086,1746117,1746342,1746345,1746696,1746981,1747341-1747342,1747492,1747512,1748505,1748553,1748870,1749275,1749350,1749464,1749475,1749645,1749662,1749815,1749872,1749875,1749899,1750287
/jackrabbit/trunk:1345480
Modified: jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java?rev=1750292&r1=1750291&r2=1750292&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java (original)
+++ jackrabbit/oak/branches/1.4/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ResurrectNodeAfterRevisionGCTest.java Mon Jun 27 07:47:01 2016
@@ -166,6 +166,63 @@ public class ResurrectNodeAfterRevisionG
});
}
+ @Test
+ public void resurrectInvalidateWithModified() throws Exception {
+ resurrectInvalidateWithModified(new Invalidate() {
+ @Override
+ public void perform(DocumentStore store, Iterable<String> ids) {
+ store.invalidateCache(ids);
+ }
+ });
+ }
+
+ @Test
+ public void resurrectInvalidateAllWithModified() throws Exception {
+ resurrectInvalidateWithModified(new Invalidate() {
+ @Override
+ public void perform(DocumentStore store, Iterable<String> ids) {
+ store.invalidateCache();
+ }
+ });
+ }
+
+ @Test
+ public void resurrectInvalidateIndividualWithModified() throws Exception {
+ resurrectInvalidateWithModified(new Invalidate() {
+ @Override
+ public void perform(DocumentStore store, Iterable<String> ids) {
+ for (String id : ids) {
+ store.invalidateCache(Collection.NODES, id);
+ }
+ }
+ });
+ }
+
+ private void resurrectInvalidateWithModified(Invalidate inv)
+ throws Exception {
+ UpdateOp op = new UpdateOp(getIdFromPath("/foo"), true);
+ op.set(Document.ID, op.getId());
+ op.set("p", 0);
+ op.set(NodeDocument.MODIFIED_IN_SECS, 50);
+ assertTrue(ds1.create(Collection.NODES, Lists.newArrayList(op)));
+ NodeDocument doc = ds2.find(Collection.NODES, op.getId());
+ assertNotNull(doc);
+ assertEquals(0L, doc.get("p"));
+ assertEquals(50L, (long) doc.getModified());
+
+ ds1.remove(Collection.NODES, op.getId());
+ // recreate with different value for 'p'
+ op.set("p", 1);
+ op.set(NodeDocument.MODIFIED_IN_SECS, 55);
+ assertTrue(ds1.create(Collection.NODES, Lists.newArrayList(op)));
+
+ inv.perform(ds2, Lists.newArrayList(op.getId()));
+ doc = ds2.find(Collection.NODES, op.getId());
+ assertNotNull(doc);
+ assertEquals(1L, doc.get("p"));
+ assertEquals(55L, (long) doc.getModified());
+ }
+
private void resurrectInvalidate(Invalidate inv) throws Exception {
UpdateOp op = new UpdateOp(getIdFromPath("/foo"), true);
op.set(Document.ID, op.getId());