cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1201037 - in /cassandra/branches/cassandra-1.0: CHANGES.txt src/java/org/apache/cassandra/db/ColumnFamilyStore.java src/java/org/apache/cassandra/db/HintedHandOffManager.java
Date Fri, 11 Nov 2011 19:52:59 GMT
Author: jbellis
Date: Fri Nov 11 19:52:59 2011
New Revision: 1201037

URL: http://svn.apache.org/viewvc?rev=1201037&view=rev
Log:
Fix incomplete deletion of delivered hints
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-3466

Modified:
    cassandra/branches/cassandra-1.0/CHANGES.txt
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/HintedHandOffManager.java

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1201037&r1=1201036&r2=1201037&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Fri Nov 11 19:52:59 2011
@@ -11,6 +11,7 @@
  * fix incorrect size exception during streaming of counters (CASSANDRA-3481)
  * (CQL) fix for counter decrement syntax (CASSANDRA-3418)
  * Fix race introduced by CASSANDRA-2503 (CASSANDRA-3482)
+ * Fix incomplete deletion of delivered hints (CASSANDRA-3466)
 Merged from 0.8:
  * Make counter shard merging thread safe (CASSANDRA-3178)
  * fix updating CF row_cache_provider (CASSANDRA-3414)

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1201037&r1=1201036&r2=1201037&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Fri Nov 11 19:52:59 2011
@@ -1782,7 +1782,6 @@ public class ColumnFamilyStore implement
         return data.getEstimatedColumnCountHistogram();
     }
 
-    @Override
     public double getCompressionRatio()
     {
         return data.getCompressionRatio();
@@ -1905,4 +1904,10 @@ public class ColumnFamilyStore implement
             oldest = Math.min(oldest, memtable.creationTime());
         return oldest;
     }
+
+    public boolean isEmpty()
+    {
+        DataTracker.View view = data.getView();
+        return view.sstables.isEmpty() && view.memtable.getOperations() == 0 &&
view.memtablesPendingFlush.isEmpty();
+    }
 }

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=1201037&r1=1201036&r2=1201037&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/HintedHandOffManager.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/HintedHandOffManager.java
Fri Nov 11 19:52:59 2011
@@ -230,7 +230,7 @@ public class HintedHandOffManager implem
     private void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, DigestMismatchException,
InvalidRequestException, TimeoutException, InterruptedException
     {
         ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
-        if (hintStore.getSSTables().isEmpty())
+        if (hintStore.isEmpty())
             return; // nothing to do, don't confuse users by logging a no-op handoff
 
         try
@@ -289,7 +289,7 @@ public class HintedHandOffManager implem
                     if (ByteBufferUtil.string(subColumn.name()).contains(SEPARATOR_08))
                     {
                         logger_.debug("0.8-style hint found.  This should have been taken
care of by purgeIncompatibleHints");
-                        deleteHint(tokenBytes, hint.name(), subColumn.timestamp());
+                        deleteHint(tokenBytes, hint.name(), hint.maxTimestamp());
                         continue page;
                     }
                 }
@@ -307,7 +307,7 @@ public class HintedHandOffManager implem
 
                 if (sendMutation(endpoint, rm))
                 {
-                    deleteHint(tokenBytes, hint.name(), versionColumn.timestamp());
+                    deleteHint(tokenBytes, hint.name(), hint.maxTimestamp());
                     rowsReplayed++;
                 }
                 else



Mime
View raw message