cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r892303 - in /incubator/cassandra/trunk: ./ interface/gen-java/org/apache/cassandra/service/ src/java/org/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/gms/ src/java/org/apache/cassandra/utils/ test/unit/org/
Date Fri, 18 Dec 2009 16:24:10 GMT
Author: jbellis
Date: Fri Dec 18 16:24:05 2009
New Revision: 892303

URL: http://svn.apache.org/viewvc?rev=892303&view=rev
Log:
merge from 0.5

Modified:
    incubator/cassandra/trunk/   (props changed)
    incubator/cassandra/trunk/CHANGES.txt
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
  (props changed)
    incubator/cassandra/trunk/src/java/org/   (props changed)
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RecoveryManager.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java
    incubator/cassandra/trunk/test/unit/org/   (props changed)

Propchange: incubator/cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,3 +1,3 @@
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5:888872-891425
+/incubator/cassandra/branches/cassandra-0.5:888872-892299

Modified: incubator/cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/CHANGES.txt?rev=892303&r1=892302&r2=892303&view=diff
==============================================================================
--- incubator/cassandra/trunk/CHANGES.txt (original)
+++ incubator/cassandra/trunk/CHANGES.txt Fri Dec 18 16:24:05 2009
@@ -4,8 +4,11 @@
  * fix data streaming on windows (CASSANDRA-630)
  * GC compacted sstables after cleanup and compaction (CASSANDRA-621)
  * Speed up anti-entropy validation (CASSANDRA-629)
+ * Fix anti-entropy assertion error (CASSANDRA-639)
  * Fix pending range conflicts when bootstapping or moving
    multiple nodes at once (CASSANDRA-603)
+ * Include dead nodes in gossip to avoid a variety of problems
+   (CASSANDRA-634)
 
 
 0.5.0 beta 2

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-892299
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-892299
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-892299
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-892299
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,5 +1,5 @@
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-892299
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:749219-794428
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:749219-768588

Propchange: incubator/cassandra/trunk/src/java/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/src/java/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/src/java/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/src/java/org:888872-892299
 /incubator/cassandra/trunk/src/java/org:749219-769885

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RecoveryManager.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RecoveryManager.java?rev=892303&r1=892302&r2=892303&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RecoveryManager.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RecoveryManager.java Fri Dec
18 16:24:05 2009
@@ -54,5 +54,6 @@
         logger_.info("Replaying " + StringUtils.join(files, ", "));
         CommitLog.open().recover(files);
         FileUtils.delete(files);
+        logger_.info("Log replay complete");
     }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=892303&r1=892302&r2=892303&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Fri Dec 18 16:24:05
2009
@@ -241,20 +241,20 @@
         int maxVersion = getMaxEndPointStateVersion(epState);
         gDigests.add( new GossipDigest(localEndPoint_, generation, maxVersion) );
 
-        List<InetAddress> endpoints = new ArrayList<InetAddress>( liveEndpoints_
);
+        List<InetAddress> endpoints = new ArrayList<InetAddress>(endPointStateMap_.keySet());
         Collections.shuffle(endpoints, random_);
-        for ( InetAddress liveEndPoint : endpoints )
+        for (InetAddress endPoint : endpoints)
         {
-            epState = endPointStateMap_.get(liveEndPoint);
-            if ( epState != null )
+            epState = endPointStateMap_.get(endPoint);
+            if (epState != null)
             {
                 generation = epState.getHeartBeatState().getGeneration();
                 maxVersion = getMaxEndPointStateVersion(epState);
-                gDigests.add( new GossipDigest(liveEndPoint, generation, maxVersion) );
+                gDigests.add(new GossipDigest(endPoint, generation, maxVersion));
             }
             else
             {
-            	gDigests.add( new GossipDigest(liveEndPoint, 0, 0) );
+            	gDigests.add(new GossipDigest(endPoint, 0, 0));
             }
         }
 
@@ -541,13 +541,33 @@
 
     private void handleNewJoin(InetAddress ep, EndPointState epState)
     {
-    	logger_.info("Node " + ep + " has now joined.");
+    	logger_.info("Node " + ep + " is now part of the cluster");
+        handleMajorStateChange(ep, epState, false);
+    }
+
+    private void handleGenerationChange(InetAddress ep, EndPointState epState)
+    {
+        logger_.info("Node " + ep + " has restarted, now UP again");
+        handleMajorStateChange(ep, epState, true);
+    }
+
+    /**
+     * This method is called whenever there is a "big" change in ep state (either a previously
+     * unknown node or a generation change for a known node). If the node is new, it will
be
+     * initially marked as dead. It will be marked alive as soon as another piece of gossip
+     * arrives. On the other hand if the node is already known (generation change), we will
+     * immediately mark it alive.
+     *
+     * @param ep endpoint
+     * @param epState EndPointState for the endpoint
+     * @param isKnownNode is this node familiar to us already (present in endPointStateMap)
+     */
+    private void handleMajorStateChange(InetAddress ep, EndPointState epState, boolean isKnownNode)
+    {
         endPointStateMap_.put(ep, epState);
-        isAlive(ep, epState, true);
+        isAlive(ep, epState, isKnownNode);
         for (IEndPointStateChangeSubscriber subscriber : subscribers_)
-        {
             subscriber.onJoin(ep, epState);
-        }
     }
 
     synchronized void applyStateLocally(Map<InetAddress, EndPointState> epStateMap)
@@ -571,7 +591,7 @@
 
             	if (remoteGeneration > localGeneration)
             	{
-            		handleNewJoin(ep, remoteState);
+                    handleGenerationChange(ep, remoteState);
             	}
             	else if ( remoteGeneration == localGeneration )
             	{
@@ -601,7 +621,6 @@
 
         if ( remoteHbState.getGeneration() > localHbState.getGeneration() )
         {
-            markAlive(addr, localState);
             localState.setHeartBeatState(remoteHbState);
         }
         if ( localHbState.getGeneration() == remoteHbState.getGeneration() )

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java?rev=892303&r1=892302&r2=892303&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/MerkleTree.java Fri Dec
18 16:24:05 2009
@@ -51,7 +51,7 @@
 {
     private static final long serialVersionUID = 2L;
 
-    public static final byte RECOMMENDED_DEPTH = Byte.MAX_VALUE;
+    public static final byte RECOMMENDED_DEPTH = Byte.MAX_VALUE - 1;
 
     public static final int CONSISTENT = 0;
     public static final int FULLY_INCONSISTENT = 1;
@@ -73,6 +73,7 @@
      */
     public MerkleTree(IPartitioner partitioner, byte hashdepth, long maxsize)
     {
+        assert hashdepth < Byte.MAX_VALUE;
         this.partitioner = partitioner;
         this.hashdepth = hashdepth;
         this.maxsize = maxsize;

Propchange: incubator/cassandra/trunk/test/unit/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:24:05 2009
@@ -1,4 +1,4 @@
 /incubator/cassandra/branches/cassandra-0.3/test/unit/org:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/test/unit/org:810145-834239,834349-834350
-/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-891425
+/incubator/cassandra/branches/cassandra-0.5/test/unit/org:888872-892299
 /incubator/cassandra/trunk/test/unit/org:749219-768583



Mime
View raw message