cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/6] git commit: Compact hints after partial replay to clean out tombstones patch by jbellis; reviewed by ayeschenko for CASSANDRA-6666
Date Fri, 07 Feb 2014 16:31:02 GMT
Updated Branches:
  refs/heads/cassandra-1.2 beefd0b8c -> ab5372f0f
  refs/heads/cassandra-2.0 56a615d73 -> fe571421d
  refs/heads/trunk ef6d42cfc -> 65e09fa5b


Compact hints after partial replay to clean out tombstones
patch by jbellis; reviewed by ayeschenko for CASSANDRA-6666


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ab5372f0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ab5372f0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ab5372f0

Branch: refs/heads/cassandra-1.2
Commit: ab5372f0f3b3650556242a21a9d463b4f1e93efd
Parents: beefd0b
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Feb 7 10:30:20 2014 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Feb 7 10:30:20 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/db/HintedHandOffManager.java      | 26 ++++++++++++--------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ab5372f0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5511e01..82783f8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,7 @@
  * Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
  * Fix partition and range deletes not triggering flush (CASSANDRA-6655)
  * Fix mean cells and mean row size per sstable calculations (CASSANDRA-6667)
+ * Compact hints after partial replay to clean out tombstones (CASSANDRA-6666)
 
 
 1.2.15

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ab5372f0/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index ede49e4..b1ccbc3 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -309,6 +309,7 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
                            / (StorageService.instance.getTokenMetadata().getAllEndpoints().size()
- 1);
         RateLimiter rateLimiter = RateLimiter.create(throttleInKB == 0 ? Double.MAX_VALUE
: throttleInKB * 1024);
 
+        boolean finished = false;
         delivery:
         while (true)
         {
@@ -323,13 +324,17 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
                                                                      (int) (System.currentTimeMillis()
/ 1000));
 
             if (pagingFinished(hintsPage, startColumn))
+            {
+                logger.info("Finished hinted handoff of {} rows to endpoint {}", rowsReplayed,
endpoint);
+                finished = true;
                 break;
+            }
 
             // check if node is still alive and we should continue delivery process
             if (!FailureDetector.instance.isAlive(endpoint))
             {
                 logger.info("Endpoint {} died during hint delivery; aborting ({} delivered)",
endpoint, rowsReplayed);
-                return;
+                break;
             }
 
             List<WriteResponseHandler> responseHandlers = Lists.newArrayList();
@@ -420,20 +425,21 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
                 catch (WriteTimeoutException e)
                 {
                     logger.info("Timed out replaying hints to {}; aborting ({} delivered)",
endpoint, rowsReplayed);
-                    return;
+                    break delivery;
                 }
             }
         }
 
-        logger.info("Finished hinted handoff of {} rows to endpoint {}", rowsReplayed, endpoint);
-
-        try
+        if (finished || rowsReplayed.get() >= DatabaseDescriptor.getTombstoneDebugThreshold())
         {
-            compact().get();
-        }
-        catch (Exception e)
-        {
-            throw new RuntimeException(e);
+            try
+            {
+                compact().get();
+            }
+            catch (Exception e)
+            {
+                throw new RuntimeException(e);
+            }
         }
     }
 


Mime
View raw message