cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aweisb...@apache.org
Subject [3/3] cassandra git commit: Merge branch 'cassandra-3.11' into trunk
Date Mon, 08 May 2017 20:50:50 GMT
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: 2304363e4eae665a1ba7f238c81a9237906394da
Parents: 07c11ca 1a83efe
Author: Ariel Weisberg <aweisberg@apple.com>
Authored: Mon May 8 16:27:57 2017 -0400
Committer: Ariel Weisberg <aweisberg@apple.com>
Committed: Mon May 8 16:40:19 2017 -0400

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 src/antlr/Parser.g                              |  5 +++-
 .../apache/cassandra/cql3/CqlParserTest.java    | 30 ++++++++++++++++++++
 .../cql3/validation/operations/AlterTest.java   | 19 +++++++++++++
 .../cql3/validation/operations/CreateTest.java  | 14 +++++++++
 5 files changed, 68 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2304363e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 6b5d114,3166780..93096fe
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,68 -1,5 +1,69 @@@
 +4.0
 + * Add multiple table operation support to cassandra-stress (CASSANDRA-8780)
 + * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262)
 + * Fix WriteResponseHandlerTest is sensitive to test execution order (CASSANDRA-13421)
 + * Improve incremental repair logging (CASSANDRA-13468)
 + * Start compaction when incremental repair finishes (CASSANDRA-13454)
 + * Add repair streaming preview (CASSANDRA-13257)
 + * Cleanup isIncremental/repairedAt usage (CASSANDRA-13430)
 + * Change protocol to allow sending key space independent of query string (CASSANDRA-10145)
 + * Make gc_log and gc_warn settable at runtime (CASSANDRA-12661)
 + * Take number of files in L0 in account when estimating remaining compaction tasks (CASSANDRA-13354)
 + * Skip building views during base table streams on range movements (CASSANDRA-13065)
 + * Improve error messages for +/- operations on maps and tuples (CASSANDRA-13197)
 + * Remove deprecated repair JMX APIs (CASSANDRA-11530)
 + * Fix version check to enable streaming keep-alive (CASSANDRA-12929)
 + * Make it possible to monitor an ideal consistency level separate from actual consistency
level (CASSANDRA-13289)
 + * Outbound TCP connections ignore internode authenticator (CASSANDRA-13324)
 + * Upgrade junit from 4.6 to 4.12 (CASSANDRA-13360)
 + * Cleanup ParentRepairSession after repairs (CASSANDRA-13359)
 + * Incremental repair not streaming correct sstables (CASSANDRA-13328)
 + * Upgrade the jna version to 4.3.0 (CASSANDRA-13300)
 + * Add the currentTimestamp, currentDate, currentTime and currentTimeUUID functions (CASSANDRA-13132)
 + * Remove config option index_interval (CASSANDRA-10671)
 + * Reduce lock contention for collection types and serializers (CASSANDRA-13271)
 + * Make it possible to override MessagingService.Verb ids (CASSANDRA-13283)
 + * Avoid synchronized on prepareForRepair in ActiveRepairService (CASSANDRA-9292)
 + * Adds the ability to use uncompressed chunks in compressed files (CASSANDRA-10520)
 + * Don't flush sstables when streaming for incremental repair (CASSANDRA-13226)
 + * Remove unused method (CASSANDRA-13227)
 + * Fix minor bugs related to #9143 (CASSANDRA-13217)
 + * Output warning if user increases RF (CASSANDRA-13079)
 + * Remove pre-3.0 streaming compatibility code for 4.0 (CASSANDRA-13081)
 + * Add support for + and - operations on dates (CASSANDRA-11936)
 + * Fix consistency of incrementally repaired data (CASSANDRA-9143)
 + * Increase commitlog version (CASSANDRA-13161)
 + * Make TableMetadata immutable, optimize Schema (CASSANDRA-9425)
 + * Refactor ColumnCondition (CASSANDRA-12981)
 + * Parallelize streaming of different keyspaces (CASSANDRA-4663)
 + * Improved compactions metrics (CASSANDRA-13015)
 + * Speed-up start-up sequence by avoiding un-needed flushes (CASSANDRA-13031)
 + * Use Caffeine (W-TinyLFU) for on-heap caches (CASSANDRA-10855)
 + * Thrift removal (CASSANDRA-11115)
 + * Remove pre-3.0 compatibility code for 4.0 (CASSANDRA-12716)
 + * Add column definition kind to dropped columns in schema (CASSANDRA-12705)
 + * Add (automate) Nodetool Documentation (CASSANDRA-12672)
 + * Update bundled cqlsh python driver to 3.7.0 (CASSANDRA-12736)
 + * Reject invalid replication settings when creating or altering a keyspace (CASSANDRA-12681)
 + * Clean up the SSTableReader#getScanner API wrt removal of RateLimiter (CASSANDRA-12422)
 + * Use new token allocation for non bootstrap case as well (CASSANDRA-13080)
 + * Avoid byte-array copy when key cache is disabled (CASSANDRA-13084)
 + * Require forceful decommission if number of nodes is less than replication factor (CASSANDRA-12510)
 + * Allow IN restrictions on column families with collections (CASSANDRA-12654)
 + * Log message size in trace message in OutboundTcpConnection (CASSANDRA-13028)
 + * Add timeUnit Days for cassandra-stress (CASSANDRA-13029)
 + * Add mutation size and batch metrics (CASSANDRA-12649)
 + * Add method to get size of endpoints to TokenMetadata (CASSANDRA-12999)
 + * Expose time spent waiting in thread pool queue (CASSANDRA-8398)
 + * Conditionally update index built status to avoid unnecessary flushes (CASSANDRA-12969)
 + * cqlsh auto completion: refactor definition of compaction strategy options (CASSANDRA-12946)
 + * Add support for arithmetic operators (CASSANDRA-11935)
 + * Add histogram for delay to deliver hints (CASSANDRA-13234)
 + * Fix cqlsh automatic protocol downgrade regression (CASSANDRA-13307)
 +
 +
  3.11.0
+  * Reject multiple values for a key in CQL grammar. (CASSANDRA-13369)
   * UDA fails without input rows (CASSANDRA-13399)
   * Fix compaction-stress by using daemonInitialization (CASSANDRA-13188)
   * V5 protocol flags decoding broken (CASSANDRA-13443)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2304363e/src/antlr/Parser.g
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2304363e/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
index dce72f9,b0ee566..9cfb3c9
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java
@@@ -229,49 -229,25 +229,68 @@@ public class AlterTest extends CQLTeste
                                    "max_threshold", "32")));
      }
  
 +    /**
 +     * Test {@link ConfigurationException} thrown on alter keyspace to no DC option in replication
configuration.
 +     */
 +    @Test
 +    public void testAlterKeyspaceWithNoOptionThrowsConfigurationException() throws Throwable
 +    {
 +        // Create keyspaces
 +        execute("CREATE KEYSPACE testABC WITH replication={ 'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 3 }");
 +        execute("CREATE KEYSPACE testXYZ WITH replication={ 'class' : 'SimpleStrategy',
'replication_factor' : 3 }");
 +
 +        // Try to alter the created keyspace without any option
 +        assertInvalidThrow(ConfigurationException.class, "ALTER KEYSPACE testABC WITH replication={
'class' : 'NetworkTopologyStrategy' }");
 +        assertInvalidThrow(ConfigurationException.class, "ALTER KEYSPACE testXYZ WITH replication={
'class' : 'SimpleStrategy' }");
 +
 +        // Make sure that the alter works as expected
 +        execute("ALTER KEYSPACE testABC WITH replication={ 'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 2 }");
 +        execute("ALTER KEYSPACE testXYZ WITH replication={ 'class' : 'SimpleStrategy', 'replication_factor'
: 2 }");
 +
 +        // clean up
 +        execute("DROP KEYSPACE IF EXISTS testABC");
 +        execute("DROP KEYSPACE IF EXISTS testXYZ");
 +    }
 +
 +    /**
 +     * Test {@link ConfigurationException} thrown when altering a keyspace to invalid DC
option in replication configuration.
 +     */
 +    @Test
 +    public void testAlterKeyspaceWithNTSOnlyAcceptsConfiguredDataCenterNames() throws Throwable
 +    {
 +        // Create a keyspace with expected DC name.
 +        execute("CREATE KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 2 }");
 +
 +        // try modifying the keyspace
 +        assertInvalidThrow(ConfigurationException.class, "ALTER KEYSPACE testABC WITH replication
= { 'class' : 'NetworkTopologyStrategy', 'INVALID_DC' : 2 }");
 +        execute("ALTER KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 3 }");
 +
 +        // Mix valid and invalid, should throw an exception
 +        assertInvalidThrow(ConfigurationException.class, "ALTER KEYSPACE testABC WITH replication={
'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2 , 'INVALID_DC': 1}");
 +
 +        // clean-up
 +        execute("DROP KEYSPACE IF EXISTS testABC");
 +    }
 +
+     @Test
+     public void testAlterKeyspaceWithMultipleInstancesOfSameDCThrowsSyntaxException() throws
Throwable
+     {
+         try
+         {
+             // Create a keyspace
 -            execute("CREATE KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'dc1' : 2}");
++            execute("CREATE KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 2}");
+ 
+             // try modifying the keyspace
 -            assertInvalidThrow(SyntaxException.class, "ALTER KEYSPACE testABC WITH replication
= {'class' : 'NetworkTopologyStrategy', 'dc1' : 2, 'dc1' : 3 }");
 -            execute("ALTER KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'dc1' : 3}");
++            assertInvalidThrow(SyntaxException.class, "ALTER KEYSPACE testABC WITH replication
= {'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2, '" + DATA_CENTER + "' :
3 }");
++            execute("ALTER KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 3}");
+         }
+         finally
+         {
+             // clean-up
+             execute("DROP KEYSPACE IF EXISTS testABC");
+         }
+     }
+ 
      /**
       * Test for bug of 5232,
       * migrated from cql_tests.py:TestCQL.alter_bug_test()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2304363e/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
index 1784556,3eaec23..40fa99e
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java
@@@ -496,33 -499,20 +496,47 @@@ public class CreateTest extends CQLTest
          execute("DROP KEYSPACE testXYZ");
      }
  
 +    /**
 +     *  Test {@link ConfigurationException} is thrown on create keyspace with invalid DC
option in replication configuration .
 +     */
 +    @Test
 +    public void testCreateKeyspaceWithNTSOnlyAcceptsConfiguredDataCenterNames() throws Throwable
 +    {
 +        assertInvalidThrow(ConfigurationException.class, "CREATE KEYSPACE testABC WITH replication
= { 'class' : 'NetworkTopologyStrategy', 'INVALID_DC' : 2 }");
 +        execute("CREATE KEYSPACE testABC WITH replication = {'class' : 'NetworkTopologyStrategy',
'" + DATA_CENTER + "' : 2 }");
 +
 +        // Mix valid and invalid, should throw an exception
 +        assertInvalidThrow(ConfigurationException.class, "CREATE KEYSPACE testXYZ WITH replication={
'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2 , 'INVALID_DC': 1}");
 +
 +        // clean-up
 +        execute("DROP KEYSPACE IF EXISTS testABC");
 +        execute("DROP KEYSPACE IF EXISTS testXYZ");
 +    }
 +
 +    /**
 +     * Test {@link ConfigurationException} is thrown on create keyspace without any options.
 +     */
 +    @Test
 +    public void testConfigurationExceptionThrownWhenCreateKeyspaceWithNoOptions() throws
Throwable
 +    {
 +        assertInvalidThrow(ConfigurationException.class, "CREATE KEYSPACE testXYZ with replication
= { 'class': 'NetworkTopologyStrategy' }");
 +        assertInvalidThrow(ConfigurationException.class, "CREATE KEYSPACE testXYZ WITH replication
= { 'class' : 'SimpleStrategy' }");
 +    }
 +
+     @Test
+     public void testCreateKeyspaceWithMultipleInstancesOfSameDCThrowsException() throws
Throwable
+     {
+         try
+         {
 -            assertInvalidThrow(SyntaxException.class, "CREATE KEYSPACE testABC WITH replication
= {'class' : 'NetworkTopologyStrategy', 'dc1' : 2, 'dc1' : 3 }");
++            assertInvalidThrow(SyntaxException.class, "CREATE KEYSPACE testABC WITH replication
= {'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2, '" + DATA_CENTER + "' :
3 }");
+         }
+         finally
+         {
+             // clean-up
+             execute("DROP KEYSPACE IF EXISTS testABC");
+         }
+     }
+ 
      /**
       * Test create and drop table
       * migrated from cql_tests.py:TestCQL.table_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message