cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r958049 - in /cassandra/trunk: ./ debian/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/concurrent/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/commitlog/ src/java/org/apache/cas...
Date Fri, 25 Jun 2010 17:44:56 GMT
Author: jbellis
Date: Fri Jun 25 17:44:55 2010
New Revision: 958049

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

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/debian/cassandra.default
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
    cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
    cassandra/trunk/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6:922689-956385
+/cassandra/branches/cassandra-0.6:922689-958048
 /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-915439

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Fri Jun 25 17:44:55 2010
@@ -58,6 +58,9 @@ dev
  * remove inactive stream managers after AES streams files (CASSANDRA-1169)
  * add JMX metrics for row-level bloom filter false positives (CASSANDRA-1212)
  * added a redhat init script to contrib (CASSANDRA-1201)
+ * use midpoint when bootstrapping a new machine into range with not
+   much data yet instead of random token (CASSANDRA-1112)
+ * kill server on OOM in executor stage as well as Thrift (CASSANDRA-1226)
 
 
 0.6.2

Modified: cassandra/trunk/debian/cassandra.default
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/cassandra.default?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/debian/cassandra.default (original)
+++ cassandra/trunk/debian/cassandra.default Fri Jun 25 17:44:55 2010
@@ -10,7 +10,7 @@ JVM_MAX_MEM="1G"
 # Specifies the initial size (in bytes) of memory allocation. Must be
 # a multiple of 1024 greater than 1MB. You can append the letters K or
 # M to indicate kilobytes or megabytes respectively. 
-JVM_START_MEM="128M"
+JVM_START_MEM="256"
 
 # Specifies any additional arguments to the JVM.
-JVM_EXTRA_OPTS="-XX:SurvivorRatio=128 -XX:TargetSurvivorRatio=90 -XX:+AggressiveOpts -XX:+UseParNewGC
-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:MaxTenuringThreshold=0"
+JVM_EXTRA_OPTS="-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8
-XX:MaxTenuringThreshold=1 -XX:+HeapDumpOnOutOfMemoryError"

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-956385
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-958048
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-956385
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-958048
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-956385
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-958048
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-956385
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-958048
 /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-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 25 17:44:55 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-956385
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-958048
 /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-903502

Modified: cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
Fri Jun 25 17:44:55 2010
@@ -92,7 +92,7 @@ public class DebuggableThreadPoolExecuto
             }
             catch (ExecutionException e)
             {
-                logger.error("Error in executor futuretask", e);
+                Thread.getDefaultUncaughtExceptionHandler().uncaughtException(Thread.currentThread(),
e);
             }
         }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Fri Jun 25
17:44:55 2010
@@ -172,8 +172,7 @@ public class HintedHandOffManager
             
     private static void deliverHintsToEndpoint(InetAddress endpoint) throws IOException,
DigestMismatchException, InvalidRequestException, TimeoutException
     {
-        if (logger_.isDebugEnabled())
-          logger_.debug("Started hinted handoff for endpoint " + endpoint);
+        logger_.info("Started hinted handoff for endpoint " + endpoint);
 
         // 1. Get the key of the endpoint we need to handoff
         // 2. For each column read the list of rows: subcolumns are KS + SEPARATOR + CF
@@ -181,6 +180,7 @@ public class HintedHandOffManager
         // 4. Force a flush
         // 5. Do major compaction to clean up all deletes etc.
         DecoratedKey epkey =  StorageService.getPartitioner().decorateKey(endpoint.getAddress());
+        int rowsReplayed = 0;
         ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
         byte[] startColumn = ArrayUtils.EMPTY_BYTE_ARRAY;
         while (true)
@@ -198,22 +198,31 @@ public class HintedHandOffManager
                 {
                     String[] parts = getTableAndCFNames(tableCF.name());
                     if (sendMessage(endpoint, parts[0], parts[1], keyColumn.name()))
+                    {
                         deleteHintKey(endpoint.getAddress(), keyColumn.name(), tableCF.name());
+                        rowsReplayed++;
+                    }
+
+                    startColumn = keyColumn.name();
                 }
             }
         }
-        hintStore.forceFlush();
-        try
-        {
-            CompactionManager.instance.submitMajor(hintStore, 0, Integer.MAX_VALUE).get();
-        }
-        catch (Exception e)
+
+        if (rowsReplayed > 0)
         {
-            throw new RuntimeException(e);
+            hintStore.forceFlush();
+            try
+            {
+                CompactionManager.instance.submitMajor(hintStore, 0, Integer.MAX_VALUE).get();
+            }
+            catch (Exception e)
+            {
+                throw new RuntimeException(e);
+            }
         }
 
-        if (logger_.isDebugEnabled())
-          logger_.debug("Finished hinted handoff for endpoint " + endpoint);
+        logger_.info(String.format("Finished hinted handoff of %s rows to endpoint %s",
+                                   rowsReplayed, endpoint));
     }
 
     /** called when a keyspace is dropped or rename. newTable==null in the case of a drop.
*/

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Fri Jun 25 17:44:55 2010
@@ -180,7 +180,8 @@ public class Memtable implements Compara
 
     public String toString()
     {
-        return "Memtable(" + cfs.getColumnFamilyName() + ")@" + hashCode();
+        return String.format("Memtable-%s@%s(%s bytes, %s operations)",
+                             cfs.getColumnFamilyName(), hashCode(), currentThroughput, currentOperations);
     }
 
     /**

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java Fri Jun 25 17:44:55
2010
@@ -285,6 +285,7 @@ public class CommitLog
                 StageManager.getStage(StageManager.MUTATION_STAGE).submit(runnable);
             }
             reader.close();
+            logger.info("Finished reading " + file);
         }
 
         // wait for all the writes to finish on the mutation stage

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java Fri Jun
25 17:44:55 2010
@@ -90,18 +90,11 @@ public class AntiEntropyService
 
     // millisecond lifetime to store trees before they become stale
     public final static long TREE_STORE_TIMEOUT = 600000;
-    // max millisecond frequency that natural (automatic) repairs should run at
-    public final static long NATURAL_REPAIR_FREQUENCY = 3600000;
 
     // singleton enforcement
     public static final AntiEntropyService instance = new AntiEntropyService();
 
     /**
-     * Map of CFPair to timestamp of the beginning of the last natural repair.
-     */
-    private final ConcurrentMap<CFPair, Long> naturalRepairs;
-
-    /**
      * Map of column families to remote endpoints that need to rendezvous. The
      * first endpoint to arrive at the rendezvous will store its tree in the
      * appropriate slot of the TreePair object, and the second to arrive will
@@ -121,7 +114,6 @@ public class AntiEntropyService
      */
     protected AntiEntropyService()
     {
-        naturalRepairs = new ConcurrentHashMap<CFPair, Long>();
         trees = new HashMap<CFPair, ExpiringMap<InetAddress, TreePair>>();
         sessions = new ConcurrentHashMap<String, BlockingQueue<TreeRequest>>();
     }
@@ -283,34 +275,6 @@ public class AntiEntropyService
     }
 
     /**
-     * Should only be used for testing.
-     */
-    void clearNaturalRepairs_TestsOnly()
-    {
-        naturalRepairs.clear();
-    }
-
-    /**
-     * @param cf The column family.
-     * @return True if enough time has elapsed since the beginning of the last natural repair.
-     */
-    private boolean shouldRunNaturally(CFPair cf)
-    {
-        Long curtime = System.currentTimeMillis();
-        Long pretime = naturalRepairs.putIfAbsent(cf, curtime);
-        if (pretime != null)
-        {
-            if (pretime < (curtime - NATURAL_REPAIR_FREQUENCY))
-                // replace pretime with curtime, unless someone beat us to it
-                return naturalRepairs.replace(cf, pretime, curtime);
-            // need to wait longer
-            logger.debug("Skipping natural repair: last occurred " + (curtime - pretime)
+ "ms ago.");
-            return false;
-        }
-        return true;
-    }
-
-    /**
      * Return a Validator object which can be used to collect hashes for a column family.
      * A Validator must be prepared() before use, and completed() afterward.
      *
@@ -331,7 +295,7 @@ public class AntiEntropyService
         if (DatabaseDescriptor.getReplicationFactor(table) < 2)
             return new NoopValidator();
         CFPair cfpair = new CFPair(table, cf);
-        if (initiator == null && !shouldRunNaturally(cfpair))
+        if (initiator == null)
             return new NoopValidator();
         return new Validator(cfpair);
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Fri Jun 25 17:44:55
2010
@@ -1354,7 +1354,7 @@ public class StorageService implements I
         FBUtilities.sortSampledKeys(keys, range);
 
         if (keys.size() < 3)
-            return partitioner_.getRandomToken();
+            return partitioner_.midpoint(range.left, range.right);
         else
             return keys.get(keys.size() / 2).token;
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java Fri Jun 25 17:44:55
2010
@@ -79,7 +79,7 @@ public class CassandraDaemon extends org
         {
             public void uncaughtException(Thread t, Throwable e)
             {
-                logger.error("Fatal exception in thread " + t, e);
+                logger.error("Uncaught exception in thread " + t, e);
                 if (e instanceof OutOfMemoryError)
                 {
                     System.exit(100);

Modified: cassandra/trunk/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java?rev=958049&r1=958048&r2=958049&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/service/AntiEntropyServiceTest.java Fri
Jun 25 17:44:55 2010
@@ -97,14 +97,8 @@ public class AntiEntropyServiceTest exte
     @Test
     public void testGetValidator() throws Throwable
     {
-        aes.clearNaturalRepairs_TestsOnly();
-
         // not major
         assert aes.getValidator(tablename, cfname, null, false) instanceof NoopValidator;
-        // adds entry to naturalRepairs
-        assert aes.getValidator(tablename, cfname, null, true) instanceof Validator;
-        // blocked by entry in naturalRepairs
-        assert aes.getValidator(tablename, cfname, null, true) instanceof NoopValidator;
         // triggered manually
         assert aes.getValidator(tablename, cfname, REMOTE, true) instanceof Validator;
     }



Mime
View raw message