You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2015/08/29 00:07:13 UTC

[2/8] cassandra git commit: merge from 2.2

merge from 2.2


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

Branch: refs/heads/trunk
Commit: e805f1466b8589ad79bafe1f9ad16c4206525036
Parents: 56ec3c8 8bc32ba
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Aug 28 17:01:36 2015 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Aug 28 17:01:36 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  3 +
 NEWS.txt                                        |  6 ++
 conf/cassandra.yaml                             |  4 +-
 .../cassandra/config/DatabaseDescriptor.java    | 72 +++++++++++++++++++-
 4 files changed, 81 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e805f146/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index a2cf9c8,7aec3bc..bf40dd2
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,50 -1,11 +1,53 @@@
 -2.2.1
 +3.0.0-beta2
 + * Fix Materialized View builder when adding multiple MVs (CASSANDRA-10156)
 + * Choose better poolingOptions for protocol v4 in cassandra-stress (CASSANDRA-10182)
 + * Fix LWW bug affecting Materialized Views (CASSANDRA-10197)
 + * Ensures frozen sets and maps are always sorted (CASSANDRA-10162)
 + * Don't deadlock when flushing CFS backed custom indexes (CASSANDRA-10181)
 + * Fix double flushing of secondary index tables (CASSANDRA-10180)
 + * Fix incorrect handling of range tombstones in thrift (CASSANDRA-10046)
 + * Only use batchlog when paired materialized view replica is remote (CASSANDRA-10061)
 + * Reuse TemporalRow when updating multiple MaterializedViews (CASSANDRA-10060)
 + * Validate gc_grace_seconds for batchlog writes and MVs (CASSANDRA-9917)
 + * Fix sstablerepairedset (CASSANDRA-10132)
 +Merged from 2.2:
+  * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks
+    (CASSANDRA-10199)
+  * Fix race during construction of commit log (CASSANDRA-10049)
   * Fix LeveledCompactionStrategyTest (CASSANDRA-9757)
   * Fix broken UnbufferedDataOutputStreamPlus.writeUTF (CASSANDRA-10203)
 + * (cqlsh) default load-from-file encoding to utf-8 (CASSANDRA-9898)
 + * Avoid returning Permission.NONE when failing to query users table (CASSANDRA-10168)
   * (cqlsh) add CLEAR command (CASSANDRA-10086)
   * Support string literals as Role names for compatibility (CASSANDRA-10135)
 +Merged from 2.1:
 + * Change streaming_socket_timeout_in_ms default to 1 hour (CASSANDRA-8611)
 + * (cqlsh) update list of CQL keywords (CASSANDRA-9232)
 +
 +
 +3.0.0-beta1
 + * Redesign secondary index API (CASSANDRA-9459, 7771, 9041)
 + * Fix throwing ReadFailure instead of ReadTimeout on range queries (CASSANDRA-10125)
 + * Rewrite hinted handoff (CASSANDRA-6230)
 + * Fix query on static compact tables (CASSANDRA-10093)
 + * Fix race during construction of commit log (CASSANDRA-10049)
 + * Add option to only purge repaired tombstones (CASSANDRA-6434)
 + * Change authorization handling for MVs (CASSANDRA-9927)
 + * Add custom JMX enabled executor for UDF sandbox (CASSANDRA-10026)
 + * Fix row deletion bug for Materialized Views (CASSANDRA-10014)
 + * Support mixed-version clusters with Cassandra 2.1 and 2.2 (CASSANDRA-9704)
 + * Fix multiple slices on RowSearchers (CASSANDRA-10002)
 + * Fix bug in merging of collections (CASSANDRA-10001)
 + * Optimize batchlog replay to avoid full scans (CASSANDRA-7237)
 + * Repair improvements when using vnodes (CASSANDRA-5220)
 + * Disable scripted UDFs by default (CASSANDRA-9889)
 + * Bytecode inspection for Java-UDFs (CASSANDRA-9890)
 + * Use byte to serialize MT hash length (CASSANDRA-9792)
 + * Replace usage of Adler32 with CRC32 (CASSANDRA-8684)
 + * Fix migration to new format from 2.1 SSTable (CASSANDRA-10006)
 + * SequentialWriter should extend BufferedDataOutputStreamPlus (CASSANDRA-9500)
 + * Use the same repairedAt timestamp within incremental repair session (CASSANDRA-9111)
 +Merged from 2.2:
   * Allow count(*) and count(1) to be use as normal aggregation (CASSANDRA-10114)
   * An NPE is thrown if the column name is unknown for an IN relation (CASSANDRA-10043)
   * Apply commit_failure_policy to more errors on startup (CASSANDRA-9749)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e805f146/NEWS.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e805f146/conf/cassandra.yaml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e805f146/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 01455ac,b7e3eaa..ba283b4
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -483,14 -487,33 +487,41 @@@ public class DatabaseDescripto
              conf.commitlog_directory += File.separator + "commitlog";
          }
  
 +        if (conf.hints_directory == null)
 +        {
 +            conf.hints_directory = System.getProperty("cassandra.storagedir", null);
 +            if (conf.hints_directory == null)
 +                throw new ConfigurationException("hints_directory is missing and -Dcassandra.storagedir is not set", false);
 +            conf.hints_directory += File.separator + "hints";
 +        }
 +
+         if (conf.commitlog_total_space_in_mb == null)
+         {
+             int preferredSize = 8192;
+             int minSize = 0;
+             try
+             {
+                 // use 1/4 of available space.  See discussion on #10013 and #10199
+                 minSize = Ints.checkedCast((guessFileStore(conf.commitlog_directory).getTotalSpace() / 1048576) / 4);
+             }
+             catch (IOException e)
+             {
+                 logger.debug("Error checking disk space", e);
+                 throw new ConfigurationException(String.format("Unable to check disk space available to %s. Perhaps the Cassandra user does not have the necessary permissions",
+                                                                conf.commitlog_directory), e);
+             }
+             if (minSize < preferredSize)
+             {
+                 logger.warn("Small commitlog volume detected at {}; setting commitlog_total_space_in_mb to {}.  You can override this in cassandra.yaml",
+                             conf.commitlog_directory, minSize);
+                 conf.commitlog_total_space_in_mb = minSize;
+             }
+             else
+             {
+                 conf.commitlog_total_space_in_mb = preferredSize;
+             }
+         }
+ 
          if (conf.saved_caches_directory == null)
          {
              conf.saved_caches_directory = System.getProperty("cassandra.storagedir", null);
@@@ -511,11 -535,24 +543,26 @@@
          {
              if (datadir.equals(conf.commitlog_directory))
                  throw new ConfigurationException("commitlog_directory must not be the same as any data_file_directories", false);
 +            if (datadir.equals(conf.hints_directory))
 +                throw new ConfigurationException("hints_directory must not be the same as any data_file_directories", false);
              if (datadir.equals(conf.saved_caches_directory))
                  throw new ConfigurationException("saved_caches_directory must not be the same as any data_file_directories", false);
+ 
+             try
+             {
+                 dataFreeBytes += guessFileStore(datadir).getUnallocatedSpace();
+             }
+             catch (IOException e)
+             {
+                 logger.debug("Error checking disk space", e);
+                 throw new ConfigurationException(String.format("Unable to check disk space available to %s. Perhaps the Cassandra user does not have the necessary permissions",
+                                                                datadir), e);
+             }
          }
+         if (dataFreeBytes < 64L * 1024 * 1048576) // 64 GB
+             logger.warn("Only {} MB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots",
+                         dataFreeBytes / 1048576);
+ 
  
          if (conf.commitlog_directory.equals(conf.saved_caches_directory))
              throw new ConfigurationException("saved_caches_directory must not be the same as the commitlog_directory", false);
@@@ -620,21 -653,27 +667,40 @@@
          }
          if (seedProvider.getSeeds().size() == 0)
              throw new ConfigurationException("The seed provider lists no seeds.", false);
 +
 +        if (conf.user_defined_function_fail_timeout < 0)
 +            throw new ConfigurationException("user_defined_function_fail_timeout must not be negative", false);
 +        if (conf.user_defined_function_warn_timeout < 0)
 +            throw new ConfigurationException("user_defined_function_warn_timeout must not be negative", false);
 +
 +        if (conf.user_defined_function_fail_timeout < conf.user_defined_function_warn_timeout)
 +            throw new ConfigurationException("user_defined_function_warn_timeout must less than user_defined_function_fail_timeout", false);
 +
 +        if (conf.max_mutation_size_in_kb == null)
 +            conf.max_mutation_size_in_kb = conf.commitlog_segment_size_in_mb * 1024 / 2;
 +        else if (conf.commitlog_segment_size_in_mb * 1024 < 2 * conf.max_mutation_size_in_kb)
 +            throw new ConfigurationException("commitlog_segment_size_in_mb must be at least twice the size of max_mutation_size_in_kb / 1024", false);
      }
  
+     private static FileStore guessFileStore(String dir) throws IOException
+     {
+         Path path = Paths.get(dir);
+         while (true)
+         {
+             try
+             {
+                 return Files.getFileStore(path);
+             }
+             catch (IOException e)
+             {
+                 if (e instanceof NoSuchFileException)
+                     path = path.getParent();
+                 else
+                     throw e;
+             }
+         }
+     }
+ 
      private static IEndpointSnitch createEndpointSnitch(String snitchClassName) throws ConfigurationException
      {
          if (!snitchClassName.contains("."))