cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1094809 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
Date Mon, 18 Apr 2011 22:57:57 GMT
Author: jbellis
Date: Mon Apr 18 22:57:57 2011
New Revision: 1094809

URL: http://svn.apache.org/viewvc?rev=1094809&view=rev
Log:
add assert that repair keys arrive in-order
patch by jbellis; reviewed by stuhood for CASSANDRA-2316

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=1094809&r1=1094808&r2=1094809&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
Mon Apr 18 22:57:57 2011
@@ -272,6 +272,7 @@ public class AntiEntropyService
         private transient long validated;
         private transient MerkleTree.TreeRange range;
         private transient MerkleTree.TreeRangeIterator ranges;
+        private transient DecoratedKey lastKey;
 
         public final static MerkleTree.RowHash EMPTY_ROW = new MerkleTree.RowHash(null, new
byte[0]);
         
@@ -342,6 +343,10 @@ public class AntiEntropyService
          */
         public void add(AbstractCompactedRow row)
         {
+            assert lastKey == null || lastKey.compareTo(row.key) < 0
+                   : "row " + row.key + " received out of order wrt " + lastKey;
+            lastKey = row.key;
+
             if (mintoken != null)
             {
                 assert ranges != null : "Validator was not prepared()";



Mime
View raw message