jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1466849 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
Date Thu, 11 Apr 2013 12:34:10 GMT
Author: mreutegg
Date: Thu Apr 11 12:34:09 2013
New Revision: 1466849

URL: http://svn.apache.org/r1466849
Log:
OAK-619 Lock-free MongoMK implementation
- Log MongoMK initialization
- Ignore unmerged branches from other MongoMK cluster node

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java?rev=1466849&r1=1466848&r2=1466849&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
Thu Apr 11 12:34:09 2013
@@ -189,6 +189,7 @@ public class MongoMK implements MicroKer
                         .build();
         
         init();
+        LOG.info("Initialized MongoMK with clusterNodeId: {}", clusterId);
     }
     
     void init() {
@@ -521,8 +522,17 @@ public class MongoMK implements MicroKer
         if (value == null) {
             return false;
         }
-        if (value.equals("true") && !branchCommits.containsKey(readRevision)) {
-            return true;
+        if (value.equals("true")) {
+            if (!branchCommits.containsKey(readRevision)) {
+                return true;
+            }
+        } else {
+            // branch commit
+            if (Revision.fromString(value).getClusterId() != clusterId) {
+                // this is an unmerged branch commit from another cluster node,
+                // hence never visible to us
+                return false;
+            }
         }
         return includeRevision(revision, readRevision);
     }



Mime
View raw message