[jira] [Commented] (CASSANDRA-13078) Increase unittest test.runners to speed up the test
[ https://issues.apache.org/jira/browse/CASSANDRA-13078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078983#comment-16078983 ] Jay Zhuang commented on CASSANDRA-13078: Updated the patch based on comments, if any value is invalid, fail back to 1. please review: | [trunk|https://github.com/apache/cassandra/compare/trunk...cooldoger:13078-trunk?expand=1] | [circle ci | https://circleci.com/gh/cooldoger/cassandra/9] | > Increase unittest test.runners to speed up the test > --- > > Key: CASSANDRA-13078 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13078 > Project: Cassandra > Issue Type: Improvement > Components: Testing >Reporter: Jay Zhuang >Assignee: Jay Zhuang >Priority: Minor > Attachments: unittest.png, unittest_time.png > > > The unittest takes very long time to run (about 40 minutes on a macbook). By > overriding the > [{{test.runners}}|https://github.com/apache/cassandra/blob/cassandra-3.0/build.xml#L62], > it could speed up the test, especially on powerful servers. Currently, it's > set to 1 by default. I would like to propose to set the {{test.runners}} by > the [number of CPUs > dynamically|http://www.iliachemodanov.ru/en/blog-en/15-tools/ant/48-get-number-of-processors-in-ant-en]. > For example, {{runners = num_cores / 4}}. What do you guys think? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-1361) Introduce ability to change seed addresses on a running node
[ https://issues.apache.org/jira/browse/CASSANDRA-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078879#comment-16078879 ] Robin Mahony commented on CASSANDRA-1361: - what about during a recovery scenario? Today if you want to replace a dead seed node, you need to promote a new seed node first before you bootstrap a node node in place of the recovered seed node. This means to replace a seed node a rolling restart of ALL Cassandra nodes is required; which is very extreme for what should be a simple procedure. I believe that is what this jira description is all about. Does this not seem like a valid use case for such a feature? > Introduce ability to change seed addresses on a running node > > > Key: CASSANDRA-1361 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1361 > Project: Cassandra > Issue Type: New Feature >Reporter: Valentino Volonghi > > Since seed nodes are not only used for bootstrap but also for gossiping it > would be really useful to be able to replace seed addresses on running nodes > without restarting them since at the moment you can only change seed nodes by > changing configuration file and then restarting cassandra. > My usecase is to be able to replace failed seed nodes in cassandra without > having to proceed to a rolling restart of the cluster. And also to be able to > start X nodes that initially might be independent but then would all join an > existing ring by changing their seeds. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13577) Fix dynamic endpoint snitch for sub-millisecond use case
[ https://issues.apache.org/jira/browse/CASSANDRA-13577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078856#comment-16078856 ] Simon Zhou commented on CASSANDRA-13577: Now with this patch, badness_threshold looks too sensitive and triggers traffic imbalance. I created CASSANDRA-13679 to follow up on that. > Fix dynamic endpoint snitch for sub-millisecond use case > > > Key: CASSANDRA-13577 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13577 > Project: Cassandra > Issue Type: Bug >Reporter: Simon Zhou >Assignee: Simon Zhou > Fix For: 3.0.x > > > This is a follow up of https://issues.apache.org/jira/browse/CASSANDRA-6908. > After disabling severity (CASSANDRA-11737/CASSANDRA-11738) in a few > production clusters, I observed that the scores for all the endpoints are > mostly 0.0. Through debugging, I found this is caused by that these clusters > have p50 latency well below 1ms and the network latency is also <0.1ms (round > trip). Be noted that we use p50 sampled read latency and millisecond as time > unit. That means, if the latency is mostly below 1ms, the score will be 0. > This is definitely not something we want. To make DES work for these > sub-millisecond use cases, we should change the timeunit to at least > microsecond, or even nanosecond. I'll provide a patch soon. > Evidence of the p50 latency: > {code} > nodetool tablehistograms > Percentile SSTables Write Latency Read LatencyPartition Size > Cell Count > (micros) (micros) (bytes) > > 50% 2.00 35.43454.83 20501 > 3 > 75% 2.00 42.51654.95 29521 > 3 > 95% 3.00182.79943.13 61214 > 3 > 98% 4.00263.21 1131.75 73457 > 3 > 99% 4.00315.85 1358.10 88148 > 3 > Min 0.00 9.89 11.8761 > 3 > Max 5.00654.95 129557.75943127 > 3 > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Created] (CASSANDRA-13679) Add option to customize badness_threshold in dynamic endpoint snitch
Simon Zhou created CASSANDRA-13679: -- Summary: Add option to customize badness_threshold in dynamic endpoint snitch Key: CASSANDRA-13679 URL: https://issues.apache.org/jira/browse/CASSANDRA-13679 Project: Cassandra Issue Type: Improvement Reporter: Simon Zhou Assignee: Simon Zhou Attachments: Screen Shot 2017-07-07 at 5.01.48 PM.png I'm working on tuning dynamic endpoint snitch and looks like the default value (0.1) for Config.dynamic_snitch_badness_threshold is too sensitive and causes traffic imbalance among nodes, especially with my patch for CASSANDRA-13577. So we should: 1. Revisit the default value. 2. Add an option to allow customize badness_threshold during bootstrap. This ticket is to track #2. I attached a screenshot to show that, after increasing badness_threshold from 0.1 to 1.0 by using patch from CASSANDRA-12179, the traffic imbalance is gone. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13078) Increase unittest test.runners to speed up the test
[ https://issues.apache.org/jira/browse/CASSANDRA-13078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078719#comment-16078719 ] Ariel Weisberg commented on CASSANDRA-13078: RAM is part of it as well. Assume 4 gigs per runner. Also sanity check that cores isn't negative or 0. Seen to many things report # of cores incorrectly. > Increase unittest test.runners to speed up the test > --- > > Key: CASSANDRA-13078 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13078 > Project: Cassandra > Issue Type: Improvement > Components: Testing >Reporter: Jay Zhuang >Assignee: Jay Zhuang >Priority: Minor > Attachments: unittest.png, unittest_time.png > > > The unittest takes very long time to run (about 40 minutes on a macbook). By > overriding the > [{{test.runners}}|https://github.com/apache/cassandra/blob/cassandra-3.0/build.xml#L62], > it could speed up the test, especially on powerful servers. Currently, it's > set to 1 by default. I would like to propose to set the {{test.runners}} by > the [number of CPUs > dynamically|http://www.iliachemodanov.ru/en/blog-en/15-tools/ant/48-get-number-of-processors-in-ant-en]. > For example, {{runners = num_cores / 4}}. What do you guys think? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-10726) Read repair inserts should not be blocking
[ https://issues.apache.org/jira/browse/CASSANDRA-10726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078474#comment-16078474 ] Xiaolong Jiang commented on CASSANDRA-10726: [~bdeggleston]I made a few changes based on your comments and squashed to one commit. Please take a look and let me know what you think. https://github.com/apache/cassandra/pull/94/files > Read repair inserts should not be blocking > -- > > Key: CASSANDRA-10726 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10726 > Project: Cassandra > Issue Type: Improvement > Components: Coordination >Reporter: Richard Low >Assignee: Xiaolong Jiang > Fix For: 3.0.x > > > Today, if there’s a digest mismatch in a foreground read repair, the insert > to update out of date replicas is blocking. This means, if it fails, the read > fails with a timeout. If a node is dropping writes (maybe it is overloaded or > the mutation stage is backed up for some other reason), all reads to a > replica set could fail. Further, replicas dropping writes get more out of > sync so will require more read repair. > The comment on the code for why the writes are blocking is: > {code} > // wait for the repair writes to be acknowledged, to minimize impact on any > replica that's > // behind on writes in case the out-of-sync row is read multiple times in > quick succession > {code} > but the bad side effect is that reads timeout. Either the writes should not > be blocking or we should return success for the read even if the write times > out. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13078) Increase unittest test.runners to speed up the test
[ https://issues.apache.org/jira/browse/CASSANDRA-13078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078404#comment-16078404 ] Jay Zhuang commented on CASSANDRA-13078: [~aweisberg] How about {{runners = floor(sqrt(numCores))}}? Here is the patch: | [trunk|https://github.com/apache/cassandra/compare/trunk...cooldoger:13078-trunk?expand=1] | [circle ci | https://circleci.com/gh/cooldoger/cassandra/6] | > Increase unittest test.runners to speed up the test > --- > > Key: CASSANDRA-13078 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13078 > Project: Cassandra > Issue Type: Improvement > Components: Testing >Reporter: Jay Zhuang >Assignee: Jay Zhuang >Priority: Minor > Attachments: unittest.png, unittest_time.png > > > The unittest takes very long time to run (about 40 minutes on a macbook). By > overriding the > [{{test.runners}}|https://github.com/apache/cassandra/blob/cassandra-3.0/build.xml#L62], > it could speed up the test, especially on powerful servers. Currently, it's > set to 1 by default. I would like to propose to set the {{test.runners}} by > the [number of CPUs > dynamically|http://www.iliachemodanov.ru/en/blog-en/15-tools/ant/48-get-number-of-processors-in-ant-en]. > For example, {{runners = num_cores / 4}}. What do you guys think? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Assigned] (CASSANDRA-13078) Increase unittest test.runners to speed up the test
[ https://issues.apache.org/jira/browse/CASSANDRA-13078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jay Zhuang reassigned CASSANDRA-13078: -- Assignee: Jay Zhuang > Increase unittest test.runners to speed up the test > --- > > Key: CASSANDRA-13078 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13078 > Project: Cassandra > Issue Type: Improvement > Components: Testing >Reporter: Jay Zhuang >Assignee: Jay Zhuang >Priority: Minor > Attachments: unittest.png, unittest_time.png > > > The unittest takes very long time to run (about 40 minutes on a macbook). By > overriding the > [{{test.runners}}|https://github.com/apache/cassandra/blob/cassandra-3.0/build.xml#L62], > it could speed up the test, especially on powerful servers. Currently, it's > set to 1 by default. I would like to propose to set the {{test.runners}} by > the [number of CPUs > dynamically|http://www.iliachemodanov.ru/en/blog-en/15-tools/ant/48-get-number-of-processors-in-ant-en]. > For example, {{runners = num_cores / 4}}. What do you guys think? -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-13646) Bind parameters of collection types are not properly validated
[ https://issues.apache.org/jira/browse/CASSANDRA-13646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-13646: --- Resolution: Fixed Status: Resolved (was: Ready to Commit) > Bind parameters of collection types are not properly validated > > > Key: CASSANDRA-13646 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13646 > Project: Cassandra > Issue Type: Bug >Reporter: Benjamin Lerer >Assignee: Benjamin Lerer > Fix For: 2.2.11, 3.0.15, 3.11.1, 4.0 > > > It looks like C* is not validating properly the bind parameters for > collection types. If an element of the collection is invalid the value will > not be rejected and might cause an Exception later on. > The problem can be reproduced with the following test: > {code} > @Test > public void testInvalidQueries() throws Throwable > { > createTable("CREATE TABLE %s (k int PRIMARY KEY, s > frozen>>)"); > execute("INSERT INTO %s (k, s) VALUES (0, ?)", > set(tuple(1,"1",1.0,1), tuple(2,"2",2.0,2))); > } > {code} > The invalid Tuple will cause an "IndexOutOfBoundsException: Index: 3, Size: 3" -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-13646) Bind parameters of collection types are not properly validated
[ https://issues.apache.org/jira/browse/CASSANDRA-13646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-13646: --- Fix Version/s: 4.0 3.11.1 3.0.15 2.2.11 > Bind parameters of collection types are not properly validated > > > Key: CASSANDRA-13646 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13646 > Project: Cassandra > Issue Type: Bug >Reporter: Benjamin Lerer >Assignee: Benjamin Lerer > Fix For: 2.2.11, 3.0.15, 3.11.1, 4.0 > > > It looks like C* is not validating properly the bind parameters for > collection types. If an element of the collection is invalid the value will > not be rejected and might cause an Exception later on. > The problem can be reproduced with the following test: > {code} > @Test > public void testInvalidQueries() throws Throwable > { > createTable("CREATE TABLE %s (k int PRIMARY KEY, s > frozen>>)"); > execute("INSERT INTO %s (k, s) VALUES (0, ?)", > set(tuple(1,"1",1.0,1), tuple(2,"2",2.0,2))); > } > {code} > The invalid Tuple will cause an "IndexOutOfBoundsException: Index: 3, Size: 3" -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-13592) Null Pointer exception at SELECT JSON statement
[ https://issues.apache.org/jira/browse/CASSANDRA-13592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-13592: --- Resolution: Fixed Fix Version/s: 4.0 3.11.1 3.0.15 2.2.11 Status: Resolved (was: Ready to Commit) Committed into 2.2 at cb6fad3efcd7cd3dc87d02ca7e8e97eb277a66ab and merged into 3.0, 3.11 and trunk. > Null Pointer exception at SELECT JSON statement > --- > > Key: CASSANDRA-13592 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13592 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: Debian Linux >Reporter: Wyss Philipp >Assignee: ZhaoYang > Labels: beginner > Fix For: 2.2.11, 3.0.15, 3.11.1, 4.0 > > Attachments: system.log > > > A Nulll pointer exception appears when the command > {code} > SELECT JSON * FROM examples.basic; > ---MORE--- > message="java.lang.NullPointerException"> > Examples.basic has the following description (DESC examples.basic;): > CREATE TABLE examples.basic ( > key frozen> PRIMARY KEY, > wert text > ) WITH bloom_filter_fp_chance = 0.01 > AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} > AND comment = '' > AND compaction = {'class': > 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', > 'max_threshold': '32', 'min_threshold': '4'} > AND compression = {'chunk_length_in_kb': '64', 'class': > 'org.apache.cassandra.io.compress.LZ4Compressor'} > AND crc_check_chance = 1.0 > AND dclocal_read_repair_chance = 0.1 > AND default_time_to_live = 0 > AND gc_grace_seconds = 864000 > AND max_index_interval = 2048 > AND memtable_flush_period_in_ms = 0 > AND min_index_interval = 128 > AND read_repair_chance = 0.0 > AND speculative_retry = '99PERCENTILE'; > {code} > The error appears after the ---MORE--- line. > The field "wert" has a JSON formatted string. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-13592) Null Pointer exception at SELECT JSON statement
[ https://issues.apache.org/jira/browse/CASSANDRA-13592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-13592: --- Status: Ready to Commit (was: Patch Available) > Null Pointer exception at SELECT JSON statement > --- > > Key: CASSANDRA-13592 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13592 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: Debian Linux >Reporter: Wyss Philipp >Assignee: ZhaoYang > Labels: beginner > Attachments: system.log > > > A Nulll pointer exception appears when the command > {code} > SELECT JSON * FROM examples.basic; > ---MORE--- > message="java.lang.NullPointerException"> > Examples.basic has the following description (DESC examples.basic;): > CREATE TABLE examples.basic ( > key frozen> PRIMARY KEY, > wert text > ) WITH bloom_filter_fp_chance = 0.01 > AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} > AND comment = '' > AND compaction = {'class': > 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', > 'max_threshold': '32', 'min_threshold': '4'} > AND compression = {'chunk_length_in_kb': '64', 'class': > 'org.apache.cassandra.io.compress.LZ4Compressor'} > AND crc_check_chance = 1.0 > AND dclocal_read_repair_chance = 0.1 > AND default_time_to_live = 0 > AND gc_grace_seconds = 864000 > AND max_index_interval = 2048 > AND memtable_flush_period_in_ms = 0 > AND min_index_interval = 128 > AND read_repair_chance = 0.0 > AND speculative_retry = '99PERCENTILE'; > {code} > The error appears after the ---MORE--- line. > The field "wert" has a JSON formatted string. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13592) Null Pointer exception at SELECT JSON statement
[ https://issues.apache.org/jira/browse/CASSANDRA-13592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078309#comment-16078309 ] Benjamin Lerer commented on CASSANDRA-13592: Thanks for the changes. The paging tests were not using paging. I fixed that before committing. > Null Pointer exception at SELECT JSON statement > --- > > Key: CASSANDRA-13592 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13592 > Project: Cassandra > Issue Type: Bug > Components: CQL > Environment: Debian Linux >Reporter: Wyss Philipp >Assignee: ZhaoYang > Labels: beginner > Attachments: system.log > > > A Nulll pointer exception appears when the command > {code} > SELECT JSON * FROM examples.basic; > ---MORE--- > message="java.lang.NullPointerException"> > Examples.basic has the following description (DESC examples.basic;): > CREATE TABLE examples.basic ( > key frozen> PRIMARY KEY, > wert text > ) WITH bloom_filter_fp_chance = 0.01 > AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} > AND comment = '' > AND compaction = {'class': > 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', > 'max_threshold': '32', 'min_threshold': '4'} > AND compression = {'chunk_length_in_kb': '64', 'class': > 'org.apache.cassandra.io.compress.LZ4Compressor'} > AND crc_check_chance = 1.0 > AND dclocal_read_repair_chance = 0.1 > AND default_time_to_live = 0 > AND gc_grace_seconds = 864000 > AND max_index_interval = 2048 > AND memtable_flush_period_in_ms = 0 > AND min_index_interval = 128 > AND read_repair_chance = 0.0 > AND speculative_retry = '99PERCENTILE'; > {code} > The error appears after the ---MORE--- line. > The field "wert" has a JSON formatted string. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[12/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java index 177f286,000..b41b81f mode 100644,00..100644 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java @@@ -1,1817 -1,0 +1,1810 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.cql3.validation.operations; + +import org.junit.Test; + - import com.datastax.driver.core.SimpleStatement; - +import org.apache.cassandra.cql3.CQLTester; + +public class SelectGroupByTest extends CQLTester +{ +@Test +public void testGroupByWithoutPaging() throws Throwable +{ +for (String compactOption : new String[] { "", " WITH COMPACT STORAGE" }) +{ +createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, primary key (a, b, c, d))" ++ compactOption); + +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 1, 3, 6)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 2, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 3, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (2, 2, 3, 3, 6)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (2, 4, 3, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (3, 3, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (4, 8, 2, 12, 24)"); + +// Makes sure that we have some tombstones +execute("DELETE FROM %s WHERE a = 1 AND b = 3 AND c = 2 AND d = 12"); +execute("DELETE FROM %s WHERE a = 3"); + +// Range queries +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a"), + row(1, 2, 6, 4L, 24), + row(2, 2, 6, 2L, 12), + row(4, 8, 24, 1L, 24)); + +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b"), + row(1, 2, 6, 2L, 12), + row(1, 4, 12, 2L, 24), + row(2, 2, 6, 1L, 6), + row(2, 4, 12, 1L, 12), + row(4, 8, 24, 1L, 24)); + +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s WHERE b = 2 GROUP BY a, b ALLOW FILTERING"), + row(1, 2, 6, 2L, 12), + row(2, 2, 6, 1L, 6)); + +assertEmpty(execute("SELECT a, b, e, count(b), max(e) FROM %s WHERE b IN () GROUP BY a, b ALLOW FILTERING")); + +// Range queries without aggregates +assertRows(execute("SELECT a, b, c, d FROM %s GROUP BY a, b, c"), + row(1, 2, 1, 3), + row(1, 2, 2, 6), + row(1, 4, 2, 6), + row(2, 2, 3, 3), + row(2, 4, 3, 6), + row(4, 8, 2, 12)); + +assertRows(execute("SELECT a, b, c, d FROM %s GROUP BY a, b"), + row(1, 2, 1, 3), + row(1, 4, 2, 6), + row(2, 2, 3, 3), + row(2, 4, 3, 6), + row(4, 8, 2, 12)); + +// Range query with LIMIT +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b LIMIT 2"), + row(1, 2, 6, 2L, 12), + row(1, 4, 12, 2L, 24)); + +// Range queries with PER PARTITION LIMIT +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b PER PARTITION LIMIT 1"), + row(1, 2, 6, 2
[04/14] cassandra git commit: Fix toJSONString for the UDT, tuple and collection types
Fix toJSONString for the UDT, tuple and collection types patch by ZhaoYang; reviewed by Benjamin Lerer for CASSANDRA-13592 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cb6fad3e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb6fad3e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb6fad3e Branch: refs/heads/trunk Commit: cb6fad3efcd7cd3dc87d02ca7e8e97eb277a66ab Parents: b77e11c Author: ZhaoYang Authored: Fri Jul 7 16:09:15 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 16:12:27 2017 +0200 -- CHANGES.txt | 1 + .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 6 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 19 +- .../cql3/validation/entities/JsonTest.java | 167 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 08c6e48..6740c9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java index b90e127..799d636 100644 --- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java +++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java @@ -101,7 +101,16 @@ public abstract class AbstractType implements Comparator **/ public abstract Term fromJSONObject(Object parsed) throws MarshalException; -/** Converts a value to a JSON string. */ +/** + * Converts the specified value into its JSON representation. + * + * The buffer position will stay the same. + * + * + * @param buffer the value to convert + * @param protocolVersion the protocol version to use for the conversion + * @return a JSON string representing the specified value + */ public String toJSONString(ByteBuffer buffer, int protocolVersion) { return '"' + getSerializer().deserialize(buffer).toString() + '"'; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/EmptyType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/EmptyType.java b/src/java/org/apache/cassandra/db/marshal/EmptyType.java index f82d767..e5abe5b 100644 --- a/src/java/org/apache/cassandra/db/marshal/EmptyType.java +++ b/src/java/org/apache/cassandra/db/marshal/EmptyType.java @@ -65,6 +65,12 @@ public class EmptyType extends AbstractType return new Constants.Value(ByteBufferUtil.EMPTY_BYTE_BUFFER); } +@Override +public String toJSONString(ByteBuffer buffer, int protocolVersion) +{ +return "\"\""; +} + public TypeSerializer getSerializer() { return EmptySerializer.instance; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/ListType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/ListType.java b/src/java/org/apache/cassandra/db/marshal/ListType.java index 9334ad0..ed44616 100644 --- a/src/java/org/apache/cassandra/db/marshal/ListType.java +++ b/src/java/org/apache/cassandra/db/marshal/ListType.java @@ -208,13 +208,14 @@ public class ListType extends CollectionType> public static String setOrListToJsonString(ByteBuffer buffer, AbstractType elementsType, int protocolVersion) { +ByteBuffer value = buffer.duplicate(); StringBuilder sb = new StringBuilder("["); -int size = CollectionSerializer.readCollectionSize(buffer, protocolVersion); +int size = CollectionSerializer.readCollectionSize(value, protocolVersion); for (int i = 0; i < size; i++) { if (i > 0) sb.append(", "); - sb.append(elementsType.toJSONString(CollectionSe
[11/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java -- diff --cc test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java index 000,f7795c7..0cebd9e mode 00,100644..100644 --- a/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java +++ b/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java @@@ -1,0 -1,320 +1,320 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.cassandra.db.marshal; + + import static org.junit.Assert.assertEquals; + + import java.nio.ByteBuffer; + import org.apache.cassandra.cql3.QueryOptions; -import org.apache.cassandra.transport.Server; ++import org.apache.cassandra.transport.ProtocolVersion; + import org.apache.cassandra.utils.UUIDGen; + import org.codehaus.jackson.map.ObjectMapper; + import org.junit.Test; + + public class JsonConversionTest + { + private static final ObjectMapper JSON_OBJECT_MAPPER = new ObjectMapper(); + + @Test + public void testMap() throws Exception + { + String type = "FrozenType(MapType(TupleType(ListType(Int32Type), ListType(Int32Type)), ListType(Int32Type)))"; + String json = "{" + + "\"[[1, 2, 3], [1, 2, 3]]\": [1, 2, 3], " + + "\"[[1, 2, 3, 4], [1, 2, 3, 4]]\": [1, 2, 3, 4], " + + "\"[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]\": [1, 2, 3, 4, 5]" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testUDT() throws Exception + { + // 6161-> aa + // 78 -> x + String type = "UserType(ks,6161,78:TupleType(ListType(Int32Type), ListType(Int32Type)))"; + String json = "{" + + "\"x\": [[1, 2, 3], [1, 2, 3]]" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testSimpleDate() throws Exception + { + String type = "SimpleDateType"; + String json = "\"1991-06-20\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testDate() throws Exception + { + String type = "DateType"; + String json = "\"1991-06-20 18:00:00.000Z\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testCounterColumn() throws Exception + { + Long value = 1L; + String json = "1"; + assertBytebufferPositionAndOutput(json, value, CounterColumnType.instance); + } + + @Test + public void testTimestamp() throws Exception + { + String type = "TimestampType"; + String json = "\"1991-06-20 18:00:00.000Z\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test(expected = UnsupportedOperationException.class) + public void testDynamicCompositeType() throws Exception + { + String type = "DynamicCompositeType(a=>Int32Type, b=>Int32Type)"; + // not supported + String json = "{" + + "\"a\":1," + + "\"b\":2" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test(expected = UnsupportedOperationException.class) + public void testCompositeType() throws Exception + { + String type = "CompositeType(Int32Type, Int32Type)"; + // not supported + String json = "{" + + "\"a\":1," + + "\"b\":2" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testList() throws Exception + { + String type = "FrozenType(ListType(TupleType(ListType(Int32Type), ListType(Int32Type"; + String json = "[" + + "[[1, 2, 3], [1, 2, 3]], " + + "[[1, 2, 3, 4], [1, 2, 3, 4]], " + + "[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]" + + "]"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testSet() throws Exception + { +
[14/14] cassandra git commit: Merge branch cassandra-3.11 into trunk
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/4d6af175 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4d6af175 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4d6af175 Branch: refs/heads/trunk Commit: 4d6af1752264ef77b144c9fe9d34c244ec5d0242 Parents: 10b397e 48ffad8 Author: Benjamin Lerer Authored: Fri Jul 7 17:35:57 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:35:57 2017 +0200 -- CHANGES.txt | 1 + .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 7 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 6 + .../cql3/validation/entities/JsonTest.java | 168 +- .../operations/SelectGroupByTest.java | 7 - .../db/marshal/JsonConversionTest.java | 320 +++ 10 files changed, 513 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/CHANGES.txt -- diff --cc CHANGES.txt index 569a807,a66f4b3..90fd821 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -96,10 -1,11 +96,11 @@@ 3.11.1 * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) Merged from 3.0: - * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) - * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) Merged from 2.2: + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) * Fix nested Tuples/UDTs validation (CASSANDRA-13646) 3.11.0 http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/src/java/org/apache/cassandra/db/marshal/EmptyType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/src/java/org/apache/cassandra/db/marshal/ListType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/src/java/org/apache/cassandra/db/marshal/MapType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/src/java/org/apache/cassandra/db/marshal/TupleType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d6af175/test/unit/org/apache/cassandra/cql3/CQLTester.java -- diff --cc test/unit/org/apache/cassandra/cql3/CQLTester.java index 6d46a50,2dbcfff..f214c30 --- a/test/unit/org/apache/cassandra/cql3/CQLTester.java +++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java @@@ -43,10 -40,13 +43,11 @@@ import org.slf4j.LoggerFactory import com.datastax.driver.core.*; import com.datastax.driver.core.DataType; import com.datastax.driver.core.ResultSet; + import org.apache.cassandra.SchemaLoader; import org.apache.cassandra.concurrent.ScheduledExecutors; -import org.apache.cassandra.config.CFMetaData; +import org.apache.cassandra.schema.*; import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.cassandra.config.Schema; -import org.apache.cassandra.config.SchemaConstants; import org.apache.cassandra.cql3.functions.FunctionName; import org.apache.cassandra.cql3.functions.ThreadAwareSecurityManager; import org.apache.cassandra.cql3.statements.ParsedStatement; - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[01/14] cassandra git commit: Fix toJSONString for the UDT, tuple and collection types
Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 b77e11cfd -> cb6fad3ef refs/heads/cassandra-3.0 e51c85f2e -> 97fb4d102 refs/heads/cassandra-3.11 b5df3b4c3 -> 48ffad89c refs/heads/trunk 10b397e2a -> 4d6af1752 Fix toJSONString for the UDT, tuple and collection types patch by ZhaoYang; reviewed by Benjamin Lerer for CASSANDRA-13592 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cb6fad3e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb6fad3e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb6fad3e Branch: refs/heads/cassandra-2.2 Commit: cb6fad3efcd7cd3dc87d02ca7e8e97eb277a66ab Parents: b77e11c Author: ZhaoYang Authored: Fri Jul 7 16:09:15 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 16:12:27 2017 +0200 -- CHANGES.txt | 1 + .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 6 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 19 +- .../cql3/validation/entities/JsonTest.java | 167 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 08c6e48..6740c9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java index b90e127..799d636 100644 --- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java +++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java @@ -101,7 +101,16 @@ public abstract class AbstractType implements Comparator **/ public abstract Term fromJSONObject(Object parsed) throws MarshalException; -/** Converts a value to a JSON string. */ +/** + * Converts the specified value into its JSON representation. + * + * The buffer position will stay the same. + * + * + * @param buffer the value to convert + * @param protocolVersion the protocol version to use for the conversion + * @return a JSON string representing the specified value + */ public String toJSONString(ByteBuffer buffer, int protocolVersion) { return '"' + getSerializer().deserialize(buffer).toString() + '"'; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/EmptyType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/EmptyType.java b/src/java/org/apache/cassandra/db/marshal/EmptyType.java index f82d767..e5abe5b 100644 --- a/src/java/org/apache/cassandra/db/marshal/EmptyType.java +++ b/src/java/org/apache/cassandra/db/marshal/EmptyType.java @@ -65,6 +65,12 @@ public class EmptyType extends AbstractType return new Constants.Value(ByteBufferUtil.EMPTY_BYTE_BUFFER); } +@Override +public String toJSONString(ByteBuffer buffer, int protocolVersion) +{ +return "\"\""; +} + public TypeSerializer getSerializer() { return EmptySerializer.instance; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/ListType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/ListType.java b/src/java/org/apache/cassandra/db/marshal/ListType.java index 9334ad0..ed44616 100644 --- a/src/java/org/apache/cassandra/db/marshal/ListType.java +++ b/src/java/org/apache/cassandra/db/marshal/ListType.java @@ -208,13 +208,14 @@ public class ListType extends CollectionType> public static String setOrListToJsonString(ByteBuffer buffer, AbstractType elementsType, int protocolVersion) { +ByteBuffer value = buffer.duplicate(); StringBuilder sb = new StringBuilder("["); -int size = CollectionSerializer.readCollectionSize(buffer, protocolVersion); +int s
[03/14] cassandra git commit: Fix toJSONString for the UDT, tuple and collection types
Fix toJSONString for the UDT, tuple and collection types patch by ZhaoYang; reviewed by Benjamin Lerer for CASSANDRA-13592 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cb6fad3e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb6fad3e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb6fad3e Branch: refs/heads/cassandra-3.11 Commit: cb6fad3efcd7cd3dc87d02ca7e8e97eb277a66ab Parents: b77e11c Author: ZhaoYang Authored: Fri Jul 7 16:09:15 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 16:12:27 2017 +0200 -- CHANGES.txt | 1 + .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 6 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 19 +- .../cql3/validation/entities/JsonTest.java | 167 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 08c6e48..6740c9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java index b90e127..799d636 100644 --- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java +++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java @@ -101,7 +101,16 @@ public abstract class AbstractType implements Comparator **/ public abstract Term fromJSONObject(Object parsed) throws MarshalException; -/** Converts a value to a JSON string. */ +/** + * Converts the specified value into its JSON representation. + * + * The buffer position will stay the same. + * + * + * @param buffer the value to convert + * @param protocolVersion the protocol version to use for the conversion + * @return a JSON string representing the specified value + */ public String toJSONString(ByteBuffer buffer, int protocolVersion) { return '"' + getSerializer().deserialize(buffer).toString() + '"'; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/EmptyType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/EmptyType.java b/src/java/org/apache/cassandra/db/marshal/EmptyType.java index f82d767..e5abe5b 100644 --- a/src/java/org/apache/cassandra/db/marshal/EmptyType.java +++ b/src/java/org/apache/cassandra/db/marshal/EmptyType.java @@ -65,6 +65,12 @@ public class EmptyType extends AbstractType return new Constants.Value(ByteBufferUtil.EMPTY_BYTE_BUFFER); } +@Override +public String toJSONString(ByteBuffer buffer, int protocolVersion) +{ +return "\"\""; +} + public TypeSerializer getSerializer() { return EmptySerializer.instance; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/ListType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/ListType.java b/src/java/org/apache/cassandra/db/marshal/ListType.java index 9334ad0..ed44616 100644 --- a/src/java/org/apache/cassandra/db/marshal/ListType.java +++ b/src/java/org/apache/cassandra/db/marshal/ListType.java @@ -208,13 +208,14 @@ public class ListType extends CollectionType> public static String setOrListToJsonString(ByteBuffer buffer, AbstractType elementsType, int protocolVersion) { +ByteBuffer value = buffer.duplicate(); StringBuilder sb = new StringBuilder("["); -int size = CollectionSerializer.readCollectionSize(buffer, protocolVersion); +int size = CollectionSerializer.readCollectionSize(value, protocolVersion); for (int i = 0; i < size; i++) { if (i > 0) sb.append(", "); - sb.append(elementsType.toJSONString(Col
[09/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java index 177f286,000..b41b81f mode 100644,00..100644 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectGroupByTest.java @@@ -1,1817 -1,0 +1,1810 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cassandra.cql3.validation.operations; + +import org.junit.Test; + - import com.datastax.driver.core.SimpleStatement; - +import org.apache.cassandra.cql3.CQLTester; + +public class SelectGroupByTest extends CQLTester +{ +@Test +public void testGroupByWithoutPaging() throws Throwable +{ +for (String compactOption : new String[] { "", " WITH COMPACT STORAGE" }) +{ +createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, primary key (a, b, c, d))" ++ compactOption); + +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 1, 3, 6)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 2, 2, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 3, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (1, 4, 2, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (2, 2, 3, 3, 6)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (2, 4, 3, 6, 12)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (3, 3, 2, 12, 24)"); +execute("INSERT INTO %s (a, b, c, d, e) VALUES (4, 8, 2, 12, 24)"); + +// Makes sure that we have some tombstones +execute("DELETE FROM %s WHERE a = 1 AND b = 3 AND c = 2 AND d = 12"); +execute("DELETE FROM %s WHERE a = 3"); + +// Range queries +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a"), + row(1, 2, 6, 4L, 24), + row(2, 2, 6, 2L, 12), + row(4, 8, 24, 1L, 24)); + +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b"), + row(1, 2, 6, 2L, 12), + row(1, 4, 12, 2L, 24), + row(2, 2, 6, 1L, 6), + row(2, 4, 12, 1L, 12), + row(4, 8, 24, 1L, 24)); + +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s WHERE b = 2 GROUP BY a, b ALLOW FILTERING"), + row(1, 2, 6, 2L, 12), + row(2, 2, 6, 1L, 6)); + +assertEmpty(execute("SELECT a, b, e, count(b), max(e) FROM %s WHERE b IN () GROUP BY a, b ALLOW FILTERING")); + +// Range queries without aggregates +assertRows(execute("SELECT a, b, c, d FROM %s GROUP BY a, b, c"), + row(1, 2, 1, 3), + row(1, 2, 2, 6), + row(1, 4, 2, 6), + row(2, 2, 3, 3), + row(2, 4, 3, 6), + row(4, 8, 2, 12)); + +assertRows(execute("SELECT a, b, c, d FROM %s GROUP BY a, b"), + row(1, 2, 1, 3), + row(1, 4, 2, 6), + row(2, 2, 3, 3), + row(2, 4, 3, 6), + row(4, 8, 2, 12)); + +// Range query with LIMIT +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b LIMIT 2"), + row(1, 2, 6, 2L, 12), + row(1, 4, 12, 2L, 24)); + +// Range queries with PER PARTITION LIMIT +assertRows(execute("SELECT a, b, e, count(b), max(e) FROM %s GROUP BY a, b PER PARTITION LIMIT 1"), + row(1, 2, 6, 2
[02/14] cassandra git commit: Fix toJSONString for the UDT, tuple and collection types
Fix toJSONString for the UDT, tuple and collection types patch by ZhaoYang; reviewed by Benjamin Lerer for CASSANDRA-13592 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cb6fad3e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb6fad3e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb6fad3e Branch: refs/heads/cassandra-3.0 Commit: cb6fad3efcd7cd3dc87d02ca7e8e97eb277a66ab Parents: b77e11c Author: ZhaoYang Authored: Fri Jul 7 16:09:15 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 16:12:27 2017 +0200 -- CHANGES.txt | 1 + .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 6 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 19 +- .../cql3/validation/entities/JsonTest.java | 167 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index 08c6e48..6740c9e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/AbstractType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java index b90e127..799d636 100644 --- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java +++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java @@ -101,7 +101,16 @@ public abstract class AbstractType implements Comparator **/ public abstract Term fromJSONObject(Object parsed) throws MarshalException; -/** Converts a value to a JSON string. */ +/** + * Converts the specified value into its JSON representation. + * + * The buffer position will stay the same. + * + * + * @param buffer the value to convert + * @param protocolVersion the protocol version to use for the conversion + * @return a JSON string representing the specified value + */ public String toJSONString(ByteBuffer buffer, int protocolVersion) { return '"' + getSerializer().deserialize(buffer).toString() + '"'; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/EmptyType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/EmptyType.java b/src/java/org/apache/cassandra/db/marshal/EmptyType.java index f82d767..e5abe5b 100644 --- a/src/java/org/apache/cassandra/db/marshal/EmptyType.java +++ b/src/java/org/apache/cassandra/db/marshal/EmptyType.java @@ -65,6 +65,12 @@ public class EmptyType extends AbstractType return new Constants.Value(ByteBufferUtil.EMPTY_BYTE_BUFFER); } +@Override +public String toJSONString(ByteBuffer buffer, int protocolVersion) +{ +return "\"\""; +} + public TypeSerializer getSerializer() { return EmptySerializer.instance; http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb6fad3e/src/java/org/apache/cassandra/db/marshal/ListType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/ListType.java b/src/java/org/apache/cassandra/db/marshal/ListType.java index 9334ad0..ed44616 100644 --- a/src/java/org/apache/cassandra/db/marshal/ListType.java +++ b/src/java/org/apache/cassandra/db/marshal/ListType.java @@ -208,13 +208,14 @@ public class ListType extends CollectionType> public static String setOrListToJsonString(ByteBuffer buffer, AbstractType elementsType, int protocolVersion) { +ByteBuffer value = buffer.duplicate(); StringBuilder sb = new StringBuilder("["); -int size = CollectionSerializer.readCollectionSize(buffer, protocolVersion); +int size = CollectionSerializer.readCollectionSize(value, protocolVersion); for (int i = 0; i < size; i++) { if (i > 0) sb.append(", "); - sb.append(elementsType.toJSONString(Coll
[05/14] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/97fb4d10 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/97fb4d10 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/97fb4d10 Branch: refs/heads/cassandra-3.11 Commit: 97fb4d1029f23b53621125493e7582b2f045fdf8 Parents: e51c85f cb6fad3 Author: Benjamin Lerer Authored: Fri Jul 7 17:14:32 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:14:32 2017 +0200 -- CHANGES.txt | 3 +- .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 5 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 11 + .../cql3/validation/entities/JsonTest.java | 170 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/97fb4d10/CHANGES.txt -- diff --cc CHANGES.txt index c98ffd9,6740c9e..8095e25 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,61 -1,16 +1,62 @@@ -2.2.11 - * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) + Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++ * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range t
[08/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java -- diff --cc test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java index 000,f7795c7..0cebd9e mode 00,100644..100644 --- a/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java +++ b/test/unit/org/apache/cassandra/db/marshal/JsonConversionTest.java @@@ -1,0 -1,320 +1,320 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.cassandra.db.marshal; + + import static org.junit.Assert.assertEquals; + + import java.nio.ByteBuffer; + import org.apache.cassandra.cql3.QueryOptions; -import org.apache.cassandra.transport.Server; ++import org.apache.cassandra.transport.ProtocolVersion; + import org.apache.cassandra.utils.UUIDGen; + import org.codehaus.jackson.map.ObjectMapper; + import org.junit.Test; + + public class JsonConversionTest + { + private static final ObjectMapper JSON_OBJECT_MAPPER = new ObjectMapper(); + + @Test + public void testMap() throws Exception + { + String type = "FrozenType(MapType(TupleType(ListType(Int32Type), ListType(Int32Type)), ListType(Int32Type)))"; + String json = "{" + + "\"[[1, 2, 3], [1, 2, 3]]\": [1, 2, 3], " + + "\"[[1, 2, 3, 4], [1, 2, 3, 4]]\": [1, 2, 3, 4], " + + "\"[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]\": [1, 2, 3, 4, 5]" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testUDT() throws Exception + { + // 6161-> aa + // 78 -> x + String type = "UserType(ks,6161,78:TupleType(ListType(Int32Type), ListType(Int32Type)))"; + String json = "{" + + "\"x\": [[1, 2, 3], [1, 2, 3]]" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testSimpleDate() throws Exception + { + String type = "SimpleDateType"; + String json = "\"1991-06-20\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testDate() throws Exception + { + String type = "DateType"; + String json = "\"1991-06-20 18:00:00.000Z\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testCounterColumn() throws Exception + { + Long value = 1L; + String json = "1"; + assertBytebufferPositionAndOutput(json, value, CounterColumnType.instance); + } + + @Test + public void testTimestamp() throws Exception + { + String type = "TimestampType"; + String json = "\"1991-06-20 18:00:00.000Z\""; + assertBytebufferPositionAndOutput(json, type); + } + + @Test(expected = UnsupportedOperationException.class) + public void testDynamicCompositeType() throws Exception + { + String type = "DynamicCompositeType(a=>Int32Type, b=>Int32Type)"; + // not supported + String json = "{" + + "\"a\":1," + + "\"b\":2" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test(expected = UnsupportedOperationException.class) + public void testCompositeType() throws Exception + { + String type = "CompositeType(Int32Type, Int32Type)"; + // not supported + String json = "{" + + "\"a\":1," + + "\"b\":2" + + "}"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testList() throws Exception + { + String type = "FrozenType(ListType(TupleType(ListType(Int32Type), ListType(Int32Type"; + String json = "[" + + "[[1, 2, 3], [1, 2, 3]], " + + "[[1, 2, 3, 4], [1, 2, 3, 4]], " + + "[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]" + + "]"; + assertBytebufferPositionAndOutput(json, type); + } + + @Test + public void testSet() throws Exception + { +
[06/14] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/97fb4d10 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/97fb4d10 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/97fb4d10 Branch: refs/heads/cassandra-3.0 Commit: 97fb4d1029f23b53621125493e7582b2f045fdf8 Parents: e51c85f cb6fad3 Author: Benjamin Lerer Authored: Fri Jul 7 17:14:32 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:14:32 2017 +0200 -- CHANGES.txt | 3 +- .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 5 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 11 + .../cql3/validation/entities/JsonTest.java | 170 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/97fb4d10/CHANGES.txt -- diff --cc CHANGES.txt index c98ffd9,6740c9e..8095e25 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,61 -1,16 +1,62 @@@ -2.2.11 - * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) + Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++ * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range to
[13/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
Merge branch cassandra-3.0 into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/48ffad89 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/48ffad89 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/48ffad89 Branch: refs/heads/trunk Commit: 48ffad89c14b09af6bac1d4b701374d5f65b72b5 Parents: b5df3b4 97fb4d1 Author: Benjamin Lerer Authored: Fri Jul 7 17:32:28 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:32:28 2017 +0200 -- CHANGES.txt | 3 +- .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 7 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 6 + .../cql3/validation/entities/JsonTest.java | 168 +- .../operations/SelectGroupByTest.java | 7 - .../db/marshal/JsonConversionTest.java | 320 +++ 10 files changed, 514 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/CHANGES.txt -- diff --cc CHANGES.txt index 679d55b,8095e25..a66f4b3 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,52 -1,13 +1,53 @@@ -3.0.15 +3.11.1 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) +Merged from 3.0: * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - Merged from 2.2: +Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) -3.0.14 +3.11.0 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Replace string comparison with regex/number checks in MessagingService test (CASSANDRA-13216) + * Fix formatting of duration columns in CQLSH (CASSANDRA-13549) + * Fix the problem with duplicated rows when using paging with SASI (CASSANDRA-13302) + * Allow CONTAINS statements filtering on the partition key and itâs parts (CASSANDRA-13275) + * Fall back to even ranges calculation in clusters with vnodes when tokens are distributed unevenly (CASSANDRA-13229) + * Fix duration type validation to prevent overflow (CASSANDRA-13218) + * Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228) + * 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) + * Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422) + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) + * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) + * Add charset to Analyser input stream (CASSANDRA-13151) + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) + * cdc column addition strikes again (CASSANDRA-13382) + * Fix static column indexes (CASSANDRA-13277) + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298) + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370) + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247) + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317) + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366) + * Support unaligned memory access for AArch64 (CASSANDRA-13326) + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915). + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174) + * Obfuscate password in stress-graphs (CASSANDRA-12233) + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034) + * nodetool stopdaemon errors out (CASSANDRA-13030) + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + * Fix primary index calculation for SASI (CASSANDRA-12910) + * More fixes to the TokenAllocator (CASSANDRA-12990) + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) + * Address message coalescing regression (CASSANDRA-12676) + * Delete illegal charac
[10/14] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
Merge branch cassandra-3.0 into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/48ffad89 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/48ffad89 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/48ffad89 Branch: refs/heads/cassandra-3.11 Commit: 48ffad89c14b09af6bac1d4b701374d5f65b72b5 Parents: b5df3b4 97fb4d1 Author: Benjamin Lerer Authored: Fri Jul 7 17:32:28 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:32:28 2017 +0200 -- CHANGES.txt | 3 +- .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 7 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 6 + .../cql3/validation/entities/JsonTest.java | 168 +- .../operations/SelectGroupByTest.java | 7 - .../db/marshal/JsonConversionTest.java | 320 +++ 10 files changed, 514 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/48ffad89/CHANGES.txt -- diff --cc CHANGES.txt index 679d55b,8095e25..a66f4b3 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,52 -1,13 +1,53 @@@ -3.0.15 +3.11.1 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) +Merged from 3.0: * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - Merged from 2.2: +Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) -3.0.14 +3.11.0 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Replace string comparison with regex/number checks in MessagingService test (CASSANDRA-13216) + * Fix formatting of duration columns in CQLSH (CASSANDRA-13549) + * Fix the problem with duplicated rows when using paging with SASI (CASSANDRA-13302) + * Allow CONTAINS statements filtering on the partition key and itâs parts (CASSANDRA-13275) + * Fall back to even ranges calculation in clusters with vnodes when tokens are distributed unevenly (CASSANDRA-13229) + * Fix duration type validation to prevent overflow (CASSANDRA-13218) + * Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228) + * 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) + * Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422) + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) + * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) + * Add charset to Analyser input stream (CASSANDRA-13151) + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) + * cdc column addition strikes again (CASSANDRA-13382) + * Fix static column indexes (CASSANDRA-13277) + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298) + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370) + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247) + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317) + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366) + * Support unaligned memory access for AArch64 (CASSANDRA-13326) + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915). + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174) + * Obfuscate password in stress-graphs (CASSANDRA-12233) + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034) + * nodetool stopdaemon errors out (CASSANDRA-13030) + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + * Fix primary index calculation for SASI (CASSANDRA-12910) + * More fixes to the TokenAllocator (CASSANDRA-12990) + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) + * Address message coalescing regression (CASSANDRA-12676) + * Delete illeg
[07/14] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/97fb4d10 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/97fb4d10 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/97fb4d10 Branch: refs/heads/trunk Commit: 97fb4d1029f23b53621125493e7582b2f045fdf8 Parents: e51c85f cb6fad3 Author: Benjamin Lerer Authored: Fri Jul 7 17:14:32 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 17:14:32 2017 +0200 -- CHANGES.txt | 3 +- .../cassandra/db/marshal/AbstractType.java | 11 +- .../apache/cassandra/db/marshal/EmptyType.java | 5 + .../apache/cassandra/db/marshal/ListType.java | 5 +- .../apache/cassandra/db/marshal/MapType.java| 7 +- .../apache/cassandra/db/marshal/TupleType.java | 3 +- .../org/apache/cassandra/cql3/CQLTester.java| 11 + .../cql3/validation/entities/JsonTest.java | 170 +- .../db/marshal/JsonConversionTest.java | 320 +++ 9 files changed, 518 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/97fb4d10/CHANGES.txt -- diff --cc CHANGES.txt index c98ffd9,6740c9e..8095e25 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,61 -1,16 +1,62 @@@ -2.2.11 - * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) + Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++ * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592) ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range tombstones
[jira] [Assigned] (CASSANDRA-13576) test failure in bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test
[ https://issues.apache.org/jira/browse/CASSANDRA-13576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ZhaoYang reassigned CASSANDRA-13576: Assignee: Alex Petrov (was: ZhaoYang) :D > test failure in > bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test > - > > Key: CASSANDRA-13576 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13576 > Project: Cassandra > Issue Type: Bug >Reporter: Michael Hamm >Assignee: Alex Petrov > Labels: dtest, test-failure > Attachments: node1_debug.log, node1_gc.log, node1.log, > node2_debug.log, node2_gc.log, node2.log, node3_debug.log, node3_gc.log, > node3.log > > > example failure: > http://cassci.datastax.com/job/trunk_offheap_dtest/445/testReport/bootstrap_test/TestBootstrap/consistent_range_movement_false_with_rf1_should_succeed_test > {noformat} > Error Message > 31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL clients']: > INFO [main] 2017-05-31 04:18:01,615 YamlConfigura. > See system.log for remainder > {noformat} > {noformat} > Stacktrace > File "/usr/lib/python2.7/unittest/case.py", line 329, in run > testMethod() > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 236, in > consistent_range_movement_false_with_rf1_should_succeed_test > self._bootstrap_test_with_replica_down(False, rf=1) > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 278, in > _bootstrap_test_with_replica_down > > jvm_args=["-Dcassandra.consistent.rangemovement={}".format(consistent_range_movement)]) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 696, in start > self.wait_for_binary_interface(from_mark=self.mark) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 514, in wait_for_binary_interface > self.watch_log_for("Starting listening for CQL clients", **kwargs) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 471, in watch_log_for > raise TimeoutError(time.strftime("%d %b %Y %H:%M:%S", time.gmtime()) + " > [" + self.name + "] Missing: " + str([e.pattern for e in tofind]) + ":\n" + > reads[:50] + ".\nSee {} for remainder".format(filename)) > "31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL > clients']:\nINFO [main] 2017-05-31 04:18:01,615 YamlConfigura.\n > {noformat} > {noformat} > >> begin captured logging << > \ndtest: DEBUG: cluster ccm directory: > /tmp/dtest-PKphwD\ndtest: DEBUG: Done setting configuration options:\n{ > 'initial_token': None,\n'memtable_allocation_type': 'offheap_objects',\n > 'num_tokens': '32',\n'phi_convict_threshold': 5,\n > 'range_request_timeout_in_ms': 1,\n'read_request_timeout_in_ms': > 1,\n'request_timeout_in_ms': 1,\n > 'truncate_request_timeout_in_ms': 1,\n'write_request_timeout_in_ms': > 1}\ncassandra.policies: INFO: Using datacenter 'datacenter1' for > DCAwareRoundRobinPolicy (via host '127.0.0.1'); if incorrect, please specify > a local_dc to the constructor, or limit contact points to local cluster > nodes\ncassandra.cluster: INFO: New Cassandra host datacenter1> discovered\ncassandra.protocol: WARNING: Server warning: When > increasing replication factor you need to run a full (-full) repair to > distribute the data.\ncassandra.connection: WARNING: Heartbeat failed for > connection (139927174110160) to 127.0.0.2\ncassandra.cluster: WARNING: Host > 127.0.0.2 has been marked down\ncassandra.pool: WARNING: Error attempting to > reconnect to 127.0.0.2, scheduling retry in 2.0 seconds: [Errno 111] Tried > connecting to [('127.0.0.2', 9042)]. Last error: Connection > refused\ncassandra.pool: WARNING: Error attempting to reconnect to 127.0.0.2, > scheduling retry in 4.0 seconds: [Errno 111] Tried connecting to > [('127.0.0.2', 9042)]. Last error: Connection refused\ncassandra.pool: > WARNING: Error attempting to reconnect to 127.0.0.2, scheduling retry in 8.0 > seconds: [Errno 111] Tried connecting to [('127.0.0.2', 9042)]. Last error: > Connection refused\ncassandra.pool: WARNING: Error attempting to reconnect to > 127.0.0.2, scheduling retry in 16.0 seconds: [Errno 111] Tried connecting to > [('127.0.0.2', 9042)]. Last error: Connection refused\ncassandra.pool: > WARNING: Error attempting to reconnect to 127.0.0.2, scheduling retry in 32.0 > seconds: [Errno 111] Tried connecting to [('127.0.0.2', 9042)]. Last error: > Connection refused\ncassandra.pool: WARNING: Error attempting to reconnect to > 127.0.0.2, scheduling retry in 64.0 seconds: [Errno 111] Tried connecting to > [('127.
[jira] [Commented] (CASSANDRA-13176) DROP INDEX seemingly doesn't stop existing Index build
[ https://issues.apache.org/jira/browse/CASSANDRA-13176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078207#comment-16078207 ] Alex Petrov commented on CASSANDRA-13176: - I can confirm that the issue exists (dropping index won't automatically stop the index rebuild). This is quite useful in cases when, for example, an operator over a large cluster accidentally started building an index on a wrong column, so they drop the index right away. Of course the issue has the obvious workaround: stop index build manually. My assumption on why this was not done on the first place is that right now {{CompactionHolder}} that would be used for stopping the index build can now be responsible for more than a single index build. The middle ground could be to stop only the tasks that are rebuilding a single index, not ones that are related to loaded sstables etc, but in this case it feels a bit counter intuitive. > DROP INDEX seemingly doesn't stop existing Index build > -- > > Key: CASSANDRA-13176 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13176 > Project: Cassandra > Issue Type: Bug > Components: Compaction, CQL > Environment: CentOS Linux, JRE 1.8 >Reporter: Soumya Sanyal > > There appears to be an edge case with secondary indexes (non SASI). I > originally issued a CREATE INDEX on a column, and upon listening to advice > from folks in the #cassandra room, decided against it, and issued a DROP > INDEX. > I didn't check the cluster overnight, but this morning, I found out that our > cluster CPU usage was pegged around 80%. Looking at compaction stats, I saw > that the index build was still ongoing. We had to restart the entire cluster > for the changes to take effect. > Version: 3.9 -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13127) Materialized Views: View row expires too soon
[ https://issues.apache.org/jira/browse/CASSANDRA-13127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078206#comment-16078206 ] T Jake Luciani commented on CASSANDRA-13127: [~jasonstack] What impact will the change to the update statement have? My guess it we would potentially read the existing data a lot more often. > Materialized Views: View row expires too soon > - > > Key: CASSANDRA-13127 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13127 > Project: Cassandra > Issue Type: Bug > Components: Local Write-Read Paths, Materialized Views >Reporter: Duarte Nunes >Assignee: ZhaoYang > > Consider the following commands, ran against trunk: > {code} > echo "DROP MATERIALIZED VIEW ks.mv; DROP TABLE ks.base;" | bin/cqlsh > echo "CREATE TABLE ks.base (p int, c int, v int, PRIMARY KEY (p, c));" | > bin/cqlsh > echo "CREATE MATERIALIZED VIEW ks.mv AS SELECT p, c FROM base WHERE p IS NOT > NULL AND c IS NOT NULL PRIMARY KEY (c, p);" | bin/cqlsh > echo "INSERT INTO ks.base (p, c) VALUES (0, 0) USING TTL 10;" | bin/cqlsh > # wait for row liveness to get closer to expiration > sleep 6; > echo "UPDATE ks.base USING TTL 8 SET v = 0 WHERE p = 0 and c = 0;" | bin/cqlsh > echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh > p | c | ttl(v) > ---+---+ > 0 | 0 | 7 > (1 rows) > c | p > ---+--- > 0 | 0 > (1 rows) > # wait for row liveness to expire > sleep 4; > echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh > p | c | ttl(v) > ---+---+ > 0 | 0 | 3 > (1 rows) > c | p > ---+--- > (0 rows) > {code} > Notice how the view row is removed even though the base row is still live. I > would say this is because in ViewUpdateGenerator#computeLivenessInfoForEntry > the TTLs are compared instead of the expiration times, but I'm not sure I'm > getting that far ahead in the code when updating a column that's not in the > view. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Assigned] (CASSANDRA-13176) DROP INDEX seemingly doesn't stop existing Index build
[ https://issues.apache.org/jira/browse/CASSANDRA-13176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Petrov reassigned CASSANDRA-13176: --- Assignee: (was: Alex Petrov) > DROP INDEX seemingly doesn't stop existing Index build > -- > > Key: CASSANDRA-13176 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13176 > Project: Cassandra > Issue Type: Bug > Components: Compaction, CQL > Environment: CentOS Linux, JRE 1.8 >Reporter: Soumya Sanyal > > There appears to be an edge case with secondary indexes (non SASI). I > originally issued a CREATE INDEX on a column, and upon listening to advice > from folks in the #cassandra room, decided against it, and issued a DROP > INDEX. > I didn't check the cluster overnight, but this morning, I found out that our > cluster CPU usage was pegged around 80%. Looking at compaction stats, I saw > that the index build was still ongoing. We had to restart the entire cluster > for the changes to take effect. > Version: 3.9 -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13576) test failure in bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test
[ https://issues.apache.org/jira/browse/CASSANDRA-13576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078185#comment-16078185 ] Alex Petrov commented on CASSANDRA-13576: - Was looking through the failing tests, only now found there's an issue open for this one. It seems that it might be enough to just disable the optimisation for the cases when {{rf=1}} (to basically fall back to previous behaviour, as the patch was changing only [rangeFetchMap|https://github.com/apache/cassandra/commit/bf911cc6a852f9ef068318a3545611d9daa5112c#diff-fad052638059f53b1a6d479dbd05f2f2L180]). I've checked [CASSANDRA-4650] and it looks like it is useful for cases when N >= 3 anyways. CI results look good (with an exception of an unrelated issue that is also failing on trunk): |[trunk|https://github.com/apache/cassandra/compare/trunk...ifesdjeen:13576-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-13576-trunk-testall/]|[dtest|http://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-13576-trunk-dtest/]| [~krummas] would you be able to take a look at the patch given you've been also working on #4650 and know the context very good? > test failure in > bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test > - > > Key: CASSANDRA-13576 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13576 > Project: Cassandra > Issue Type: Bug >Reporter: Michael Hamm >Assignee: ZhaoYang > Labels: dtest, test-failure > Attachments: node1_debug.log, node1_gc.log, node1.log, > node2_debug.log, node2_gc.log, node2.log, node3_debug.log, node3_gc.log, > node3.log > > > example failure: > http://cassci.datastax.com/job/trunk_offheap_dtest/445/testReport/bootstrap_test/TestBootstrap/consistent_range_movement_false_with_rf1_should_succeed_test > {noformat} > Error Message > 31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL clients']: > INFO [main] 2017-05-31 04:18:01,615 YamlConfigura. > See system.log for remainder > {noformat} > {noformat} > Stacktrace > File "/usr/lib/python2.7/unittest/case.py", line 329, in run > testMethod() > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 236, in > consistent_range_movement_false_with_rf1_should_succeed_test > self._bootstrap_test_with_replica_down(False, rf=1) > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 278, in > _bootstrap_test_with_replica_down > > jvm_args=["-Dcassandra.consistent.rangemovement={}".format(consistent_range_movement)]) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 696, in start > self.wait_for_binary_interface(from_mark=self.mark) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 514, in wait_for_binary_interface > self.watch_log_for("Starting listening for CQL clients", **kwargs) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 471, in watch_log_for > raise TimeoutError(time.strftime("%d %b %Y %H:%M:%S", time.gmtime()) + " > [" + self.name + "] Missing: " + str([e.pattern for e in tofind]) + ":\n" + > reads[:50] + ".\nSee {} for remainder".format(filename)) > "31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL > clients']:\nINFO [main] 2017-05-31 04:18:01,615 YamlConfigura.\n > {noformat} > {noformat} > >> begin captured logging << > \ndtest: DEBUG: cluster ccm directory: > /tmp/dtest-PKphwD\ndtest: DEBUG: Done setting configuration options:\n{ > 'initial_token': None,\n'memtable_allocation_type': 'offheap_objects',\n > 'num_tokens': '32',\n'phi_convict_threshold': 5,\n > 'range_request_timeout_in_ms': 1,\n'read_request_timeout_in_ms': > 1,\n'request_timeout_in_ms': 1,\n > 'truncate_request_timeout_in_ms': 1,\n'write_request_timeout_in_ms': > 1}\ncassandra.policies: INFO: Using datacenter 'datacenter1' for > DCAwareRoundRobinPolicy (via host '127.0.0.1'); if incorrect, please specify > a local_dc to the constructor, or limit contact points to local cluster > nodes\ncassandra.cluster: INFO: New Cassandra host datacenter1> discovered\ncassandra.protocol: WARNING: Server warning: When > increasing replication factor you need to run a full (-full) repair to > distribute the data.\ncassandra.connection: WARNING: Heartbeat failed for > connection (139927174110160) to 127.0.0.2\ncassandra.cluster: WARNING: Host > 127.0.0.2 has been marked down\ncassandra.pool: WARNING: Error attempting to > reconnect to 127.0.0.2, scheduling retry in 2.0 seconds: [Errno 111] Tri
[jira] [Updated] (CASSANDRA-13576) test failure in bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test
[ https://issues.apache.org/jira/browse/CASSANDRA-13576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Petrov updated CASSANDRA-13576: Status: Patch Available (was: Open) > test failure in > bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test > - > > Key: CASSANDRA-13576 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13576 > Project: Cassandra > Issue Type: Bug >Reporter: Michael Hamm >Assignee: ZhaoYang > Labels: dtest, test-failure > Attachments: node1_debug.log, node1_gc.log, node1.log, > node2_debug.log, node2_gc.log, node2.log, node3_debug.log, node3_gc.log, > node3.log > > > example failure: > http://cassci.datastax.com/job/trunk_offheap_dtest/445/testReport/bootstrap_test/TestBootstrap/consistent_range_movement_false_with_rf1_should_succeed_test > {noformat} > Error Message > 31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL clients']: > INFO [main] 2017-05-31 04:18:01,615 YamlConfigura. > See system.log for remainder > {noformat} > {noformat} > Stacktrace > File "/usr/lib/python2.7/unittest/case.py", line 329, in run > testMethod() > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 236, in > consistent_range_movement_false_with_rf1_should_succeed_test > self._bootstrap_test_with_replica_down(False, rf=1) > File "/home/automaton/cassandra-dtest/bootstrap_test.py", line 278, in > _bootstrap_test_with_replica_down > > jvm_args=["-Dcassandra.consistent.rangemovement={}".format(consistent_range_movement)]) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 696, in start > self.wait_for_binary_interface(from_mark=self.mark) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 514, in wait_for_binary_interface > self.watch_log_for("Starting listening for CQL clients", **kwargs) > File > "/home/automaton/venv/local/lib/python2.7/site-packages/ccmlib/node.py", line > 471, in watch_log_for > raise TimeoutError(time.strftime("%d %b %Y %H:%M:%S", time.gmtime()) + " > [" + self.name + "] Missing: " + str([e.pattern for e in tofind]) + ":\n" + > reads[:50] + ".\nSee {} for remainder".format(filename)) > "31 May 2017 04:28:09 [node3] Missing: ['Starting listening for CQL > clients']:\nINFO [main] 2017-05-31 04:18:01,615 YamlConfigura.\n > {noformat} > {noformat} > >> begin captured logging << > \ndtest: DEBUG: cluster ccm directory: > /tmp/dtest-PKphwD\ndtest: DEBUG: Done setting configuration options:\n{ > 'initial_token': None,\n'memtable_allocation_type': 'offheap_objects',\n > 'num_tokens': '32',\n'phi_convict_threshold': 5,\n > 'range_request_timeout_in_ms': 1,\n'read_request_timeout_in_ms': > 1,\n'request_timeout_in_ms': 1,\n > 'truncate_request_timeout_in_ms': 1,\n'write_request_timeout_in_ms': > 1}\ncassandra.policies: INFO: Using datacenter 'datacenter1' for > DCAwareRoundRobinPolicy (via host '127.0.0.1'); if incorrect, please specify > a local_dc to the constructor, or limit contact points to local cluster > nodes\ncassandra.cluster: INFO: New Cassandra host datacenter1> discovered\ncassandra.protocol: WARNING: Server warning: When > increasing replication factor you need to run a full (-full) repair to > distribute the data.\ncassandra.connection: WARNING: Heartbeat failed for > connection (139927174110160) to 127.0.0.2\ncassandra.cluster: WARNING: Host > 127.0.0.2 has been marked down\ncassandra.pool: WARNING: Error attempting to > reconnect to 127.0.0.2, scheduling retry in 2.0 seconds: [Errno 111] Tried > connecting to [('127.0.0.2', 9042)]. Last error: Connection > refused\ncassandra.pool: WARNING: Error attempting to reconnect to 127.0.0.2, > scheduling retry in 4.0 seconds: [Errno 111] Tried connecting to > [('127.0.0.2', 9042)]. Last error: Connection refused\ncassandra.pool: > WARNING: Error attempting to reconnect to 127.0.0.2, scheduling retry in 8.0 > seconds: [Errno 111] Tried connecting to [('127.0.0.2', 9042)]. Last error: > Connection refused\ncassandra.pool: WARNING: Error attempting to reconnect to > 127.0.0.2, scheduling retry in 16.0 seconds: [Errno 111] Tried connecting to > [('127.0.0.2', 9042)]. Last error: Connection refused\ncassandra.pool: > WARNING: Error attempting to reconnect to 127.0.0.2, scheduling retry in 32.0 > seconds: [Errno 111] Tried connecting to [('127.0.0.2', 9042)]. Last error: > Connection refused\ncassandra.pool: WARNING: Error attempting to reconnect to > 127.0.0.2, scheduling retry in 64.0 seconds: [Errno 111] Tried connecting to > [('127.0.0.2', 90
[jira] [Commented] (CASSANDRA-13573) sstabledump doesn't print out tombstone information for frozen set collection
[ https://issues.apache.org/jira/browse/CASSANDRA-13573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078133#comment-16078133 ] Chris Lohfink commented on CASSANDRA-13573: --- The json transformer uses jackson's JsonGenerator so you do not need things designed to be in json output. Switching to {{toJSONString}} would end up double escaped as the jackson generator will try to remove the json encoding from the JSONString output. If I remember correctly pretty much all UDTs were not supported initially because the information to deserialize the UDT requires the system schema tables to be read, which may not be available unless running on the same system with exact configuration and requires client initialization (which is dangerous and we dont want to do). If we have adequate info to deserialize the UDTs from the stats metadata it probably just needs a different check to handle it. > sstabledump doesn't print out tombstone information for frozen set collection > - > > Key: CASSANDRA-13573 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13573 > Project: Cassandra > Issue Type: Bug > Components: Tools >Reporter: Stefano Ortolani >Assignee: ZhaoYang > > Schema and data" > {noformat} > CREATE TABLE ks.cf ( > hash blob, > report_id timeuuid, > subject_ids frozen>, > PRIMARY KEY (hash, report_id) > ) WITH CLUSTERING ORDER BY (report_id DESC); > INSERT INTO ks.cf (hash, report_id, subject_ids) VALUES (0x1213, now(), > {1,2,4,5}); > {noformat} > sstabledump output is: > {noformat} > sstabledump mc-1-big-Data.db > [ > { > "partition" : { > "key" : [ "1213" ], > "position" : 0 > }, > "rows" : [ > { > "type" : "row", > "position" : 16, > "clustering" : [ "ec01eed0-49d9-11e7-b39a-97a96f529c02" ], > "liveness_info" : { "tstamp" : "2017-06-05T10:29:57.434856Z" }, > "cells" : [ > { "name" : "subject_ids", "value" : "" } > ] > } > ] > } > ] > {noformat} > While the values are really there: > {noformat} > cqlsh:ks> select * from cf ; > hash | report_id| subject_ids > +--+- > 0x1213 | 02bafff0-49d9-11e7-b39a-97a96f529c02 | {1, 2, 4} > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-12373) 3.0 breaks CQL compatibility with super columns families
[ https://issues.apache.org/jira/browse/CASSANDRA-12373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joshua McKenzie updated CASSANDRA-12373: Reviewer: (was: Aleksey Yeschenko) > 3.0 breaks CQL compatibility with super columns families > > > Key: CASSANDRA-12373 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12373 > Project: Cassandra > Issue Type: Bug > Components: CQL >Reporter: Sylvain Lebresne >Assignee: Alex Petrov > Fix For: 3.0.x > > > This is a follow-up to CASSANDRA-12335 to fix the CQL side of super column > compatibility. > The details and a proposed solution can be found in the comments of > CASSANDRA-12335 but the crux of the issue is that super column famillies show > up differently in CQL in 3.0.x/3.x compared to 2.x, hence breaking backward > compatibilty. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13646) Bind parameters of collection types are not properly validated
[ https://issues.apache.org/jira/browse/CASSANDRA-13646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077987#comment-16077987 ] Benjamin Lerer commented on CASSANDRA-13646: Thanks for the review :-). Committed into 2.2 at b77e11cfd51ddb0f3ac07530399abe999df0573e and merged into 3.0, 3.11 and trunk > Bind parameters of collection types are not properly validated > > > Key: CASSANDRA-13646 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13646 > Project: Cassandra > Issue Type: Bug >Reporter: Benjamin Lerer >Assignee: Benjamin Lerer > > It looks like C* is not validating properly the bind parameters for > collection types. If an element of the collection is invalid the value will > not be rejected and might cause an Exception later on. > The problem can be reproduced with the following test: > {code} > @Test > public void testInvalidQueries() throws Throwable > { > createTable("CREATE TABLE %s (k int PRIMARY KEY, s > frozen>>)"); > execute("INSERT INTO %s (k, s) VALUES (0, ?)", > set(tuple(1,"1",1.0,1), tuple(2,"2",2.0,2))); > } > {code} > The invalid Tuple will cause an "IndexOutOfBoundsException: Index: 3, Size: 3" -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[02/10] cassandra git commit: Fix nested Tuples/UDTs validation
Fix nested Tuples/UDTs validation patch by Benjamin Lerer; reviewed by Andrés de la Peña for CASSANDRA-13646 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b77e11cf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b77e11cf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b77e11cf Branch: refs/heads/cassandra-3.0 Commit: b77e11cfd51ddb0f3ac07530399abe999df0573e Parents: 0163b97 Author: Benjamin Lerer Authored: Fri Jul 7 13:29:00 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:29:00 2017 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 219 insertions(+), 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c966c92..08c6e48 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/cql3/UserTypes.java -- diff --git a/src/java/org/apache/cassandra/cql3/UserTypes.java b/src/java/org/apache/cassandra/cql3/UserTypes.java index de3f545..6766d07 100644 --- a/src/java/org/apache/cassandra/cql3/UserTypes.java +++ b/src/java/org/apache/cassandra/cql3/UserTypes.java @@ -91,7 +91,7 @@ public abstract class UserTypes private void validateAssignableTo(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!(receiver.type instanceof UserType)) -throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver, receiver.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver.name, receiver.type.asCQL3Type())); UserType ut = (UserType)receiver.type; for (int i = 0; i < ut.size(); i++) @@ -103,7 +103,7 @@ public abstract class UserTypes ColumnSpecification fieldSpec = fieldSpecOf(receiver, i); if (!value.testAssignment(keyspace, fieldSpec).isAssignable()) -throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver, field, fieldSpec.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver.name, field, fieldSpec.type.asCQL3Type())); } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/db/marshal/TupleType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/TupleType.java b/src/java/org/apache/cassandra/db/marshal/TupleType.java index 0d08a52..bf7eae4 100644 --- a/src/java/org/apache/cassandra/db/marshal/TupleType.java +++ b/src/java/org/apache/cassandra/db/marshal/TupleType.java @@ -39,11 +39,23 @@ public class TupleType extends AbstractType { protected final List> types; +private final TupleSerializer serializer; + public TupleType(List> types) { for (int i = 0; i < types.size(); i++) types.set(i, types.get(i).freeze()); this.types = types; +this.serializer = new TupleSerializer(fieldSerializers(types)); +} + +private static List> fieldSerializers(List> types) +{ +int size = types.size(); +List> serializers = new ArrayList<>(size); +for (int i = 0; i < size; i++) +serializers.add(types.get(i).getSerializer()); +return serializers; } public static TupleType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException @@ -119,37 +131,6 @@ public class TupleType extends AbstractType return 1; } -@Override -public void validate(ByteBuffer bytes) throws MarshalException -{ -ByteBuffer input
[05/10] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e51c85f2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e51c85f2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e51c85f2 Branch: refs/heads/cassandra-3.11 Commit: e51c85f2e6045e077dad8575f7737d502fd50414 Parents: af20226 b77e11c Author: Benjamin Lerer Authored: Fri Jul 7 13:31:08 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:34:32 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 220 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e51c85f2/CHANGES.txt -- diff --cc CHANGES.txt index 52b0027,08c6e48..c98ffd9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,60 -1,15 +1,61 @@@ -2.2.11 - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - ++ Merged from 2.2: ++* Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range tombstones (CASSANDRA-13341) + * Use the Kernel32 library to retrieve the PID on Windows and fix startup checks (CASSANDRA-1) + * Fix code to not exchange schema across maj
[08/10] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
Merge branch cassandra-3.0 into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b5df3b4c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b5df3b4c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b5df3b4c Branch: refs/heads/cassandra-3.11 Commit: b5df3b4c367c2927f309ca16a540b7be83636556 Parents: 7afb97c e51c85f Author: Benjamin Lerer Authored: Fri Jul 7 13:36:52 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:38:22 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 12 +--- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 51 +-- .../cassandra/serializers/TupleSerializer.java | 64 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 15 - 9 files changed, 223 insertions(+), 80 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b5df3b4c/CHANGES.txt -- diff --cc CHANGES.txt index 096dfa4,c98ffd9..679d55b --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,51 -1,12 +1,52 @@@ -3.0.15 +3.11.1 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) +Merged from 3.0: * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - - Merged from 2.2: -* Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++Merged from 2.2: ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) -3.0.14 +3.11.0 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Replace string comparison with regex/number checks in MessagingService test (CASSANDRA-13216) + * Fix formatting of duration columns in CQLSH (CASSANDRA-13549) + * Fix the problem with duplicated rows when using paging with SASI (CASSANDRA-13302) + * Allow CONTAINS statements filtering on the partition key and itâs parts (CASSANDRA-13275) + * Fall back to even ranges calculation in clusters with vnodes when tokens are distributed unevenly (CASSANDRA-13229) + * Fix duration type validation to prevent overflow (CASSANDRA-13218) + * Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228) + * 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) + * Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422) + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) + * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) + * Add charset to Analyser input stream (CASSANDRA-13151) + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) + * cdc column addition strikes again (CASSANDRA-13382) + * Fix static column indexes (CASSANDRA-13277) + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298) + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370) + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247) + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317) + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366) + * Support unaligned memory access for AArch64 (CASSANDRA-13326) + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915). + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174) + * Obfuscate password in stress-graphs (CASSANDRA-12233) + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034) + * nodetool stopdaemon errors out (CASSANDRA-13030) + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + * Fix primary index calculation for SASI (CASSANDRA-12910) + * More fixes to the TokenAllocator (CASSANDRA-12990) + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) + * Address message coalescing regression (CASSANDRA-12676) + * Delete illegal character from StandardTokenizerImpl.jflex (CASSANDRA-13417) + * Fix cqlsh automatic protoco
[06/10] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e51c85f2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e51c85f2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e51c85f2 Branch: refs/heads/cassandra-3.0 Commit: e51c85f2e6045e077dad8575f7737d502fd50414 Parents: af20226 b77e11c Author: Benjamin Lerer Authored: Fri Jul 7 13:31:08 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:34:32 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 220 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e51c85f2/CHANGES.txt -- diff --cc CHANGES.txt index 52b0027,08c6e48..c98ffd9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,60 -1,15 +1,61 @@@ -2.2.11 - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - ++ Merged from 2.2: ++* Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range tombstones (CASSANDRA-13341) + * Use the Kernel32 library to retrieve the PID on Windows and fix startup checks (CASSANDRA-1) + * Fix code to not exchange schema across majo
[07/10] cassandra git commit: Merge branch cassandra-2.2 into cassandra-3.0
Merge branch cassandra-2.2 into cassandra-3.0 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e51c85f2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e51c85f2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e51c85f2 Branch: refs/heads/trunk Commit: e51c85f2e6045e077dad8575f7737d502fd50414 Parents: af20226 b77e11c Author: Benjamin Lerer Authored: Fri Jul 7 13:31:08 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:34:32 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 220 insertions(+), 70 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e51c85f2/CHANGES.txt -- diff --cc CHANGES.txt index 52b0027,08c6e48..c98ffd9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,60 -1,15 +1,61 @@@ -2.2.11 - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) - * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 +3.0.15 + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - ++ Merged from 2.2: ++* Fix nested Tuples/UDTs validation (CASSANDRA-13646) - -2.2.10 +3.0.14 + * Ensure int overflow doesn't occur when calculating large partition warning size (CASSANDRA-13172) + * Ensure consistent view of partition columns between coordinator and replica in ColumnFilter (CASSANDRA-13004) + * Failed unregistering mbean during drop keyspace (CASSANDRA-13346) + * nodetool scrub/cleanup/upgradesstables exit code is wrong (CASSANDRA-13542) + * Fix the reported number of sstable data files accessed per read (CASSANDRA-13120) + * Fix schema digest mismatch during rolling upgrades from versions before 3.0.12 (CASSANDRA-13559) + * Upgrade JNA version to 4.4.0 (CASSANDRA-13072) + * Interned ColumnIdentifiers should use minimal ByteBuffers (CASSANDRA-13533) + * ReverseIndexedReader may drop rows during 2.1 to 3.0 upgrade (CASSANDRA-13525) + * Fix repair process violating start/end token limits for small ranges (CASSANDRA-13052) + * Add storage port options to sstableloader (CASSANDRA-13518) + * Properly handle quoted index names in cqlsh DESCRIBE output (CASSANDRA-12847) + * Avoid reading static row twice from old format sstables (CASSANDRA-13236) + * Fix NPE in StorageService.excise() (CASSANDRA-13163) + * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265) + * Fail repair if insufficient responses received (CASSANDRA-13397) + * Fix SSTableLoader fail when the loaded table contains dropped columns (CASSANDRA-13276) + * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427) + * Handling partially written hint files (CASSANDRA-12728) + * Interrupt replaying hints on decommission (CASSANDRA-13308) + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441) +Merged from 2.2: * Nodes started with join_ring=False should be able to serve requests when authentication is enabled (CASSANDRA-11381) * cqlsh COPY FROM: increment error count only for failures, not for attempts (CASSANDRA-13209) - * nodetool upgradesstables should upgrade system tables (CASSANDRA-13119) + +3.0.13 + * Make reading of range tombstones more reliable (CASSANDRA-12811) + * Fix startup problems due to schema tables not completely flushed (CASSANDRA-12213) + * Fix view builder bug that can filter out data on restart (CASSANDRA-13405) + * Fix 2i page size calculation when there are no regular columns (CASSANDRA-13400) + * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395) + * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020) + * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389) + * Legacy deserializer can create empty range tombstones (CASSANDRA-13341) + * Use the Kernel32 library to retrieve the PID on Windows and fix startup checks (CASSANDRA-1) + * Fix code to not exchange schema across major versio
[03/10] cassandra git commit: Fix nested Tuples/UDTs validation
Fix nested Tuples/UDTs validation patch by Benjamin Lerer; reviewed by Andrés de la Peña for CASSANDRA-13646 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b77e11cf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b77e11cf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b77e11cf Branch: refs/heads/cassandra-3.11 Commit: b77e11cfd51ddb0f3ac07530399abe999df0573e Parents: 0163b97 Author: Benjamin Lerer Authored: Fri Jul 7 13:29:00 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:29:00 2017 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 219 insertions(+), 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c966c92..08c6e48 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/cql3/UserTypes.java -- diff --git a/src/java/org/apache/cassandra/cql3/UserTypes.java b/src/java/org/apache/cassandra/cql3/UserTypes.java index de3f545..6766d07 100644 --- a/src/java/org/apache/cassandra/cql3/UserTypes.java +++ b/src/java/org/apache/cassandra/cql3/UserTypes.java @@ -91,7 +91,7 @@ public abstract class UserTypes private void validateAssignableTo(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!(receiver.type instanceof UserType)) -throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver, receiver.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver.name, receiver.type.asCQL3Type())); UserType ut = (UserType)receiver.type; for (int i = 0; i < ut.size(); i++) @@ -103,7 +103,7 @@ public abstract class UserTypes ColumnSpecification fieldSpec = fieldSpecOf(receiver, i); if (!value.testAssignment(keyspace, fieldSpec).isAssignable()) -throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver, field, fieldSpec.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver.name, field, fieldSpec.type.asCQL3Type())); } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/db/marshal/TupleType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/TupleType.java b/src/java/org/apache/cassandra/db/marshal/TupleType.java index 0d08a52..bf7eae4 100644 --- a/src/java/org/apache/cassandra/db/marshal/TupleType.java +++ b/src/java/org/apache/cassandra/db/marshal/TupleType.java @@ -39,11 +39,23 @@ public class TupleType extends AbstractType { protected final List> types; +private final TupleSerializer serializer; + public TupleType(List> types) { for (int i = 0; i < types.size(); i++) types.set(i, types.get(i).freeze()); this.types = types; +this.serializer = new TupleSerializer(fieldSerializers(types)); +} + +private static List> fieldSerializers(List> types) +{ +int size = types.size(); +List> serializers = new ArrayList<>(size); +for (int i = 0; i < size; i++) +serializers.add(types.get(i).getSerializer()); +return serializers; } public static TupleType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException @@ -119,37 +131,6 @@ public class TupleType extends AbstractType return 1; } -@Override -public void validate(ByteBuffer bytes) throws MarshalException -{ -ByteBuffer inpu
[10/10] cassandra git commit: Merge branch cassandra-3.11 into trunk
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/10b397e2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/10b397e2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/10b397e2 Branch: refs/heads/trunk Commit: 10b397e2a9c90e0fe3a229659952a56a03795a22 Parents: 9fdec0a b5df3b4 Author: Benjamin Lerer Authored: Fri Jul 7 13:40:48 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:42:19 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 27 +--- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 51 +-- .../cassandra/serializers/TupleSerializer.java | 64 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 15 - 9 files changed, 239 insertions(+), 79 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10b397e2/CHANGES.txt -- diff --cc CHANGES.txt index 4f2d2a1,679d55b..569a807 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -96,10 -1,11 +96,11 @@@ 3.11.1 * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) Merged from 3.0: - * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) - * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) + * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) + * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) + * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - + Merged from 2.2: - * Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) 3.11.0 * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) http://git-wip-us.apache.org/repos/asf/cassandra/blob/10b397e2/src/java/org/apache/cassandra/cql3/UserTypes.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10b397e2/src/java/org/apache/cassandra/db/marshal/TupleType.java -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/10b397e2/src/java/org/apache/cassandra/db/marshal/UserType.java -- diff --cc src/java/org/apache/cassandra/db/marshal/UserType.java index f139edd,febd91c..6149e94 --- a/src/java/org/apache/cassandra/db/marshal/UserType.java +++ b/src/java/org/apache/cassandra/db/marshal/UserType.java @@@ -426,8 -404,9 +403,14 @@@ public class UserType extends TupleTyp return sb.toString(); } +public String toCQLString() +{ +return String.format("%s.%s", ColumnIdentifier.maybeQuote(keyspace), ColumnIdentifier.maybeQuote(getNameAsString())); +} ++ + @Override + public TypeSerializer getSerializer() + { + return serializer; + } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/10b397e2/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java -- diff --cc test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java index dad5d68,22e6e66..6f67609 --- a/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java @@@ -1107,786 -1037,38 +1107,822 @@@ public class CollectionsTest extends CQ } @Test +public void testMapOperation() throws Throwable +{ +createTable("CREATE TABLE %s (k int, c int, l text, " + +"m map, " + +"fm frozen>, " + +"sm map STATIC, " + +"fsm frozen> STATIC, " + +"o int, PRIMARY KEY (k, c))"); + +execute("INSERT INTO %s(k, c, l, m, fm, sm, fsm, o) VALUES (0, 0, 'foobar', ?, ?, ?, ?, 42)", +map("22", "value22", "333", "value333"), +map("1", "fvalue1", "22", "fvalue22", "333", "fvalue333"), +map("22", "svalue22", "333", "svalue333"), +map("1", "fsvalue1", "22", "fsvalue22", "333", "fsvalue333")); + +execute("INSERT INTO %s(k, c, l, m, fm, sm, fsm, o) VALUES (2, 0,
[01/10] cassandra git commit: Fix nested Tuples/UDTs validation
Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 0163b9744 -> b77e11cfd refs/heads/cassandra-3.0 af20226dc -> e51c85f2e refs/heads/cassandra-3.11 7afb97cb6 -> b5df3b4c3 refs/heads/trunk 9fdec0a82 -> 10b397e2a Fix nested Tuples/UDTs validation patch by Benjamin Lerer; reviewed by Andrés de la Peña for CASSANDRA-13646 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b77e11cf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b77e11cf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b77e11cf Branch: refs/heads/cassandra-2.2 Commit: b77e11cfd51ddb0f3ac07530399abe999df0573e Parents: 0163b97 Author: Benjamin Lerer Authored: Fri Jul 7 13:29:00 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:29:00 2017 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 219 insertions(+), 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c966c92..08c6e48 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/cql3/UserTypes.java -- diff --git a/src/java/org/apache/cassandra/cql3/UserTypes.java b/src/java/org/apache/cassandra/cql3/UserTypes.java index de3f545..6766d07 100644 --- a/src/java/org/apache/cassandra/cql3/UserTypes.java +++ b/src/java/org/apache/cassandra/cql3/UserTypes.java @@ -91,7 +91,7 @@ public abstract class UserTypes private void validateAssignableTo(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!(receiver.type instanceof UserType)) -throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver, receiver.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver.name, receiver.type.asCQL3Type())); UserType ut = (UserType)receiver.type; for (int i = 0; i < ut.size(); i++) @@ -103,7 +103,7 @@ public abstract class UserTypes ColumnSpecification fieldSpec = fieldSpecOf(receiver, i); if (!value.testAssignment(keyspace, fieldSpec).isAssignable()) -throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver, field, fieldSpec.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver.name, field, fieldSpec.type.asCQL3Type())); } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/db/marshal/TupleType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/TupleType.java b/src/java/org/apache/cassandra/db/marshal/TupleType.java index 0d08a52..bf7eae4 100644 --- a/src/java/org/apache/cassandra/db/marshal/TupleType.java +++ b/src/java/org/apache/cassandra/db/marshal/TupleType.java @@ -39,11 +39,23 @@ public class TupleType extends AbstractType { protected final List> types; +private final TupleSerializer serializer; + public TupleType(List> types) { for (int i = 0; i < types.size(); i++) types.set(i, types.get(i).freeze()); this.types = types; +this.serializer = new TupleSerializer(fieldSerializers(types)); +} + +private static List> fieldSerializers(List> types) +{ +int size = types.size(); +List> serializers = new ArrayList<>(size); +for (int i = 0; i < size; i++) +serializers.add(types.get(i).getSerializer()); +return serializers; } public static TupleType getInstance(TypeParser parser) throws Configuration
[09/10] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11
Merge branch cassandra-3.0 into cassandra-3.11 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b5df3b4c Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b5df3b4c Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b5df3b4c Branch: refs/heads/trunk Commit: b5df3b4c367c2927f309ca16a540b7be83636556 Parents: 7afb97c e51c85f Author: Benjamin Lerer Authored: Fri Jul 7 13:36:52 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:38:22 2017 +0200 -- CHANGES.txt | 3 +- .../org/apache/cassandra/cql3/UserTypes.java| 12 +--- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 51 +-- .../cassandra/serializers/TupleSerializer.java | 64 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 15 - 9 files changed, 223 insertions(+), 80 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b5df3b4c/CHANGES.txt -- diff --cc CHANGES.txt index 096dfa4,c98ffd9..679d55b --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,51 -1,12 +1,52 @@@ -3.0.15 +3.11.1 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641) +Merged from 3.0: * Allow different NUMACTL_ARGS to be passed in (CASSANDRA-13557) - * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) * Fix secondary index queries on COMPACT tables (CASSANDRA-13627) * Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568) - - Merged from 2.2: -* Fix nested Tuples/UDTs validation (CASSANDRA-13646) ++Merged from 2.2: ++ * Fix nested Tuples/UDTs validation (CASSANDRA-13646) -3.0.14 +3.11.0 + * Allow native function calls in CQLSSTableWriter (CASSANDRA-12606) + * Replace string comparison with regex/number checks in MessagingService test (CASSANDRA-13216) + * Fix formatting of duration columns in CQLSH (CASSANDRA-13549) + * Fix the problem with duplicated rows when using paging with SASI (CASSANDRA-13302) + * Allow CONTAINS statements filtering on the partition key and itâs parts (CASSANDRA-13275) + * Fall back to even ranges calculation in clusters with vnodes when tokens are distributed unevenly (CASSANDRA-13229) + * Fix duration type validation to prevent overflow (CASSANDRA-13218) + * Forbid unsupported creation of SASI indexes over partition key columns (CASSANDRA-13228) + * 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) + * Use write lock not read lock for removing sstables from compaction strategies. (CASSANDRA-13422) + * Use corePoolSize equal to maxPoolSize in JMXEnabledThreadPoolExecutors (CASSANDRA-13329) + * Avoid rebuilding SASI indexes containing no values (CASSANDRA-12962) + * Add charset to Analyser input stream (CASSANDRA-13151) + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820) + * cdc column addition strikes again (CASSANDRA-13382) + * Fix static column indexes (CASSANDRA-13277) + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298) + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370) + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247) + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317) + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366) + * Support unaligned memory access for AArch64 (CASSANDRA-13326) + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915). + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174) + * Obfuscate password in stress-graphs (CASSANDRA-12233) + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034) + * nodetool stopdaemon errors out (CASSANDRA-13030) + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + * Fix primary index calculation for SASI (CASSANDRA-12910) + * More fixes to the TokenAllocator (CASSANDRA-12990) + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) + * Address message coalescing regression (CASSANDRA-12676) + * Delete illegal character from StandardTokenizerImpl.jflex (CASSANDRA-13417) + * Fix cqlsh automatic protocol downgra
[04/10] cassandra git commit: Fix nested Tuples/UDTs validation
Fix nested Tuples/UDTs validation patch by Benjamin Lerer; reviewed by Andrés de la Peña for CASSANDRA-13646 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b77e11cf Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b77e11cf Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b77e11cf Branch: refs/heads/trunk Commit: b77e11cfd51ddb0f3ac07530399abe999df0573e Parents: 0163b97 Author: Benjamin Lerer Authored: Fri Jul 7 13:29:00 2017 +0200 Committer: Benjamin Lerer Committed: Fri Jul 7 13:29:00 2017 +0200 -- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/UserTypes.java| 4 +- .../apache/cassandra/db/marshal/TupleType.java | 45 - .../apache/cassandra/db/marshal/UserType.java | 50 +-- .../cassandra/serializers/TupleSerializer.java | 66 +++ .../serializers/UserTypeSerializer.java | 67 .../validation/entities/CollectionsTest.java| 36 +++ .../cql3/validation/entities/TupleTypeTest.java | 10 ++- .../cql3/validation/entities/UserTypesTest.java | 9 +++ 9 files changed, 219 insertions(+), 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/CHANGES.txt -- diff --git a/CHANGES.txt b/CHANGES.txt index c966c92..08c6e48 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.11 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646) * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625 http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/cql3/UserTypes.java -- diff --git a/src/java/org/apache/cassandra/cql3/UserTypes.java b/src/java/org/apache/cassandra/cql3/UserTypes.java index de3f545..6766d07 100644 --- a/src/java/org/apache/cassandra/cql3/UserTypes.java +++ b/src/java/org/apache/cassandra/cql3/UserTypes.java @@ -91,7 +91,7 @@ public abstract class UserTypes private void validateAssignableTo(String keyspace, ColumnSpecification receiver) throws InvalidRequestException { if (!(receiver.type instanceof UserType)) -throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver, receiver.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s of type %s", receiver.name, receiver.type.asCQL3Type())); UserType ut = (UserType)receiver.type; for (int i = 0; i < ut.size(); i++) @@ -103,7 +103,7 @@ public abstract class UserTypes ColumnSpecification fieldSpec = fieldSpecOf(receiver, i); if (!value.testAssignment(keyspace, fieldSpec).isAssignable()) -throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver, field, fieldSpec.type.asCQL3Type())); +throw new InvalidRequestException(String.format("Invalid user type literal for %s: field %s is not of type %s", receiver.name, field, fieldSpec.type.asCQL3Type())); } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/b77e11cf/src/java/org/apache/cassandra/db/marshal/TupleType.java -- diff --git a/src/java/org/apache/cassandra/db/marshal/TupleType.java b/src/java/org/apache/cassandra/db/marshal/TupleType.java index 0d08a52..bf7eae4 100644 --- a/src/java/org/apache/cassandra/db/marshal/TupleType.java +++ b/src/java/org/apache/cassandra/db/marshal/TupleType.java @@ -39,11 +39,23 @@ public class TupleType extends AbstractType { protected final List> types; +private final TupleSerializer serializer; + public TupleType(List> types) { for (int i = 0; i < types.size(); i++) types.set(i, types.get(i).freeze()); this.types = types; +this.serializer = new TupleSerializer(fieldSerializers(types)); +} + +private static List> fieldSerializers(List> types) +{ +int size = types.size(); +List> serializers = new ArrayList<>(size); +for (int i = 0; i < size; i++) +serializers.add(types.get(i).getSerializer()); +return serializers; } public static TupleType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException @@ -119,37 +131,6 @@ public class TupleType extends AbstractType return 1; } -@Override -public void validate(ByteBuffer bytes) throws MarshalException -{ -ByteBuffer input = bytes
[jira] [Assigned] (CASSANDRA-11500) Obsolete MV entry may not be properly deleted
[ https://issues.apache.org/jira/browse/CASSANDRA-11500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ZhaoYang reassigned CASSANDRA-11500: Assignee: ZhaoYang > Obsolete MV entry may not be properly deleted > - > > Key: CASSANDRA-11500 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11500 > Project: Cassandra > Issue Type: Bug > Components: Materialized Views >Reporter: Sylvain Lebresne >Assignee: ZhaoYang > > When a Materialized View uses a non-PK base table column in its PK, if an > update changes that column value, we add the new view entry and remove the > old one. When doing that removal, the current code uses the same timestamp > than for the liveness info of the new entry, which is the max timestamp for > any columns participating to the view PK. This is not correct for the > deletion as the old view entry could have other columns with higher timestamp > which won't be deleted as can easily shown by the failing of the following > test: > {noformat} > CREATE TABLE t (k int PRIMARY KEY, a int, b int); > CREATE MATERIALIZED VIEW mv AS SELECT * FROM t WHERE k IS NOT NULL AND a IS > NOT NULL PRIMARY KEY (k, a); > INSERT INTO t(k, a, b) VALUES (1, 1, 1) USING TIMESTAMP 0; > UPDATE t USING TIMESTAMP 4 SET b = 2 WHERE k = 1; > UPDATE t USING TIMESTAMP 2 SET a = 2 WHERE k = 1; > SELECT * FROM mv WHERE k = 1; // This currently return 2 entries, the old > (invalid) and the new one > {noformat} > So the correct timestamp to use for the deletion is the biggest timestamp in > the old view entry (which we know since we read the pre-existing base row), > and that is what CASSANDRA-11475 does (the test above thus doesn't fail on > that branch). > Unfortunately, even then we can still have problems if further updates > requires us to overide the old entry. Consider the following case: > {noformat} > CREATE TABLE t (k int PRIMARY KEY, a int, b int); > CREATE MATERIALIZED VIEW mv AS SELECT * FROM t WHERE k IS NOT NULL AND a IS > NOT NULL PRIMARY KEY (k, a); > INSERT INTO t(k, a, b) VALUES (1, 1, 1) USING TIMESTAMP 0; > UPDATE t USING TIMESTAMP 10 SET b = 2 WHERE k = 1; > UPDATE t USING TIMESTAMP 2 SET a = 2 WHERE k = 1; // This will delete the > entry for a=1 with timestamp 10 > UPDATE t USING TIMESTAMP 3 SET a = 1 WHERE k = 1; // This needs to re-insert > an entry for a=1 but shouldn't be deleted by the prior deletion > UPDATE t USING TIMESTAMP 4 SET a = 2 WHERE k = 1; // ... and we can play this > game more than once > UPDATE t USING TIMESTAMP 5 SET a = 1 WHERE k = 1; > ... > {noformat} > In a way, this is saying that the "shadowable" deletion mechanism is not > general enough: we need to be able to re-insert an entry when a prior one had > been deleted before, but we can't rely on timestamps being strictly bigger on > the re-insert. In that sense, this can be though as a similar problem than > CASSANDRA-10965, though the solution there of a single flag is not enough > since we can have to replace more than once. > I think the proper solution would be to ship enough information to always be > able to decide when a view deletion is shadowed. Which means that both > liveness info (for updates) and shadowable deletion would need to ship the > timestamp of any base table column that is part the view PK (so {{a}} in the > example below). It's doable (and not that hard really), but it does require > a change to the sstable and intra-node protocol, which makes this a bit > painful right now. > But I'll also note that as CASSANDRA-1096 shows, the timestamp is not even > enough since on equal timestamp the value can be the deciding factor. So in > theory we'd have to ship the value of those columns (in the case of a > deletion at least since we have it in the view PK for updates). That said, on > that last problem, my preference would be that we start prioritizing > CASSANDRA-6123 seriously so we don't have to care about conflicting timestamp > anymore, which would make this problem go away. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Updated] (CASSANDRA-13573) sstabledump doesn't print out tombstone information for frozen set collection
[ https://issues.apache.org/jira/browse/CASSANDRA-13573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ZhaoYang updated CASSANDRA-13573: - Status: Awaiting Feedback (was: In Progress) > sstabledump doesn't print out tombstone information for frozen set collection > - > > Key: CASSANDRA-13573 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13573 > Project: Cassandra > Issue Type: Bug > Components: Tools >Reporter: Stefano Ortolani >Assignee: ZhaoYang > > Schema and data" > {noformat} > CREATE TABLE ks.cf ( > hash blob, > report_id timeuuid, > subject_ids frozen>, > PRIMARY KEY (hash, report_id) > ) WITH CLUSTERING ORDER BY (report_id DESC); > INSERT INTO ks.cf (hash, report_id, subject_ids) VALUES (0x1213, now(), > {1,2,4,5}); > {noformat} > sstabledump output is: > {noformat} > sstabledump mc-1-big-Data.db > [ > { > "partition" : { > "key" : [ "1213" ], > "position" : 0 > }, > "rows" : [ > { > "type" : "row", > "position" : 16, > "clustering" : [ "ec01eed0-49d9-11e7-b39a-97a96f529c02" ], > "liveness_info" : { "tstamp" : "2017-06-05T10:29:57.434856Z" }, > "cells" : [ > { "name" : "subject_ids", "value" : "" } > ] > } > ] > } > ] > {noformat} > While the values are really there: > {noformat} > cqlsh:ks> select * from cf ; > hash | report_id| subject_ids > +--+- > 0x1213 | 02bafff0-49d9-11e7-b39a-97a96f529c02 | {1, 2, 4} > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Assigned] (CASSANDRA-12245) initial view build can be parallel
[ https://issues.apache.org/jira/browse/CASSANDRA-12245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrés de la Peña reassigned CASSANDRA-12245: - Assignee: Andrés de la Peña > initial view build can be parallel > -- > > Key: CASSANDRA-12245 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12245 > Project: Cassandra > Issue Type: Improvement >Reporter: Tom van der Woerdt >Assignee: Andrés de la Peña > > On a node with lots of data (~3TB) building a materialized view takes several > weeks, which is not ideal. It's doing this in a single thread. > There are several potential ways this can be optimized : > * do vnodes in parallel, instead of going through the entire range in one > thread > * just iterate through sstables, not worrying about duplicates, and include > the timestamp of the original write in the MV mutation. since this doesn't > exclude duplicates it does increase the amount of work and could temporarily > surface ghost rows (yikes) but I guess that's why they call it eventual > consistency. doing it this way can avoid holding references to all tables on > disk, allows parallelization, and removes the need to check other sstables > for existing data. this is essentially the 'do a full repair' path -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-13127) Materialized Views: View row expires too soon
[ https://issues.apache.org/jira/browse/CASSANDRA-13127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062967#comment-16062967 ] ZhaoYang edited comment on CASSANDRA-13127 at 7/7/17 9:25 AM: -- || source || junit-result || dtest-result|| | [trunk|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13127-trunk] | [utest|https://circleci.com/gh/jasonstack/cassandra/115] | {{bootstrap_test.TestBootstrap.consistent_range_movement_false_with_rf1_should_succeed_test}}[known|https://issues.apache.org/jira/browse/CASSANDRA-13576] {{cqlsh_tests.cqlsh_tests.TestCqlsh.test_describe}} | | [dtest| https://github.com/jasonstack/cassandra-dtest/commits/CASSANDRA-13127 ] | \ | \ | 1. View.mayBeAffectedBy will return true as long as view-key-values are not filtered 2. LivenessInfo.supersedes(another) will check localDeletionTime if timestamps are the same. greater localDeletionTimestamp supersedes. was (Author: jasonstack): || source || junit-result || dtest-result|| | [3.11|https://github.com/jasonstack/cassandra/commits/CASSANDRA-13127-trunk] | [utest|https://circleci.com/gh/jasonstack/cassandra/62] | | | [dtest| https://github.com/jasonstack/cassandra-dtest/commits/CASSANDRA-13127 ] | \ | \ | 1. View.mayBeAffectedBy will return true as long as view-key-values are not filtered 2. LivenessInfo.supersedes(another) will check localDeletionTime if timestamps are the same. greater localDeletionTimestamp supersedes. > Materialized Views: View row expires too soon > - > > Key: CASSANDRA-13127 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13127 > Project: Cassandra > Issue Type: Bug > Components: Local Write-Read Paths, Materialized Views >Reporter: Duarte Nunes >Assignee: ZhaoYang > > Consider the following commands, ran against trunk: > {code} > echo "DROP MATERIALIZED VIEW ks.mv; DROP TABLE ks.base;" | bin/cqlsh > echo "CREATE TABLE ks.base (p int, c int, v int, PRIMARY KEY (p, c));" | > bin/cqlsh > echo "CREATE MATERIALIZED VIEW ks.mv AS SELECT p, c FROM base WHERE p IS NOT > NULL AND c IS NOT NULL PRIMARY KEY (c, p);" | bin/cqlsh > echo "INSERT INTO ks.base (p, c) VALUES (0, 0) USING TTL 10;" | bin/cqlsh > # wait for row liveness to get closer to expiration > sleep 6; > echo "UPDATE ks.base USING TTL 8 SET v = 0 WHERE p = 0 and c = 0;" | bin/cqlsh > echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh > p | c | ttl(v) > ---+---+ > 0 | 0 | 7 > (1 rows) > c | p > ---+--- > 0 | 0 > (1 rows) > # wait for row liveness to expire > sleep 4; > echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh > p | c | ttl(v) > ---+---+ > 0 | 0 | 3 > (1 rows) > c | p > ---+--- > (0 rows) > {code} > Notice how the view row is removed even though the base row is still live. I > would say this is because in ViewUpdateGenerator#computeLivenessInfoForEntry > the TTLs are compared instead of the expiration times, but I'm not sure I'm > getting that far ahead in the code when updating a column that's not in the > view. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13594) Use an ExecutorService for repair commands instead of new Thread(..).start()
[ https://issues.apache.org/jira/browse/CASSANDRA-13594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077844#comment-16077844 ] Marcus Eriksson commented on CASSANDRA-13594: - Yes, it is Since we are reusing threads in the ExecutorService we need to clear out the tracing state between runs, I have pushed a commit that does that and restarted the dtests. > Use an ExecutorService for repair commands instead of new Thread(..).start() > > > Key: CASSANDRA-13594 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13594 > Project: Cassandra > Issue Type: Bug >Reporter: Marcus Eriksson >Assignee: Marcus Eriksson > Fix For: 4.x > > > Currently when starting a new repair, we create a new Thread and start it > immediately > It would be nice to be able to 1) limit the number of threads and 2) reject > starting new repair commands if we are already running too many. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-13573) sstabledump doesn't print out tombstone information for frozen set collection
[ https://issues.apache.org/jira/browse/CASSANDRA-13573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077805#comment-16077805 ] ZhaoYang edited comment on CASSANDRA-13573 at 7/7/17 8:32 AM: -- I am thinking to change all {{type.getString()}} in {{JsonTransformer}} to {{type.toJSONString}} when [13592|https://issues.apache.org/jira/browse/CASSANDRA-13592] merged. Current {{collectionType.getString()}} only generates entire data as byte string. Imo,{{getString}} is not designed for generate json readable values. was (Author: jasonstack): I am thinking to change all {{type.getString()}} in {{JsonTransformer}} to {{type.toJSONString}} when [13592|https://issues.apache.org/jira/browse/CASSANDRA-13592]. Current {{collectionType.getString()}} only generates entire data as byte string. Imo, it's not designed for generate json readable values. > sstabledump doesn't print out tombstone information for frozen set collection > - > > Key: CASSANDRA-13573 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13573 > Project: Cassandra > Issue Type: Bug > Components: Tools >Reporter: Stefano Ortolani >Assignee: ZhaoYang > > Schema and data" > {noformat} > CREATE TABLE ks.cf ( > hash blob, > report_id timeuuid, > subject_ids frozen>, > PRIMARY KEY (hash, report_id) > ) WITH CLUSTERING ORDER BY (report_id DESC); > INSERT INTO ks.cf (hash, report_id, subject_ids) VALUES (0x1213, now(), > {1,2,4,5}); > {noformat} > sstabledump output is: > {noformat} > sstabledump mc-1-big-Data.db > [ > { > "partition" : { > "key" : [ "1213" ], > "position" : 0 > }, > "rows" : [ > { > "type" : "row", > "position" : 16, > "clustering" : [ "ec01eed0-49d9-11e7-b39a-97a96f529c02" ], > "liveness_info" : { "tstamp" : "2017-06-05T10:29:57.434856Z" }, > "cells" : [ > { "name" : "subject_ids", "value" : "" } > ] > } > ] > } > ] > {noformat} > While the values are really there: > {noformat} > cqlsh:ks> select * from cf ; > hash | report_id| subject_ids > +--+- > 0x1213 | 02bafff0-49d9-11e7-b39a-97a96f529c02 | {1, 2, 4} > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-13573) sstabledump doesn't print out tombstone information for frozen set collection
[ https://issues.apache.org/jira/browse/CASSANDRA-13573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077805#comment-16077805 ] ZhaoYang commented on CASSANDRA-13573: -- I am thinking to change all {{type.getString()}} in {{JsonTransformer}} to {{type.toJSONString}} when [13592|https://issues.apache.org/jira/browse/CASSANDRA-13592]. Current {{collectionType.getString()}} only generates entire data as byte string. Imo, it's not designed for generate json readable values. > sstabledump doesn't print out tombstone information for frozen set collection > - > > Key: CASSANDRA-13573 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13573 > Project: Cassandra > Issue Type: Bug > Components: Tools >Reporter: Stefano Ortolani >Assignee: ZhaoYang > > Schema and data" > {noformat} > CREATE TABLE ks.cf ( > hash blob, > report_id timeuuid, > subject_ids frozen>, > PRIMARY KEY (hash, report_id) > ) WITH CLUSTERING ORDER BY (report_id DESC); > INSERT INTO ks.cf (hash, report_id, subject_ids) VALUES (0x1213, now(), > {1,2,4,5}); > {noformat} > sstabledump output is: > {noformat} > sstabledump mc-1-big-Data.db > [ > { > "partition" : { > "key" : [ "1213" ], > "position" : 0 > }, > "rows" : [ > { > "type" : "row", > "position" : 16, > "clustering" : [ "ec01eed0-49d9-11e7-b39a-97a96f529c02" ], > "liveness_info" : { "tstamp" : "2017-06-05T10:29:57.434856Z" }, > "cells" : [ > { "name" : "subject_ids", "value" : "" } > ] > } > ] > } > ] > {noformat} > While the values are really there: > {noformat} > cqlsh:ks> select * from cf ; > hash | report_id| subject_ids > +--+- > 0x1213 | 02bafff0-49d9-11e7-b39a-97a96f529c02 | {1, 2, 4} > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org