[jira] [Commented] (CASSANDRA-8192) AssertionError in Memory.java

2014-11-19 Thread Andreas Schnitzerling (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217575#comment-14217575
 ] 

Andreas Schnitzerling commented on CASSANDRA-8192:
--

On one node I can run with 1GB and no memory problems. I think I can find more 
of that nodes. So it's well running on 32-bit. I think, it should be supported 
and I hope, my other issues not relying to memory will not be rejected because 
of 32-bit. Thanks.

 AssertionError in Memory.java
 -

 Key: CASSANDRA-8192
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8192
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: Windows-7-32 bit, 3GB RAM, Java 1.7.0_67
Reporter: Andreas Schnitzerling
Assignee: Joshua McKenzie
 Attachments: cassandra.bat, cassandra.yaml, system.log


 Since update of 1 of 12 nodes from 2.1.0-rel to 2.1.1-rel Exception during 
 start up.
 {panel:title=system.log}
 ERROR [SSTableBatchOpen:1] 2014-10-27 09:44:00,079 CassandraDaemon.java:153 - 
 Exception in thread Thread[SSTableBatchOpen:1,5,main]
 java.lang.AssertionError: null
   at org.apache.cassandra.io.util.Memory.size(Memory.java:307) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.compress.CompressionMetadata.init(CompressionMetadata.java:135)
  ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.compress.CompressionMetadata.create(CompressionMetadata.java:83)
  ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.util.CompressedSegmentedFile$Builder.metadata(CompressedSegmentedFile.java:50)
  ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.util.CompressedPoolingSegmentedFile$Builder.complete(CompressedPoolingSegmentedFile.java:48)
  ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:766) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.sstable.SSTableReader.load(SSTableReader.java:725) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:402) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:302) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at 
 org.apache.cassandra.io.sstable.SSTableReader$4.run(SSTableReader.java:438) 
 ~[apache-cassandra-2.1.1.jar:2.1.1]
   at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
 ~[na:1.7.0_55]
   at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_55]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
 [na:1.7.0_55]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
 [na:1.7.0_55]
   at java.lang.Thread.run(Unknown Source) [na:1.7.0_55]
 {panel}
 In the attached log you can still see as well CASSANDRA-8069 and 
 CASSANDRA-6283.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8337) mmap underflow during validation compaction

2014-11-19 Thread Alexander Sterligov (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217584#comment-14217584
 ] 

Alexander Sterligov commented on CASSANDRA-8337:


After one crash got exception:
{quote}
ERROR [main] 2014-11-19 11:37:45,741 CassandraDaemon.java:465 - Exception 
encountered during startup
java.lang.NullPointerException: null
at 
org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:563)
 ~[apache-cassandra-2.1.2.jar:2.1.2]
at 
org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:232) 
[apache-cassandra-2.1.2.jar:2.1.2]
at 
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:448) 
[apache-cassandra-2.1.2.jar:2.1.2]
at 
org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:537) 
[apache-cassandra-2.1.2.jar:2.1.2]
{quote}

I think problem happens in case of lot's of replicas (I have 6 DC with 3 
replicas in each with replication factor 3) and a lots of streaming. I cannot 
reproduce it on 3 replicas in test environment, but it's a stable problem on 18 
replicas with about 1 000 000 small records.

Maybe sstables are compacted and validated before they were fully synced to 
disk?

 mmap underflow during validation compaction
 ---

 Key: CASSANDRA-8337
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8337
 Project: Cassandra
  Issue Type: Bug
Reporter: Alexander Sterligov
 Attachments: thread_dump


 During full parallel repair I often get errors like the following
 {quote}
 [2014-11-19 01:02:39,355] Repair session 116beaf0-6f66-11e4-afbb-c1c082008cbe 
 for range (3074457345618263602,-9223372036854775808] failed with error 
 org.apache.cassandra.exceptions.RepairException: [repair 
 #116beaf0-6f66-11e4-afbb-c1c082008cbe on iss/target_state_history, 
 (3074457345618263602,-9223372036854775808]] Validation failed in 
 /95.108.242.19
 {quote}
 At the log of the node there are always same exceptions:
 {quote}
 ERROR [ValidationExecutor:2] 2014-11-19 01:02:10,847 
 JVMStabilityInspector.java:94 - JVM state determined to be unstable.  Exiting 
 forcefully due to:
 org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
 mmap segment underflow; remaining is 15 but 47 requested
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1518)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1385)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPositionsForRanges(SSTableReader.java:1315)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1706)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1694)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.AbstractCompactionStrategy.getScanners(AbstractCompactionStrategy.java:276)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.WrappingCompactionStrategy.getScanners(WrappingCompactionStrategy.java:320)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.doValidationCompaction(CompactionManager.java:917)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.access$600(CompactionManager.java:97)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$9.call(CompactionManager.java:557)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_51]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
 Caused by: java.io.IOException: mmap segment underflow; remaining is 15 but 
 47 requested
 at 
 org.apache.cassandra.io.util.MappedFileDataInput.readBytes(MappedFileDataInput.java:135)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:348) 
 ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.readWithShortLength(ByteBufferUtil.java:327)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1460)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 ... 13 common frames omitted
 

[jira] [Updated] (CASSANDRA-8231) Wrong size of cached prepared statements

2014-11-19 Thread Benjamin Lerer (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Lerer updated CASSANDRA-8231:
--
Attachment: CASSANDRA-8231.txt

This patch replace the jamm version 0.2.8 by the version 0.3.0 which support 
the {{Unmetered}} annotation on type.

The {{ignoreKnownSingleton}} option of {{MemoryMeter}} was already excluding 
{{Class}} and {{Enum}} instances. So only the {{CFMetadata}}, {{AbstractType}} 
and {{Function}} had to be marked with the {{Unmetered}} annotation. 

I used the {{enableDebug}} option from {{MemoryMeter}} to verify that the 
measured instances were the expected ones. 

 Wrong size of cached prepared statements
 

 Key: CASSANDRA-8231
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8231
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Jaroslav Kamenik
Assignee: Benjamin Lerer
 Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java


 Cassandra counts memory footprint of prepared statements for caching 
 purposes. It seems, that there is problem with some statements, ie 
 SelectStatement. Even simple selects is counted as 100KB object, updates, 
 deletes etc have few hundreds or thousands bytes. Result is that cache - 
 QueryProcessor.preparedStatements  - holds just fraction of statements..
 I dig a little into the code, and it seems that problem is in jamm in class 
 MemoryMeter. It seems that if instance contains reference to class, it counts 
 size of whole class too. SelectStatement references EnumSet through 
 ResultSet.Metadata and EnumSet holds reference to Enum class...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8231) Wrong size of cached prepared statements

2014-11-19 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217593#comment-14217593
 ] 

Benjamin Lerer commented on CASSANDRA-8231:
---

[~dbros...@apache.org], you are quite familiar with Jamm, can you review my 
patch.

 Wrong size of cached prepared statements
 

 Key: CASSANDRA-8231
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8231
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Jaroslav Kamenik
Assignee: Benjamin Lerer
 Fix For: 2.1.3

 Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java


 Cassandra counts memory footprint of prepared statements for caching 
 purposes. It seems, that there is problem with some statements, ie 
 SelectStatement. Even simple selects is counted as 100KB object, updates, 
 deletes etc have few hundreds or thousands bytes. Result is that cache - 
 QueryProcessor.preparedStatements  - holds just fraction of statements..
 I dig a little into the code, and it seems that problem is in jamm in class 
 MemoryMeter. It seems that if instance contains reference to class, it counts 
 size of whole class too. SelectStatement references EnumSet through 
 ResultSet.Metadata and EnumSet holds reference to Enum class...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8302) Filtering for CONTAINS (KEY) on frozen collection clustering columns within a partition does not work

2014-11-19 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217626#comment-14217626
 ] 

Benjamin Lerer commented on CASSANDRA-8302:
---

+1

 Filtering for CONTAINS (KEY) on frozen collection clustering columns within a 
 partition does not work
 -

 Key: CASSANDRA-8302
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8302
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Tyler Hobbs
Assignee: Tyler Hobbs
Priority: Minor
 Fix For: 2.1.3

 Attachments: 8302.txt


 Create a table like this:
 {noformat}
 CREATE TABLE foo (
 a int,
 b int,
 c frozensetint
 d int,
 PRIMARY KEY (a, b, c, d)
 )
 {noformat}
 and add an index on it:
 {noformat}
 CREATE INDEX ON foo(b)
 {noformat}
 A query across all partitions will work correctly:
 {noformat}
 cqlsh:ks1 insert into foo (a, b, c, d) VALUES (0, 0, {1, 2}, 0);
 cqlsh:ks1 SELECT * FROM foo WHERE b=0 AND c CONTAINS 2 and d=0 ALLOW 
 FILTERING;
  a | b | c  | d
 ---+---++---
  0 | 0 | {1, 2} | 0
 (1 rows)
 {noformat}
 But if the query is restricted to a single partition, it is considered 
 invalid (and the error message isn't great):
 {noformat}
 cqlsh:ks1 SELECT * FROM foo WHERE a=0 AND b=0 AND c CONTAINS 2 and d=0 ALLOW 
 FILTERING;
 code=2200 [Invalid query] message=No secondary indexes on the restricted 
 columns support the provided operators: 
 {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-6717) Modernize schema tables

2014-11-19 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217639#comment-14217639
 ] 

Sylvain Lebresne commented on CASSANDRA-6717:
-

Btw, that wasn't mentioned above but I do think we should move from the old 
AbstractType class names for types in the schema tables. Let's serialize types 
using their CQL name (knowing that even for non-CQL types we'll still use the 
double-quoted classname). That probably means that for clustering columns 
definition we'd have to keep a boolean on whether the clustering order is 
reversed or not. 

 Modernize schema tables
 ---

 Key: CASSANDRA-6717
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6717
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 3.0


 There is a few problems/improvements that can be done with the way we store 
 schema:
 # CASSANDRA-4988: as explained on the ticket, storing the comparator is now 
 redundant (or almost, we'd need to store whether the table is COMPACT or not 
 too, which we don't currently is easy and probably a good idea anyway), it 
 can be entirely reconstructed from the infos in schema_columns (the same is 
 true of key_validator and subcomparator, and replacing default_validator by a 
 COMPACT_VALUE column in all case is relatively simple). And storing the 
 comparator as an opaque string broke concurrent updates of sub-part of said 
 comparator (concurrent collection addition or altering 2 separate clustering 
 columns typically) so it's really worth removing it.
 # CASSANDRA-4603: it's time to get rid of those ugly json maps. I'll note 
 that schema_keyspaces is a problem due to its use of COMPACT STORAGE, but I 
 think we should fix it once and for-all nonetheless (see below).
 # For CASSANDRA-6382 and to allow indexing both map keys and values at the 
 same time, we'd need to be able to have more than one index definition for a 
 given column.
 # There is a few mismatches in table options between the one stored in the 
 schema and the one used when declaring/altering a table which would be nice 
 to fix. The compaction, compression and replication maps are one already 
 mentioned from CASSANDRA-4603, but also for some reason 
 'dclocal_read_repair_chance' in CQL is called just 'local_read_repair_chance' 
 in the schema table, and 'min/max_compaction_threshold' are column families 
 option in the schema but just compaction options for CQL (which makes more 
 sense).
 None of those issues are major, and we could probably deal with them 
 independently but it might be simpler to just fix them all in one shot so I 
 wanted to sum them all up here. In particular, the fact that 
 'schema_keyspaces' uses COMPACT STORAGE is annoying (for the replication map, 
 but it may limit future stuff too) which suggest we should migrate it to a 
 new, non COMPACT table. And while that's arguably a detail, it wouldn't hurt 
 to rename schema_columnfamilies to schema_tables for the years to come since 
 that's the prefered vernacular for CQL.
 Overall, what I would suggest is to move all schema tables to a new keyspace, 
 named 'schema' for instance (or 'system_schema' but I prefer the shorter 
 version), and fix all the issues above at once. Since we currently don't 
 exchange schema between nodes of different versions, all we'd need to do that 
 is a one shot startup migration, and overall, I think it could be simpler for 
 clients to deal with one clear migration than to have to handle minor 
 individual changes all over the place. I also think it's somewhat cleaner 
 conceptually to have schema tables in their own keyspace since they are 
 replicated through a different mechanism than other system tables.
 If we do that, we could, for instance, migrate to the following schema tables 
 (details up for discussion of course):
 {noformat}
 CREATE TYPE user_type (
   name text,
   column_names listtext,
   column_types listtext
 )
 CREATE TABLE keyspaces (
   name text PRIMARY KEY,
   durable_writes boolean,
   replication mapstring, string,
   user_types mapstring, user_type
 )
 CREATE TYPE trigger_definition (
   name text,
   options maptex, text
 )
 CREATE TABLE tables (
   keyspace text,
   name text,
   id uuid,
   table_type text, // COMPACT, CQL or SUPER
   dropped_columns maptext, bigint,
   triggers maptext, trigger_definition,
   // options
   comment text,
   compaction maptext, text,
   compression maptext, text,
   read_repair_chance double,
   dclocal_read_repair_chance double,
   gc_grace_seconds int,
   caching text,
   rows_per_partition_to_cache text,
   default_time_to_live int,
   min_index_interval int,
   max_index_interval int,
   speculative_retry text,
   populate_io_cache_on_flush 

[jira] [Commented] (CASSANDRA-6717) Modernize schema tables

2014-11-19 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217645#comment-14217645
 ] 

Aleksey Yeschenko commented on CASSANDRA-6717:
--

Sure, I recall you mentioning that.

The end goal is to get as close to CQL CREATE TABLE syntax as technically 
possible, both for the schema tables and the metadata classes, too.

 Modernize schema tables
 ---

 Key: CASSANDRA-6717
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6717
 Project: Cassandra
  Issue Type: Improvement
Reporter: Sylvain Lebresne
Assignee: Aleksey Yeschenko
Priority: Minor
 Fix For: 3.0


 There is a few problems/improvements that can be done with the way we store 
 schema:
 # CASSANDRA-4988: as explained on the ticket, storing the comparator is now 
 redundant (or almost, we'd need to store whether the table is COMPACT or not 
 too, which we don't currently is easy and probably a good idea anyway), it 
 can be entirely reconstructed from the infos in schema_columns (the same is 
 true of key_validator and subcomparator, and replacing default_validator by a 
 COMPACT_VALUE column in all case is relatively simple). And storing the 
 comparator as an opaque string broke concurrent updates of sub-part of said 
 comparator (concurrent collection addition or altering 2 separate clustering 
 columns typically) so it's really worth removing it.
 # CASSANDRA-4603: it's time to get rid of those ugly json maps. I'll note 
 that schema_keyspaces is a problem due to its use of COMPACT STORAGE, but I 
 think we should fix it once and for-all nonetheless (see below).
 # For CASSANDRA-6382 and to allow indexing both map keys and values at the 
 same time, we'd need to be able to have more than one index definition for a 
 given column.
 # There is a few mismatches in table options between the one stored in the 
 schema and the one used when declaring/altering a table which would be nice 
 to fix. The compaction, compression and replication maps are one already 
 mentioned from CASSANDRA-4603, but also for some reason 
 'dclocal_read_repair_chance' in CQL is called just 'local_read_repair_chance' 
 in the schema table, and 'min/max_compaction_threshold' are column families 
 option in the schema but just compaction options for CQL (which makes more 
 sense).
 None of those issues are major, and we could probably deal with them 
 independently but it might be simpler to just fix them all in one shot so I 
 wanted to sum them all up here. In particular, the fact that 
 'schema_keyspaces' uses COMPACT STORAGE is annoying (for the replication map, 
 but it may limit future stuff too) which suggest we should migrate it to a 
 new, non COMPACT table. And while that's arguably a detail, it wouldn't hurt 
 to rename schema_columnfamilies to schema_tables for the years to come since 
 that's the prefered vernacular for CQL.
 Overall, what I would suggest is to move all schema tables to a new keyspace, 
 named 'schema' for instance (or 'system_schema' but I prefer the shorter 
 version), and fix all the issues above at once. Since we currently don't 
 exchange schema between nodes of different versions, all we'd need to do that 
 is a one shot startup migration, and overall, I think it could be simpler for 
 clients to deal with one clear migration than to have to handle minor 
 individual changes all over the place. I also think it's somewhat cleaner 
 conceptually to have schema tables in their own keyspace since they are 
 replicated through a different mechanism than other system tables.
 If we do that, we could, for instance, migrate to the following schema tables 
 (details up for discussion of course):
 {noformat}
 CREATE TYPE user_type (
   name text,
   column_names listtext,
   column_types listtext
 )
 CREATE TABLE keyspaces (
   name text PRIMARY KEY,
   durable_writes boolean,
   replication mapstring, string,
   user_types mapstring, user_type
 )
 CREATE TYPE trigger_definition (
   name text,
   options maptex, text
 )
 CREATE TABLE tables (
   keyspace text,
   name text,
   id uuid,
   table_type text, // COMPACT, CQL or SUPER
   dropped_columns maptext, bigint,
   triggers maptext, trigger_definition,
   // options
   comment text,
   compaction maptext, text,
   compression maptext, text,
   read_repair_chance double,
   dclocal_read_repair_chance double,
   gc_grace_seconds int,
   caching text,
   rows_per_partition_to_cache text,
   default_time_to_live int,
   min_index_interval int,
   max_index_interval int,
   speculative_retry text,
   populate_io_cache_on_flush boolean,
   bloom_filter_fp_chance double
   memtable_flush_period_in_ms int,
   PRIMARY KEY (keyspace, name)
 )
 CREATE TYPE index_definition (
   name text,
   index_type text,
   options maptext, text
 )
 CREATE TABLE columns 

[jira] [Created] (CASSANDRA-8339) Reading columns marked as type different than default validation class from CQL causes errors

2014-11-19 Thread Erik Forsberg (JIRA)
Erik Forsberg created CASSANDRA-8339:


 Summary: Reading columns marked as type different than default 
validation class from CQL causes errors
 Key: CASSANDRA-8339
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8339
 Project: Cassandra
  Issue Type: Bug
Reporter: Erik Forsberg
Assignee: Tyler Hobbs


As [discussed on users mailing 
list|http://www.mail-archive.com/user%40cassandra.apache.org/msg39251.html] I'm 
having trouble reading data from a table created via thrift, where some columns 
are marked as having a validator different than the default one.

Minimal working example:

{noformat}
#!/usr/bin/env python

# Run this in virtualenv with pycassa and cassandra-driver installed via pip
import pycassa
import cassandra
import calendar
import traceback
import time
from uuid import uuid4

keyspace = badcql

sysmanager = pycassa.system_manager.SystemManager(localhost)
sysmanager.create_keyspace(keyspace, 
strategy_options={'replication_factor':'1'})
sysmanager.create_column_family(keyspace, Users, 
key_validation_class=pycassa.system_manager.LEXICAL_UUID_TYPE,

comparator_type=pycassa.system_manager.ASCII_TYPE,

default_validation_class=pycassa.system_manager.UTF8_TYPE)
sysmanager.create_index(keyspace, Users, username, 
pycassa.system_manager.UTF8_TYPE)
sysmanager.create_index(keyspace, Users, email, 
pycassa.system_manager.UTF8_TYPE)
sysmanager.alter_column(keyspace, Users, default_account_id, 
pycassa.system_manager.LEXICAL_UUID_TYPE)
sysmanager.create_index(keyspace, Users, active, 
pycassa.system_manager.INT_TYPE)
sysmanager.alter_column(keyspace, Users, date_created, 
pycassa.system_manager.LONG_TYPE)

pool = pycassa.pool.ConnectionPool(keyspace, ['localhost:9160'])
cf = pycassa.ColumnFamily(pool, Users)

user_uuid = uuid4()

cf.insert(user_uuid, {'username':'test_username', 'auth_method':'ldap', 
'email':'t...@example.com', 'active':1, 
  'date_created':long(calendar.timegm(time.gmtime())), 
'default_account_id':uuid4()})

from cassandra.cluster import Cluster
cassandra_cluster = Cluster([localhost])
cassandra_session = cassandra_cluster.connect(keyspace)
print username, cassandra_session.execute('SELECT value from Users where 
key = %s and column1 = %s', (user_uuid, 'username',))
print email, cassandra_session.execute('SELECT value from Users where key = 
%s and column1 = %s', (user_uuid, 'email',))
try:
print default_account_id, cassandra_session.execute('SELECT value from 
Users where key = %s and column1 = %s', (user_uuid, 'default_account_id',))
except Exception as e:
print Exception trying to get default_account_id, traceback.format_exc()
cassandra_session = cassandra_cluster.connect(keyspace)

try:
print active, cassandra_session.execute('SELECT value from Users where 
key = %s and column1 = %s', (user_uuid, 'active',))
except Exception as e:
print Exception trying to get active, traceback.format_exc()
cassandra_session = cassandra_cluster.connect(keyspace)

try:
print date_created, cassandra_session.execute('SELECT value from Users 
where key = %s and column1 = %s', (user_uuid, 'date_created',))
except Exception as e:
print Exception trying to get date_created, traceback.format_exc()

{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8010) cassandra-stress needs better docs for rate options

2014-11-19 Thread Liang Xie (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217676#comment-14217676
 ] 

Liang Xie commented on CASSANDRA-8010:
--

see:
{code}
$ ./cassandra-stress help -rate

Usage: -rate threads=? [limit=?]
 OR 
Usage: -rate [auto] [threads=?] [threads=?]

  threads=?run this many clients concurrently
  limit=? (default=0/s)limit operations per second across 
all clients
  auto test with increasing number of 
threadCount until performance plateaus
  threads=? (default=4)   run at least this many clients 
concurrently
  threads=? (default=1000)run at most this many clients 
concurrently
{code}
maybe we can close this JIRA now?

 cassandra-stress needs better docs for rate options
 ---

 Key: CASSANDRA-8010
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8010
 Project: Cassandra
  Issue Type: Bug
  Components: Documentation  website, Examples, Tools
Reporter: Matt Stump
Priority: Minor
  Labels: lhf

 It's not obvious how to use the rate option. I wasn't able to figure it out 
 via the source, or from the docs. I kept trying to do -rate= or -threads=. I 
 had to search confluence for usage examples.
 Need something like this in the docs:
 -rate threads=900
 -rate threads=900



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8193) Multi-DC parallel snapshot repair

2014-11-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217678#comment-14217678
 ] 

Jimmy Mårdell commented on CASSANDRA-8193:
--

The only change I made to StorageServiceMBean is the addition of two new 
methods, so I think it should be fine?



 Multi-DC parallel snapshot repair
 -

 Key: CASSANDRA-8193
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8193
 Project: Cassandra
  Issue Type: Improvement
Reporter: Jimmy Mårdell
Assignee: Jimmy Mårdell
Priority: Minor
 Fix For: 2.0.12

 Attachments: cassandra-2.0-8193-1.txt, cassandra-2.0-8193-2.txt


 The current behaviour of snapshot repair is to let one node at a time 
 calculate a merkle tree. This is to ensure only one node at a time is doing 
 the expensive calculation. The drawback is that it takes even longer time to 
 do the merkle tree calculation.
 In a multi-DC setup, I think it would make more sense to have one node in 
 each DC calculate the merkle tree at the same time. This would yield a 
 significant improvement when you have many data centers.
 I'm not sure how relevant this is in 2.1, but I don't see us upgrading to 2.1 
 any time soon. Unless there is an obvious drawback that I'm missing, I'd like 
 to implement this in the 2.0 branch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8323) Adapt UDF code after JAVA-502

2014-11-19 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217679#comment-14217679
 ] 

Robert Stupp commented on CASSANDRA-8323:
-

Linked CASSANDRA-6717 since if we get rid of {{AbstractType}} in 3.0 at all, we 
do not need this functionality any more.

 Adapt UDF code after JAVA-502
 -

 Key: CASSANDRA-8323
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8323
 Project: Cassandra
  Issue Type: Improvement
Reporter: Robert Stupp
Assignee: Robert Stupp
 Fix For: 3.0


 In CASSANDRA-7563 support for user-types, tuple-types and collections is 
 added to C* using the Java Driver.
 The code in C* requires access to some functionality which is currently 
 performed using reflection/invoke-dynamic.
 This ticket is about to provide better/direct access to that functionality.
 I'll provide patches for Java Driver + C*.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7188) Wrong class type: class org.apache.cassandra.db.Column in CounterColumn.reconcile

2014-11-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217738#comment-14217738
 ] 

Nicolas Lalevée commented on CASSANDRA-7188:


Our prod cluster upgraded to 2.0.11.
Without incident !

Thank you for the bug fix.

 Wrong class type: class org.apache.cassandra.db.Column in 
 CounterColumn.reconcile
 -

 Key: CASSANDRA-7188
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7188
 Project: Cassandra
  Issue Type: Bug
Reporter: Nicolas Lalevée
Assignee: Aleksey Yeschenko
  Labels: qa-resolved
 Fix For: 2.0.11

 Attachments: 7188.txt


 When migrating a cluster of 6 nodes from 1.2.11 to 2.0.7, we started to see 
 on the first migrated node this error:
 {noformat}
 ERROR [ReplicateOnWriteStage:1] 2014-05-07 11:26:59,779 CassandraDaemon.java 
 (line 198) Exception in thread Thread[ReplicateOnWriteStage:1,5,main]
 java.lang.AssertionError: Wrong class type: class 
 org.apache.cassandra.db.Column
 at 
 org.apache.cassandra.db.CounterColumn.reconcile(CounterColumn.java:159)
 at 
 org.apache.cassandra.db.filter.QueryFilter$1.reduce(QueryFilter.java:109)
 at 
 org.apache.cassandra.db.filter.QueryFilter$1.reduce(QueryFilter.java:103)
 at 
 org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:112)
 at 
 org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext(MergeIterator.java:98)
 at 
 com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
 at 
 com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
 at 
 org.apache.cassandra.db.filter.NamesQueryFilter.collectReducedColumns(NamesQueryFilter.java:98)
 at 
 org.apache.cassandra.db.filter.QueryFilter.collateColumns(QueryFilter.java:122)
 at 
 org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(QueryFilter.java:80)
 at 
 org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(QueryFilter.java:72)
 at 
 org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:297)
 at 
 org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:53)
 at 
 org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1540)
 at 
 org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1369)
 at org.apache.cassandra.db.Keyspace.getRow(Keyspace.java:327)
 at 
 org.apache.cassandra.db.SliceByNamesReadCommand.getRow(SliceByNamesReadCommand.java:55)
 at 
 org.apache.cassandra.db.CounterMutation.makeReplicationMutation(CounterMutation.java:100)
 at 
 org.apache.cassandra.service.StorageProxy$8$1.runMayThrow(StorageProxy.java:1085)
 at 
 org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1916)
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)
 {noformat}
 We then saw on the other 5 nodes, still on 1.2.x, this error:
 {noformat}
 ERROR [MutationStage:2793] 2014-05-07 11:46:12,301 CassandraDaemon.java (line 
 191) Exception in thread Thread[MutationStage:2793,5,main]
 java.lang.AssertionError: Wrong class type: class 
 org.apache.cassandra.db.Column
 at 
 org.apache.cassandra.db.CounterColumn.reconcile(CounterColumn.java:165)
 at 
 org.apache.cassandra.db.AtomicSortedColumns$Holder.addColumn(AtomicSortedColumns.java:378)
 at 
 org.apache.cassandra.db.AtomicSortedColumns.addColumn(AtomicSortedColumns.java:166)
 at 
 org.apache.cassandra.db.AbstractColumnContainer.addColumn(AbstractColumnContainer.java:119)
 at org.apache.cassandra.db.SuperColumn.addColumn(SuperColumn.java:218)
 at org.apache.cassandra.db.SuperColumn.putColumn(SuperColumn.java:229)
 at 
 org.apache.cassandra.db.ThreadSafeSortedColumns.addColumnInternal(ThreadSafeSortedColumns.java:108)
 at 
 org.apache.cassandra.db.ThreadSafeSortedColumns.addAllWithSizeDelta(ThreadSafeSortedColumns.java:138)
 at 
 org.apache.cassandra.db.AbstractColumnContainer.addAllWithSizeDelta(AbstractColumnContainer.java:99)
 at org.apache.cassandra.db.Memtable.resolve(Memtable.java:205)
 at org.apache.cassandra.db.Memtable.put(Memtable.java:168)
 at 
 org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:742)
 at org.apache.cassandra.db.Table.apply(Table.java:388)
 at org.apache.cassandra.db.Table.apply(Table.java:353)
 at 

[jira] [Commented] (CASSANDRA-8067) NullPointerException in KeyCacheSerializer

2014-11-19 Thread Andreas Schnitzerling (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217774#comment-14217774
 ] 

Andreas Schnitzerling commented on CASSANDRA-8067:
--

Today I got that failure during nodetool upgradesstables after upgrading from 
2.0.10 to 2.1.2 w/ finalizer-patch CASSANDRA-6283
{noformat}
ERROR [CompactionExecutor:65] 2014-11-19 09:56:02,453 CassandraDaemon.java:153 
- Exception in thread Thread[CompactionExecutor:65,1,main]
java.lang.NullPointerException: null
at 
org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:475)
 ~[apache-cassandra-2.1.2-SNAPSHOT.jar:2.1.2-SNAPSHOT]
at 
org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:463)
 ~[apache-cassandra-2.1.2-SNAPSHOT.jar:2.1.2-SNAPSHOT]
at 
org.apache.cassandra.cache.AutoSavingCache$Writer.saveCache(AutoSavingCache.java:274)
 ~[apache-cassandra-2.1.2-SNAPSHOT.jar:2.1.2-SNAPSHOT]
at 
org.apache.cassandra.db.compaction.CompactionManager$11.run(CompactionManager.java:1088)
 ~[apache-cassandra-2.1.2-SNAPSHOT.jar:2.1.2-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
~[na:1.7.0_55]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
[na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
[na:1.7.0_55]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_55]
{noformat}

 NullPointerException in KeyCacheSerializer
 --

 Key: CASSANDRA-8067
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8067
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Eric Leleu
 Fix For: 2.1.1


 Hi,
 I have this stack trace in the logs of Cassandra server (v2.1)
 {code}
 ERROR [CompactionExecutor:14] 2014-10-06 23:32:02,098 
 CassandraDaemon.java:166 - Exception in thread 
 Thread[CompactionExecutor:14,1,main]
 java.lang.NullPointerException: null
 at 
 org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:475)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:463)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.cache.AutoSavingCache$Writer.saveCache(AutoSavingCache.java:225)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$11.run(CompactionManager.java:1061)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown 
 Source) ~[na:1.7.0]
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 
 ~[na:1.7.0]
 at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0]
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
 [na:1.7.0]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
 [na:1.7.0]
 at java.lang.Thread.run(Unknown Source) [na:1.7.0]
 {code}
 It may not be critical because this error occured in the AutoSavingCache. 
 However the line 475 is about the CFMetaData so it may hide bigger issue...
 {code}
  474 CFMetaData cfm = 
 Schema.instance.getCFMetaData(key.desc.ksname, key.desc.cfname);
  475 cfm.comparator.rowIndexEntrySerializer().serialize(entry, 
 out);
 {code}
 Regards,
 Eric



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8055) Centralize shared executors

2014-11-19 Thread Sam Tunnicliffe (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Tunnicliffe updated CASSANDRA-8055:
---
Attachment: 8055.txt

 Centralize shared executors
 ---

 Key: CASSANDRA-8055
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8055
 Project: Cassandra
  Issue Type: Improvement
Reporter: T Jake Luciani
Assignee: Sam Tunnicliffe
Priority: Minor
  Labels: lhf
 Fix For: 2.1.3

 Attachments: 8055.txt


 As mentioned in CASSANDRA-7930 we should put shared executors in a common 
 class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Reopened] (CASSANDRA-8067) NullPointerException in KeyCacheSerializer

2014-11-19 Thread Yuki Morishita (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8067?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yuki Morishita reopened CASSANDRA-8067:
---

reopening for investigation

 NullPointerException in KeyCacheSerializer
 --

 Key: CASSANDRA-8067
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8067
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Eric Leleu
 Fix For: 2.1.1


 Hi,
 I have this stack trace in the logs of Cassandra server (v2.1)
 {code}
 ERROR [CompactionExecutor:14] 2014-10-06 23:32:02,098 
 CassandraDaemon.java:166 - Exception in thread 
 Thread[CompactionExecutor:14,1,main]
 java.lang.NullPointerException: null
 at 
 org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:475)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.service.CacheService$KeyCacheSerializer.serialize(CacheService.java:463)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.cache.AutoSavingCache$Writer.saveCache(AutoSavingCache.java:225)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$11.run(CompactionManager.java:1061)
  ~[apache-cassandra-2.1.0.jar:2.1.0]
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown 
 Source) ~[na:1.7.0]
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 
 ~[na:1.7.0]
 at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0]
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
 [na:1.7.0]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
 [na:1.7.0]
 at java.lang.Thread.run(Unknown Source) [na:1.7.0]
 {code}
 It may not be critical because this error occured in the AutoSavingCache. 
 However the line 475 is about the CFMetaData so it may hide bigger issue...
 {code}
  474 CFMetaData cfm = 
 Schema.instance.getCFMetaData(key.desc.ksname, key.desc.cfname);
  475 cfm.comparator.rowIndexEntrySerializer().serialize(entry, 
 out);
 {code}
 Regards,
 Eric



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8340) Use sstable min timestamp when deciding if an sstable should be included in DTCS compactions

2014-11-19 Thread Marcus Eriksson (JIRA)
Marcus Eriksson created CASSANDRA-8340:
--

 Summary: Use sstable min timestamp when deciding if an sstable 
should be included in DTCS compactions
 Key: CASSANDRA-8340
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8340
 Project: Cassandra
  Issue Type: Improvement
Reporter: Marcus Eriksson
Priority: Minor


Currently we check how old the newest data (max timestamp) in an sstable is 
when we check if it should be compacted.

If we instead switch to using min timestamp for this we have a pretty clean 
migration path from STCS/LCS to DTCS. 

My thinking is that before migrating, the user does a major compaction, which 
creates a huge sstable containing all data, with min timestamp very far back in 
time, then switching to DTCS, we will have a big sstable that we never compact 
(ie, min timestamp of this big sstable is before max_sstable_age_days), and all 
newer data will be after that, and that new data will be properly compacted

WDYT [~Bj0rn] ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8264) Problems with multicolumn relations and COMPACT STORAGE

2014-11-19 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217860#comment-14217860
 ] 

Benjamin Lerer commented on CASSANDRA-8264:
---

+1

 Problems with multicolumn relations and COMPACT STORAGE
 ---

 Key: CASSANDRA-8264
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8264
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Tyler Hobbs
Assignee: Tyler Hobbs
 Fix For: 2.0.12, 2.1.3

 Attachments: 8264-2.0.txt, 8264-2.1.txt


 As discovered in CASSANDRA-7859, there are a few issues with multi-column 
 relations and {{COMPACT STORAGE}}.
 The first issue is that IN clauses on multiple columns aren't handled 
 correctly.  There appear to be other issues as well, but I haven't been able 
 to dig into them yet.  To reproduce the issues, run each of the tests in 
 {{MultiColumnRelationTest}} with a {{COMPACT STORAGE}} version of the table.  
 (Changing the tests to do that automatically will be part of the ticket.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8231) Wrong size of cached prepared statements

2014-11-19 Thread Dave Brosius (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217884#comment-14217884
 ] 

Dave Brosius commented on CASSANDRA-8231:
-

+LGTM. i'll push 0.30 to maven

 Wrong size of cached prepared statements
 

 Key: CASSANDRA-8231
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8231
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Jaroslav Kamenik
Assignee: Benjamin Lerer
 Fix For: 2.1.3

 Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java


 Cassandra counts memory footprint of prepared statements for caching 
 purposes. It seems, that there is problem with some statements, ie 
 SelectStatement. Even simple selects is counted as 100KB object, updates, 
 deletes etc have few hundreds or thousands bytes. Result is that cache - 
 QueryProcessor.preparedStatements  - holds just fraction of statements..
 I dig a little into the code, and it seems that problem is in jamm in class 
 MemoryMeter. It seems that if instance contains reference to class, it counts 
 size of whole class too. SelectStatement references EnumSet through 
 ResultSet.Metadata and EnumSet holds reference to Enum class...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8231) Wrong size of cached prepared statements

2014-11-19 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217896#comment-14217896
 ] 

Benjamin Lerer commented on CASSANDRA-8231:
---

Thanks

 Wrong size of cached prepared statements
 

 Key: CASSANDRA-8231
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8231
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Jaroslav Kamenik
Assignee: Benjamin Lerer
 Fix For: 2.1.3

 Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java


 Cassandra counts memory footprint of prepared statements for caching 
 purposes. It seems, that there is problem with some statements, ie 
 SelectStatement. Even simple selects is counted as 100KB object, updates, 
 deletes etc have few hundreds or thousands bytes. Result is that cache - 
 QueryProcessor.preparedStatements  - holds just fraction of statements..
 I dig a little into the code, and it seems that problem is in jamm in class 
 MemoryMeter. It seems that if instance contains reference to class, it counts 
 size of whole class too. SelectStatement references EnumSet through 
 ResultSet.Metadata and EnumSet holds reference to Enum class...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8231) Wrong size of cached prepared statements

2014-11-19 Thread Dave Brosius (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217900#comment-14217900
 ] 

Dave Brosius commented on CASSANDRA-8231:
-

ah one thing. don't forget to change the license file name for jamm.

 Wrong size of cached prepared statements
 

 Key: CASSANDRA-8231
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8231
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Jaroslav Kamenik
Assignee: Benjamin Lerer
 Fix For: 2.1.3

 Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java


 Cassandra counts memory footprint of prepared statements for caching 
 purposes. It seems, that there is problem with some statements, ie 
 SelectStatement. Even simple selects is counted as 100KB object, updates, 
 deletes etc have few hundreds or thousands bytes. Result is that cache - 
 QueryProcessor.preparedStatements  - holds just fraction of statements..
 I dig a little into the code, and it seems that problem is in jamm in class 
 MemoryMeter. It seems that if instance contains reference to class, it counts 
 size of whole class too. SelectStatement references EnumSet through 
 ResultSet.Metadata and EnumSet holds reference to Enum class...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8329) LeveledCompactionStrategy should split large files across data directories when compacting

2014-11-19 Thread Yuki Morishita (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217926#comment-14217926
 ] 

Yuki Morishita commented on CASSANDRA-8329:
---

[~aboudreault] Thanks for your help. We need to check if LCS will write to 
multiple disks when compacting large SSTables in L0 after the patch.

 LeveledCompactionStrategy should split large files across data directories 
 when compacting
 --

 Key: CASSANDRA-8329
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8329
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: J.B. Langston
Assignee: Marcus Eriksson
 Fix For: 2.0.12

 Attachments: 
 0001-get-new-sstable-directory-for-every-new-file-during-.patch


 Because we fall back to STCS for L0 when LCS gets behind, the sstables in L0 
 can get quite large during sustained periods of heavy writes.  This can 
 result in large imbalances between data volumes when using JBOD support.  
 Eventually these large files get broken up as L0 sstables are moved up into 
 higher levels; however, because LCS only chooses a single volume on which to 
 write all of the sstables created during a single compaction, the imbalance 
 is persisted.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8286) Regression in ORDER BY

2014-11-19 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14217927#comment-14217927
 ] 

Benjamin Lerer commented on CASSANDRA-8286:
---

I like the new unit tests.
+1

 Regression in ORDER BY
 --

 Key: CASSANDRA-8286
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8286
 Project: Cassandra
  Issue Type: Bug
Reporter: Philip Thompson
Assignee: Tyler Hobbs
  Labels: cql
 Fix For: 2.0.12, 2.1.3

 Attachments: 8286-2.0-v2.txt, 8286-2.0.txt, 8286-2.1-v2.txt, 
 8286-2.1.txt, 8286-trunk-v2.txt, 8286-trunk.txt


 The dtest {{cql_tests.py:TestCQL.order_by_multikey_test}} is now failing in 
 2.0:
 http://cassci.datastax.com/job/cassandra-2.0_dtest/lastCompletedBuild/testReport/cql_tests/TestCQL/order_by_multikey_test/history/
 This failure began at the commit for CASSANDRA-8178.
 The error message reads 
 {code}==
 ERROR: order_by_multikey_test (cql_tests.TestCQL)
 --
 Traceback (most recent call last):
   File /Users/philipthompson/cstar/cassandra-dtest/dtest.py, line 524, in 
 wrapped
 f(obj)
   File /Users/philipthompson/cstar/cassandra-dtest/cql_tests.py, line 1807, 
 in order_by_multikey_test
 res = cursor.execute(SELECT col1 FROM test WHERE my_id in('key1', 
 'key2', 'key3') ORDER BY col1;)
   File /Library/Python/2.7/site-packages/cassandra/cluster.py, line 1281, 
 in execute
 result = future.result(timeout)
   File /Library/Python/2.7/site-packages/cassandra/cluster.py, line 2771, 
 in result
 raise self._final_exception
 InvalidRequest: code=2200 [Invalid query] message=ORDER BY could not be used 
 on columns missing in select clause.{code}
 and occurs at the query {{SELECT col1 FROM test WHERE my_id in('key1', 
 'key2', 'key3') ORDER BY col1;}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8055) Centralize shared executors

2014-11-19 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko updated CASSANDRA-8055:
-
Reviewer: Aleksey Yeschenko

 Centralize shared executors
 ---

 Key: CASSANDRA-8055
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8055
 Project: Cassandra
  Issue Type: Improvement
Reporter: T Jake Luciani
Assignee: Sam Tunnicliffe
Priority: Minor
  Labels: lhf
 Fix For: 2.1.3

 Attachments: 8055.txt


 As mentioned in CASSANDRA-7930 we should put shared executors in a common 
 class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-8018) Cassandra seems to insert twice in custom PerColumnSecondaryIndex

2014-11-19 Thread Benjamin Lerer (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Lerer reassigned CASSANDRA-8018:
-

Assignee: Benjamin Lerer

 Cassandra seems to insert twice in custom PerColumnSecondaryIndex
 -

 Key: CASSANDRA-8018
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8018
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Pavel Chlupacek
Assignee: Benjamin Lerer
 Fix For: 2.1.3


 When inserting data into Cassandra 2.1.0 into table with custom secondary 
 index, the Cell is inserted twice, if inserting new entry into row with same 
 rowId, but different cluster index columns. 
 
 CREATE KEYSPACE fulltext WITH replication = {'class': 'SimpleStrategy',  
 'replication_factor' : 1};
 CREATE TABLE fulltext.test ( id uuid, name text, name2 text, json varchar, 
 lucene text, primary key ( id , name));
 sCREATE CUSTOM INDEX lucene_idx on fulltext.test(lucene) using 
 'com.spinoco.fulltext.cassandra.TestIndex'; 
 // this causes only one insert
  insertInto(fulltext,test)
   .value(id, id1.uuid)
   .value(name, goosh1) 
   .value(json, TestContent.message1.asJson)
 // this causes 2 inserts to be done 
  insertInto(fulltext,test)
 .value(id, id1.uuid)
 .value(name, goosh2)
 .value(json, TestContent.message2.asJson)
 /// stacktraces for inserts (always same, for 1st and 2nd insert)
 custom indexer stacktraces and then
   at 
 org.apache.cassandra.db.index.SecondaryIndexManager$StandardUpdater.insert(SecondaryIndexManager.java:707)
   at 
 org.apache.cassandra.db.AtomicBTreeColumns$ColumnUpdater.apply(AtomicBTreeColumns.java:344)
   at 
 org.apache.cassandra.db.AtomicBTreeColumns$ColumnUpdater.apply(AtomicBTreeColumns.java:319)
   at 
 org.apache.cassandra.utils.btree.NodeBuilder.addNewKey(NodeBuilder.java:323)
   at 
 org.apache.cassandra.utils.btree.NodeBuilder.update(NodeBuilder.java:191)
   at org.apache.cassandra.utils.btree.Builder.update(Builder.java:74)
   at org.apache.cassandra.utils.btree.BTree.update(BTree.java:186)
   at 
 org.apache.cassandra.db.AtomicBTreeColumns.addAllWithSizeDelta(AtomicBTreeColumns.java:189)
   at org.apache.cassandra.db.Memtable.put(Memtable.java:194)
   at 
 org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1142)
   at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:394)
   at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:351)
   at org.apache.cassandra.db.Mutation.apply(Mutation.java:214)
   at 
 org.apache.cassandra.service.StorageProxy$7.runMayThrow(StorageProxy.java:970)
   at 
 org.apache.cassandra.service.StorageProxy$LocalMutationRunnable.run(StorageProxy.java:2080)
   at 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at 
 org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:163)
   at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:103)
   at java.lang.Thread.run(Thread.java:744)
  Note that cell, rowkey and Group in public abstract void 
 insert(ByteBuffer rowKey, Cell col, OpOrder.Group opGroup); are having for 
 both successive calls same identity 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8228) Log malfunctioning host on prepareForRepair

2014-11-19 Thread Rajanarayanan Thottuvaikkatumana (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218030#comment-14218030
 ] 

Rajanarayanan Thottuvaikkatumana commented on CASSANDRA-8228:
-

Anything else from my side? Thanks

 Log malfunctioning host on prepareForRepair
 ---

 Key: CASSANDRA-8228
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8228
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Juho Mäkinen
Assignee: Rajanarayanan Thottuvaikkatumana
Priority: Trivial
  Labels: lhf
 Attachments: cassandra-trunk-8228.txt


 Repair startup goes thru ActiveRepairService.prepareForRepair() which might 
 result with Repair failed with error Did not get positive replies from all 
 endpoints. error, but there's no other logging regarding to this error.
 It seems that it would be trivial to modify the prepareForRepair() to log the 
 host address which caused the error, thus ease the debugging effort.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8212) Archive Commitlog Test Failing

2014-11-19 Thread Philip Thompson (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philip Thompson updated CASSANDRA-8212:
---
Assignee: Marcus Eriksson

 Archive Commitlog Test Failing
 --

 Key: CASSANDRA-8212
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8212
 Project: Cassandra
  Issue Type: Bug
Reporter: Philip Thompson
Assignee: Marcus Eriksson
 Fix For: 2.0.12


 The test snapshot_test.TestArchiveCommitlog.test_archive_commitlog is failing 
 on 2.0.11, but not 2.1.1. We attempt to replay 65000 rows, but in 2.0.11 only 
 63000 rows succeed. URL for test output:
 http://cassci.datastax.com/job/cassandra-2.0_dtest/lastCompletedBuild/testReport/snapshot_test/TestArchiveCommitlog/test_archive_commitlog/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7075) Add the ability to automatically distribute your commitlogs across all data volumes

2014-11-19 Thread Branimir Lambov (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218069#comment-14218069
 ] 

Branimir Lambov commented on CASSANDRA-7075:


First draft of the multi-volume commit log can be found 
[here|https://github.com/blambov/cassandra/compare/7075-commitlog-volumes-2]. 
This is still a work in progress, but while I'm looking at ways to properly 
test everything, I'd be interested in some opinions on where to take this next.

To be able to spread the load between drives, the new implementation switches 
'volumes' on every sync request. Each volume has its own writing thread (which 
in the compressed case will also be doing the compression); the segment 
management thread, which handles creating and recycling segments, remains 
shared for now. Each volume writes in its own CommitLogSegment, so in effect we 
may write some mutations in one segment, switch to the segment in the other 
drive, then switch back to writing in the first-- which means that the order of 
mutations is no longer defined first by the segment ID. To deal with this I 
exposed the concept of a 'section', which existed before as the set of 
mutations between two sync markers, and gave the section an ID which now 
replaces the segment ID in ReplayPositions. Every time we start writing to a 
volume, a new section with a fresh ID is created. Every time we switch volumes, 
a write for the old section is scheduled and either the volume is put back at 
the end of a queue of ready-to-use volumes (if the segment is not exhausted or 
there is an available reserve segment) or the management thread is woken to 
prepare a new segment and put the volume back in the queue when one is ready.

Because of the new ordering, commit log replay now has to be able to sort and 
operate on the level of sections (for new logs) as well as on the level of 
segments (for legacy logs). The machinery is refactored a little to permit 
this, and the new code is also used to select a non-conflicting section ID at 
start.

For full flexibility commit log volumes are configured separately from data 
volumes. If necessary, multiple volumes can be assigned to the same drive. With 
archiving it's not clear where archived logs should be restored, thus I created 
an option to specify that as well (with a default of sending them to the first 
CL volume).

The current code has more locking than I'd like, most importantly in 
CLSM.advanceVolume(), which is called every time a disk synchronization is 
requested (also when a segment is full, but that has much lower frequency). 
There is a noticeable impact on performance; I need more performance testing in 
various configurations to quantify it. I can see three ways to continue from 
here:

# Leave the locking as it is, which permits flexibility in the ordering of 
volumes in the queue. This can be made use of by making queuedVolumes a 
priority queue, ordered, e.g. by expected sync finish time. The latter will be 
able to handle heterogeneous situations (e.g. SSDs + HDDs; more importantly 
uneven distribution of requests from other parts of the code on the drives) 
very well. I think this option will result in the least complex code and the 
highest flexibility of the solution.
# Not permit reordering of volumes in the queue, which lets section IDs be 
assigned on queue entry rather than exit; with a little more work switching to 
a new section from the queue can be made a single compare-and-swap. In this 
option the load necessarily has to be spread evenly between the specified CL 
volumes (not necessarily between the drives as a user still may give multiple 
directories on the same drive). With a single CL volume and possibly in 
homogeneous scenarios this option should result in the best performance.
# As above, but put sections in the queue only when the previous sync for the 
volume has completed. This option can use the drives' performance most 
efficiently, but it needs another queuing layer to be able to properly deal 
with situations where all drives are busy and mutations are still incoming.

I'm leaning towards (1) for the flexibility, but that may be a performance 
regression in the single-volume case. Is it worth investing the time to try out 
two or all three options?

 Add the ability to automatically distribute your commitlogs across all data 
 volumes
 ---

 Key: CASSANDRA-7075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7075
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Tupshin Harper
Assignee: Branimir Lambov
Priority: Minor
  Labels: performance
 Fix For: 3.0


 given the prevalance of ssds (no need to separate commitlog and data), and 
 improved 

[jira] [Created] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Chris Lohfink (JIRA)
Chris Lohfink created CASSANDRA-8341:


 Summary: Expose time spent in each thread pool
 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor


Can increment a counter with time spent in each queue.  This can provide 
context on how much time is spent percentage wise in each stage.  Additionally 
can be used with littles law in future if ever want to try to tune the size of 
the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Chris Lohfink (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Lohfink updated CASSANDRA-8341:
-
Attachment: 8341.patch

 Expose time spent in each thread pool
 -

 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor
  Labels: metrics
 Attachments: 8341.patch


 Can increment a counter with time spent in each queue.  This can provide 
 context on how much time is spent percentage wise in each stage.  
 Additionally can be used with littles law in future if ever want to try to 
 tune the size of the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Chris Lohfink (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218111#comment-14218111
 ] 

Chris Lohfink commented on CASSANDRA-8341:
--

Attached a first pass patch for an idea.  I just recorded the wall time but may 
want to record cpu time as well ([getCurrentThreadCpuTime  
getCurrentThreadUserTime|https://docs.oracle.com/javase/7/docs/api/java/lang/management/ThreadMXBean.html#getCurrentThreadCpuTime()]).
  May be worth recording it with a histogram instead of just a counter as well, 
but for the purpose of exposing % of time I think the total is sufficient.  I 
added an insertion meter as well for easier time in estimating different pool 
sizes (just easier then adding up the pending/completed/active and give sense 
of rate).

 Expose time spent in each thread pool
 -

 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor
  Labels: metrics
 Attachments: 8341.patch


 Can increment a counter with time spent in each queue.  This can provide 
 context on how much time is spent percentage wise in each stage.  
 Additionally can be used with littles law in future if ever want to try to 
 tune the size of the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218149#comment-14218149
 ] 

Robert Stupp commented on CASSANDRA-8341:
-

FWIW it's not necessary to add another {{ThreadLocal}} to trace work-unit start 
time. Wrapping the {{Runnable}} using a static class containing the start-time 
feels cheaper.
Adding to metrics code before or after work-unit execution transparently 
extends work-unit execution latency, which isn't measured.
(Note that System.nanoTime() [may introduce 
latency|http://shipilev.net/blog/2014/nanotrusting-nanotime/]).

 Expose time spent in each thread pool
 -

 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor
  Labels: metrics
 Attachments: 8341.patch


 Can increment a counter with time spent in each queue.  This can provide 
 context on how much time is spent percentage wise in each stage.  
 Additionally can be used with littles law in future if ever want to try to 
 tune the size of the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


cassandra git commit: Fix IRE with ORDER BY, treating all selections as fns

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 37d33b208 - 1945384fd


Fix IRE with ORDER BY, treating all selections as fns

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8286


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

Branch: refs/heads/cassandra-2.0
Commit: 1945384fdf1d0bac18d6f75e5f864f1aca5b49db
Parents: 37d33b2
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:06:03 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:06:03 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../cassandra/cql3/statements/RawSelector.java  |   5 +
 .../cql3/statements/SelectStatement.java|   9 +-
 .../cassandra/cql3/statements/Selectable.java   |  15 +
 .../cassandra/cql3/statements/Selection.java|  72 +--
 .../cassandra/cql3/SelectionOrderingTest.java   | 452 +++
 8 files changed, 520 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 809a102..fff6d3a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.12:
+ * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)
  * Include keyspace name in error message when there are insufficient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java 
b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
index f284436..2f3e481 100644
--- a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
@@ -109,6 +109,11 @@ public class ColumnIdentifier implements Selectable
 return new ColumnIdentifier(cfm.comparator.fromString(rawText), 
text);
 }
 
+public boolean processesSelection()
+{
+return false;
+}
+
 @Override
 public final int hashCode()
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index c098c92..61f65c1 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -684,7 +684,7 @@ public abstract class ModificationStatement implements 
CQLStatement, MeasurableF
 }
 for (ColumnIdentifier id : columnsWithConditions)
 names.add(cfDef.get(id));
-selection = Selection.forColumns(names);
+selection = Selection.forColumns(new ArrayList(names));
 }
 
 long now = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java 
b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
index 0194239..c2d4e20 100644
--- a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
+++ b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
@@ -30,4 +30,9 @@ public class RawSelector
 this.selectable = selectable;
 this.alias = alias;
 }
+
+public boolean processesSelection()
+{
+return selectable.processesSelection();
+}
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 77d94e3..f1d1aab 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1957,10 

[1/2] cassandra git commit: Fix IRE with ORDER BY, treating all selections as fns

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 1b21aef81 - 289314a60


Fix IRE with ORDER BY, treating all selections as fns

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8286


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

Branch: refs/heads/cassandra-2.1
Commit: 1945384fdf1d0bac18d6f75e5f864f1aca5b49db
Parents: 37d33b2
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:06:03 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:06:03 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../cassandra/cql3/statements/RawSelector.java  |   5 +
 .../cql3/statements/SelectStatement.java|   9 +-
 .../cassandra/cql3/statements/Selectable.java   |  15 +
 .../cassandra/cql3/statements/Selection.java|  72 +--
 .../cassandra/cql3/SelectionOrderingTest.java   | 452 +++
 8 files changed, 520 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 809a102..fff6d3a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.12:
+ * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)
  * Include keyspace name in error message when there are insufficient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java 
b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
index f284436..2f3e481 100644
--- a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
@@ -109,6 +109,11 @@ public class ColumnIdentifier implements Selectable
 return new ColumnIdentifier(cfm.comparator.fromString(rawText), 
text);
 }
 
+public boolean processesSelection()
+{
+return false;
+}
+
 @Override
 public final int hashCode()
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index c098c92..61f65c1 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -684,7 +684,7 @@ public abstract class ModificationStatement implements 
CQLStatement, MeasurableF
 }
 for (ColumnIdentifier id : columnsWithConditions)
 names.add(cfDef.get(id));
-selection = Selection.forColumns(names);
+selection = Selection.forColumns(new ArrayList(names));
 }
 
 long now = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java 
b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
index 0194239..c2d4e20 100644
--- a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
+++ b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
@@ -30,4 +30,9 @@ public class RawSelector
 this.selectable = selectable;
 this.alias = alias;
 }
+
+public boolean processesSelection()
+{
+return selectable.processesSelection();
+}
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 77d94e3..f1d1aab 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1957,10 

[2/2] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 289314a60f8a35e047a2073ef1e5ae003ada4250
Parents: 1b21aef 1945384
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:09:23 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:09:23 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../cassandra/cql3/statements/RawSelector.java  |   5 +
 .../cassandra/cql3/statements/Selectable.java   |  20 ++
 .../cassandra/cql3/statements/Selection.java|  78 ---
 .../org/apache/cassandra/cql3/CQLTester.java|   7 +
 .../cassandra/cql3/SelectionOrderingTest.java   | 233 +++
 8 files changed, 313 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/CHANGES.txt
--
diff --cc CHANGES.txt
index 2476d25,fff6d3a..80c6872
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,5 +1,13 @@@
 -2.0.12:
 +2.1.3
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries 
(CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 +Merged from 2.0:
+  * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
   * Disable SSLv3 for POODLE (CASSANDRA-8265)
   * Fix millisecond timestamps in Tracing (CASSANDRA-8297)
   * Include keyspace name in error message when there are insufficient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--
diff --cc src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
index c1dcd87,2f3e481..1501479
--- a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
@@@ -135,12 -103,17 +135,17 @@@ public class ColumnIdentifier implement
  ByteBuffer bufferName = ByteBufferUtil.bytes(text);
  for (ColumnDefinition def : cfm.partitionKeyColumns())
  {
 -if (def.name.equals(bufferName))
 +if (def.name.bytes.equals(bufferName))
  return new ColumnIdentifier(text, true);
  }
 -return new ColumnIdentifier(cfm.comparator.fromString(rawText), 
text);
 +return new ColumnIdentifier(comparator.fromString(rawText), text);
  }
  
+ public boolean processesSelection()
+ {
+ return false;
+ }
+ 
  @Override
  public final int hashCode()
  {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 846ad3e,61f65c1..c32430a
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@@ -610,12 -679,12 +610,12 @@@ public abstract class ModificationState
  // of batches for compatibility sakes).
  if (isBatch)
  {
 -names.addAll(cfDef.partitionKeys());
 -names.addAll(cfDef.clusteringColumns());
 +defs.addAll(cfm.partitionKeyColumns());
 +defs.addAll(cfm.clusteringColumns());
  }
 -for (ColumnIdentifier id : columnsWithConditions)
 -names.add(cfDef.get(id));
 -selection = Selection.forColumns(new ArrayList(names));
 +for (ColumnDefinition def : columnsWithConditions)
 +defs.add(def);
- selection = Selection.forColumns(defs);
++selection = Selection.forColumns(new ArrayList(defs));
  }
  
  long now = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/statements/Selectable.java

[2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 289314a60f8a35e047a2073ef1e5ae003ada4250
Parents: 1b21aef 1945384
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:09:23 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:09:23 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../cassandra/cql3/statements/RawSelector.java  |   5 +
 .../cassandra/cql3/statements/Selectable.java   |  20 ++
 .../cassandra/cql3/statements/Selection.java|  78 ---
 .../org/apache/cassandra/cql3/CQLTester.java|   7 +
 .../cassandra/cql3/SelectionOrderingTest.java   | 233 +++
 8 files changed, 313 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/CHANGES.txt
--
diff --cc CHANGES.txt
index 2476d25,fff6d3a..80c6872
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,5 +1,13 @@@
 -2.0.12:
 +2.1.3
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries 
(CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 +Merged from 2.0:
+  * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
   * Disable SSLv3 for POODLE (CASSANDRA-8265)
   * Fix millisecond timestamps in Tracing (CASSANDRA-8297)
   * Include keyspace name in error message when there are insufficient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--
diff --cc src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
index c1dcd87,2f3e481..1501479
--- a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
@@@ -135,12 -103,17 +135,17 @@@ public class ColumnIdentifier implement
  ByteBuffer bufferName = ByteBufferUtil.bytes(text);
  for (ColumnDefinition def : cfm.partitionKeyColumns())
  {
 -if (def.name.equals(bufferName))
 +if (def.name.bytes.equals(bufferName))
  return new ColumnIdentifier(text, true);
  }
 -return new ColumnIdentifier(cfm.comparator.fromString(rawText), 
text);
 +return new ColumnIdentifier(comparator.fromString(rawText), text);
  }
  
+ public boolean processesSelection()
+ {
+ return false;
+ }
+ 
  @Override
  public final int hashCode()
  {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --cc 
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index 846ad3e,61f65c1..c32430a
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@@ -610,12 -679,12 +610,12 @@@ public abstract class ModificationState
  // of batches for compatibility sakes).
  if (isBatch)
  {
 -names.addAll(cfDef.partitionKeys());
 -names.addAll(cfDef.clusteringColumns());
 +defs.addAll(cfm.partitionKeyColumns());
 +defs.addAll(cfm.clusteringColumns());
  }
 -for (ColumnIdentifier id : columnsWithConditions)
 -names.add(cfDef.get(id));
 -selection = Selection.forColumns(new ArrayList(names));
 +for (ColumnDefinition def : columnsWithConditions)
 +defs.add(def);
- selection = Selection.forColumns(defs);
++selection = Selection.forColumns(new ArrayList(defs));
  }
  
  long now = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/289314a6/src/java/org/apache/cassandra/cql3/statements/Selectable.java

[3/3] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: b8cf17284e55eb98fea61be672a0bcadb3613754
Parents: 3cc9a0c 289314a
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:11:37 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:11:37 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cassandra/cql3/selection/RawSelector.java   |   5 +
 .../cassandra/cql3/selection/Selectable.java|  20 ++
 .../cassandra/cql3/selection/Selection.java |  24 +-
 .../cql3/selection/SelectorFactories.java   |  10 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../org/apache/cassandra/cql3/CQLTester.java|   7 +
 .../cassandra/cql3/SelectionOrderingTest.java   | 233 +++
 9 files changed, 298 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8cf1728/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8cf1728/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8cf1728/src/java/org/apache/cassandra/cql3/selection/RawSelector.java
--
diff --cc src/java/org/apache/cassandra/cql3/selection/RawSelector.java
index c7e2658,000..7d5543f
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/cql3/selection/RawSelector.java
+++ b/src/java/org/apache/cassandra/cql3/selection/RawSelector.java
@@@ -1,56 -1,0 +1,61 @@@
 +/*
 + * 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.selection;
 +
 +import java.util.List;
 +
 +import org.apache.cassandra.config.CFMetaData;
 +import org.apache.cassandra.cql3.ColumnIdentifier;
 +
 +import com.google.common.base.Function;
 +import com.google.common.collect.Lists;
 +
 +public class RawSelector
 +{
 +public final Selectable.Raw selectable;
 +public final ColumnIdentifier alias;
 +
 +public RawSelector(Selectable.Raw selectable, ColumnIdentifier alias)
 +{
 +this.selectable = selectable;
 +this.alias = alias;
 +}
 +
 +/**
 + * Converts the specified list of codeRawSelector/codes into a list 
of codeSelectable/codes.
 + *
 + * @param raws the codeRawSelector/codes to converts.
 + * @return a list of codeSelectable/codes
 + */
 +public static ListSelectable toSelectables(ListRawSelector raws, 
final CFMetaData cfm)
 +{
 +return Lists.transform(raws, new FunctionRawSelector, Selectable()
 +{
 +public Selectable apply(RawSelector raw)
 +{
 +return raw.selectable.prepare(cfm);
 +}
 +});
 +}
++
++public boolean processesSelection()
++{
++return selectable.processesSelection();
++}
 +}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8cf1728/src/java/org/apache/cassandra/cql3/selection/Selectable.java
--
diff --cc src/java/org/apache/cassandra/cql3/selection/Selectable.java
index 48ce11a,000..c5ef857
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/cql3/selection/Selectable.java
+++ b/src/java/org/apache/cassandra/cql3/selection/Selectable.java
@@@ -1,226 -1,0 +1,246 @@@
 +/*
 + * 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 

[1/3] cassandra git commit: Fix IRE with ORDER BY, treating all selections as fns

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 3cc9a0c87 - b8cf17284


Fix IRE with ORDER BY, treating all selections as fns

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8286


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

Branch: refs/heads/trunk
Commit: 1945384fdf1d0bac18d6f75e5f864f1aca5b49db
Parents: 37d33b2
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:06:03 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:06:03 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/cql3/ColumnIdentifier.java |   5 +
 .../cql3/statements/ModificationStatement.java  |   2 +-
 .../cassandra/cql3/statements/RawSelector.java  |   5 +
 .../cql3/statements/SelectStatement.java|   9 +-
 .../cassandra/cql3/statements/Selectable.java   |  15 +
 .../cassandra/cql3/statements/Selection.java|  72 +--
 .../cassandra/cql3/SelectionOrderingTest.java   | 452 +++
 8 files changed, 520 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 809a102..fff6d3a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.12:
+ * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)
  * Include keyspace name in error message when there are insufficient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java 
b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
index f284436..2f3e481 100644
--- a/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnIdentifier.java
@@ -109,6 +109,11 @@ public class ColumnIdentifier implements Selectable
 return new ColumnIdentifier(cfm.comparator.fromString(rawText), 
text);
 }
 
+public boolean processesSelection()
+{
+return false;
+}
+
 @Override
 public final int hashCode()
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
index c098c92..61f65c1 100644
--- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
@@ -684,7 +684,7 @@ public abstract class ModificationStatement implements 
CQLStatement, MeasurableF
 }
 for (ColumnIdentifier id : columnsWithConditions)
 names.add(cfDef.get(id));
-selection = Selection.forColumns(names);
+selection = Selection.forColumns(new ArrayList(names));
 }
 
 long now = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java 
b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
index 0194239..c2d4e20 100644
--- a/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
+++ b/src/java/org/apache/cassandra/cql3/statements/RawSelector.java
@@ -30,4 +30,9 @@ public class RawSelector
 this.selectable = selectable;
 this.alias = alias;
 }
+
+public boolean processesSelection()
+{
+return selectable.processesSelection();
+}
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1945384f/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 77d94e3..f1d1aab 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1957,10 +1957,11 @@ 

[2/2] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Fix multicolumn relation + COMPACT STORAGE issues

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8264


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

Branch: refs/heads/cassandra-2.0
Commit: 084d93daf6b6031909fc318e57a2a205ad32c237
Parents: 1945384
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:25:09 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:25:09 2014 -0600

--
 CHANGES.txt |2 +
 .../cql3/statements/SelectStatement.java|   95 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 1464 +-
 3 files changed, 840 insertions(+), 721 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index fff6d3a..01ea887 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Fix some failing queries that use multi-column relations
+   on COMPACT STORAGE tables (CASSANDRA-8264)
  * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index f1d1aab..db25716 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -713,9 +713,9 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 CFDefinition.Name name = idIter.next();
 assert r != null  !r.isSlice();
 
-ListByteBuffer values = r.values(variables);
-if (values.size() == 1)
+if (r.isEQ())
 {
+ListByteBuffer values = r.values(variables);
 ByteBuffer val = values.get(0);
 if (val == null)
 throw new InvalidRequestException(String.format(Invalid 
null value for clustering key part %s, name.name));
@@ -723,26 +723,56 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 }
 else
 {
-// We have a IN, which we only support for the last column.
-// If compact, just add all values and we're done. Otherwise,
-// for each value of the IN, creates all the columns 
corresponding to the selection.
-if (values.isEmpty())
-return null;
-SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
-IteratorByteBuffer iter = values.iterator();
-while (iter.hasNext())
+if (!r.isMultiColumn())
 {
-ByteBuffer val = iter.next();
-ColumnNameBuilder b = iter.hasNext() ? builder.copy() : 
builder;
-if (val == null)
-throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
-b.add(val);
-if (cfDef.isCompact)
-columns.add(b.build());
-else
-columns.addAll(addSelectedColumns(b));
+// We have a IN, which we only support for the last column.
+// If compact, just add all values and we're done. 
Otherwise,
+// for each value of the IN, creates all the columns 
corresponding to the selection.
+ListByteBuffer values = r.values(variables);
+if (values.isEmpty())
+return null;
+SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
+IteratorByteBuffer iter = values.iterator();
+while (iter.hasNext())
+{
+ByteBuffer val = iter.next();
+ColumnNameBuilder b = iter.hasNext() ? builder.copy() 
: builder;
+if (val == null)
+throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
+  

[2/4] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Fix multicolumn relation + COMPACT STORAGE issues

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8264


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

Branch: refs/heads/cassandra-2.1
Commit: 084d93daf6b6031909fc318e57a2a205ad32c237
Parents: 1945384
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:25:09 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:25:09 2014 -0600

--
 CHANGES.txt |2 +
 .../cql3/statements/SelectStatement.java|   95 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 1464 +-
 3 files changed, 840 insertions(+), 721 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index fff6d3a..01ea887 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Fix some failing queries that use multi-column relations
+   on COMPACT STORAGE tables (CASSANDRA-8264)
  * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index f1d1aab..db25716 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -713,9 +713,9 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 CFDefinition.Name name = idIter.next();
 assert r != null  !r.isSlice();
 
-ListByteBuffer values = r.values(variables);
-if (values.size() == 1)
+if (r.isEQ())
 {
+ListByteBuffer values = r.values(variables);
 ByteBuffer val = values.get(0);
 if (val == null)
 throw new InvalidRequestException(String.format(Invalid 
null value for clustering key part %s, name.name));
@@ -723,26 +723,56 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 }
 else
 {
-// We have a IN, which we only support for the last column.
-// If compact, just add all values and we're done. Otherwise,
-// for each value of the IN, creates all the columns 
corresponding to the selection.
-if (values.isEmpty())
-return null;
-SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
-IteratorByteBuffer iter = values.iterator();
-while (iter.hasNext())
+if (!r.isMultiColumn())
 {
-ByteBuffer val = iter.next();
-ColumnNameBuilder b = iter.hasNext() ? builder.copy() : 
builder;
-if (val == null)
-throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
-b.add(val);
-if (cfDef.isCompact)
-columns.add(b.build());
-else
-columns.addAll(addSelectedColumns(b));
+// We have a IN, which we only support for the last column.
+// If compact, just add all values and we're done. 
Otherwise,
+// for each value of the IN, creates all the columns 
corresponding to the selection.
+ListByteBuffer values = r.values(variables);
+if (values.isEmpty())
+return null;
+SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
+IteratorByteBuffer iter = values.iterator();
+while (iter.hasNext())
+{
+ByteBuffer val = iter.next();
+ColumnNameBuilder b = iter.hasNext() ? builder.copy() 
: builder;
+if (val == null)
+throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
+  

[4/4] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 25a4c9e1f7388b35d7c51bdb36766618026cb0c7
Parents: 289314a 084d93d
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:28:51 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:28:51 2014 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java|  15 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 938 ++-
 3 files changed, 494 insertions(+), 461 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/CHANGES.txt
--
diff --cc CHANGES.txt
index 80c6872,01ea887..8dbcbc8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,6 +1,14 @@@
 -2.0.12:
 +2.1.3
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries 
(CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 +Merged from 2.0:
+  * Fix some failing queries that use multi-column relations
+on COMPACT STORAGE tables (CASSANDRA-8264)
   * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
   * Disable SSLv3 for POODLE (CASSANDRA-8265)
   * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 09d1e52,db25716..688d1d5
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -1120,45 -1077,15 +1120,56 @@@ public class SelectStatement implement
  return expressions;
  }
  
 -private void validateIndexExpressionValue(ByteBuffer value, 
CFDefinition.Name name) throws InvalidRequestException
 +private static ByteBuffer validateIndexedValue(ColumnDefinition def, 
ByteBuffer value) throws InvalidRequestException
  {
  if (value == null)
 -throw new InvalidRequestException(String.format(Unsupported null 
value for indexed column %s, name));
 +throw new InvalidRequestException(String.format(Unsupported null 
value for indexed column %s, def.name));
  if (value.remaining()  0x)
  throw new InvalidRequestException(Index expression values may 
not be larger than 64K);
 +return value;
  }
  
 -private static IndexOperator reverse(IndexOperator op)
++private CellName makeExclusiveSliceBound(Bound bound, CellNameType type, 
QueryOptions options) throws InvalidRequestException
++{
++if (sliceRestriction.isInclusive(bound))
++return null;
++
++if (sliceRestriction.isMultiColumn())
++return type.makeCellName(((MultiColumnRestriction.Slice) 
sliceRestriction).componentBounds(bound, options).toArray());
++else
++return type.makeCellName(sliceRestriction.bound(bound, options));
++}
++
 +private IteratorCell applySliceRestriction(final IteratorCell cells, 
final QueryOptions options) throws InvalidRequestException
 +{
 +assert sliceRestriction != null;
 +
 +final CellNameType type = cfm.comparator;
- final CellName excludedStart = 
sliceRestriction.isInclusive(Bound.START) ? null : 
type.makeCellName(sliceRestriction.bound(Bound.START, options));
- final CellName excludedEnd = sliceRestriction.isInclusive(Bound.END) 
? null : type.makeCellName(sliceRestriction.bound(Bound.END, options));
++final CellName excludedStart = makeExclusiveSliceBound(Bound.START, 
type, options);
++final CellName excludedEnd = makeExclusiveSliceBound(Bound.END, type, 
options);
 +
 +return new AbstractIteratorCell()
 +{
 +protected Cell computeNext()
 +{
 +while (cells.hasNext())
 +{
 +Cell c = cells.next();
 +
 +// For dynamic CF, the column could be out of the 
requested bounds (because we don't support strict bounds internally 

[1/2] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 1945384fd - 084d93daf


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java 
b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 498d332..ea4f1a6 100644
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@ -57,11 +57,25 @@ public class MultiColumnRelationTest
 {
 SchemaLoader.loadSchema();
 executeSchemaChange(CREATE KEYSPACE IF NOT EXISTS %s WITH replication 
= {'class': 'SimpleStrategy', 'replication_factor': '1'});
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_partition (a 
int PRIMARY KEY, b int));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.compound_partition 
(a int, b int, c int, PRIMARY KEY ((a, b;
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_clustering 
(a int, b int, c int, PRIMARY KEY (a, b)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.multiple_clustering 
(a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed (a int, b int, c int, d int, PRIMARY KEY (a, b, 
c, d)) WITH CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+for (boolean isCompact : new boolean[]{false, true})
+{
+String tableSuffix = isCompact ? _compact : ;
+String compactOption = isCompact ?  WITH COMPACT STORAGE : ;
+
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_partition + 
tableSuffix + (a int PRIMARY KEY, b int) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.compound_partition 
+tableSuffix + (a int, b int, c int, PRIMARY KEY ((a, b))) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_clustering + 
tableSuffix + (a int, b int, c int, PRIMARY KEY (a, b)) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.multiple_clustering + 
tableSuffix + (a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)) + 
compactOption);
+
+compactOption = isCompact ?  COMPACT STORAGE AND  : ;
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed + tableSuffix +
+(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH  + compactOption +  CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+}
 clientState = ClientState.forInternalCalls();
 }
 
@@ -207,40 +221,46 @@ public class MultiColumnRelationTest
 @Test
 public void testSingleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 0, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 1, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 2, 0));
-UntypedResultSet results = execute(SELECT * FROM %s.single_clustering 
WHERE a=0 AND (b) = (1));
-assertEquals(1, results.size());
-checkRow(0, results, 0, 1, 0);
-
-results = execute(SELECT * FROM %s.single_clustering WHERE a=0 AND 
(b) = (3));
-assertEquals(0, results.size());
+for (String tableSuffix : new String[]{, _compact})
+{
+execute(INSERT INTO %s.single_clustering + tableSuffix + (a, b, 
c) VALUES (0, 0, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 1, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 2, 0));
+UntypedResultSet results = execute(SELECT * FROM 
%s.single_clustering + tableSuffix +  WHERE a=0 AND (b) = (1));
+assertEquals(1, results.size());
+checkRow(0, results, 0, 1, 0);
+
+results = execute(SELECT * FROM %s.single_clustering + 
tableSuffix +  WHERE a=0 AND (b) = (3));
+assertEquals(0, results.size());
+}
 }
 
 @Test
 public void testMultipleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 0, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 1));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 2, 
0, 0));
-UntypedResultSet results = execute(SELECT * FROM 
%s.multiple_clustering WHERE a=0 AND (b) = 

[3/4] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --cc test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index bcf4f27,ea4f1a6..4c3ba2a
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@@ -17,522 -17,1234 +17,542 @@@
   */
  package org.apache.cassandra.cql3;
  
 -import org.apache.cassandra.SchemaLoader;
 -import org.apache.cassandra.db.ConsistencyLevel;
 -import org.apache.cassandra.db.marshal.*;
 -import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.exceptions.RequestExecutionException;
 -import org.apache.cassandra.exceptions.RequestValidationException;
 -import org.apache.cassandra.exceptions.SyntaxException;
 -import org.apache.cassandra.gms.Gossiper;
 -import org.apache.cassandra.service.ClientState;
 -import org.apache.cassandra.service.QueryState;
 -import org.apache.cassandra.transport.messages.ResultMessage;
 -import org.apache.cassandra.utils.ByteBufferUtil;
 -import org.apache.cassandra.utils.MD5Digest;
 -import org.junit.AfterClass;
 -import org.junit.BeforeClass;
  import org.junit.Test;
 -import org.slf4j.Logger;
 -import org.slf4j.LoggerFactory;
  
 -import java.nio.ByteBuffer;
 -import java.util.*;
 -
 -import static org.apache.cassandra.cql3.QueryProcessor.process;
 -import static org.apache.cassandra.cql3.QueryProcessor.processInternal;
 -import static org.junit.Assert.assertTrue;
 -import static org.junit.Assert.assertEquals;
 -import static com.google.common.collect.Lists.newArrayList;
 -import static org.junit.Assert.fail;
 -
 -public class MultiColumnRelationTest
 +public class MultiColumnRelationTest extends CQLTester
  {
 -private static final Logger logger = 
LoggerFactory.getLogger(MultiColumnRelationTest.class);
 -static ClientState clientState;
 -static String keyspace = multi_column_relation_test;
 -
 -@BeforeClass
 -public static void setUpClass() throws Throwable
 -{
 -SchemaLoader.loadSchema();
 -executeSchemaChange(CREATE KEYSPACE IF NOT EXISTS %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': '1'});
 -for (boolean isCompact : new boolean[]{false, true})
 -{
 -String tableSuffix = isCompact ? _compact : ;
 -String compactOption = isCompact ?  WITH COMPACT STORAGE : ;
 -
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.single_partition + 
tableSuffix + (a int PRIMARY KEY, b int) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.compound_partition 
+tableSuffix + (a int, b int, c int, PRIMARY KEY ((a, b))) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.single_clustering + 
tableSuffix + (a int, b int, c int, PRIMARY KEY (a, b)) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.multiple_clustering + 
tableSuffix + (a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)) + 
compactOption);
 -
 -compactOption = isCompact ?  COMPACT STORAGE AND  : ;
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed + tableSuffix +
 -(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH  + compactOption +  CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
 -}
 -clientState = ClientState.forInternalCalls();
 -}
 -
 -@AfterClass
 -public static void stopGossiper()
 -{
 -Gossiper.instance.stop();
 -}
 -
 -private static void executeSchemaChange(String query) throws Throwable
 -{
 -try
 -{
 -process(String.format(query, keyspace), ConsistencyLevel.ONE);
 -} catch (RuntimeException exc)
 -{
 -throw exc.getCause();
 -}
 -}
 -
 -private static UntypedResultSet execute(String query) throws Throwable
 -{
 -try
 -{
 -return processInternal(String.format(query, keyspace));
 -} catch (RuntimeException exc)
 -{
 -if (exc.getCause() != null)
 -throw exc.getCause();
 -throw exc;
 -}
 -}
 -
 -private MD5Digest prepare(String query) throws RequestValidationException
 -{
 -ResultMessage.Prepared prepared = 
QueryProcessor.prepare(String.format(query, keyspace), clientState, false);
 -return prepared.statementId;
 -}
 -
 -private UntypedResultSet executePrepared(MD5Digest statementId, 
QueryOptions options) throws RequestValidationException, 
RequestExecutionException
 -{
 -CQLStatement statement = 

[1/4] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 289314a60 - 25a4c9e1f


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java 
b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 498d332..ea4f1a6 100644
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@ -57,11 +57,25 @@ public class MultiColumnRelationTest
 {
 SchemaLoader.loadSchema();
 executeSchemaChange(CREATE KEYSPACE IF NOT EXISTS %s WITH replication 
= {'class': 'SimpleStrategy', 'replication_factor': '1'});
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_partition (a 
int PRIMARY KEY, b int));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.compound_partition 
(a int, b int, c int, PRIMARY KEY ((a, b;
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_clustering 
(a int, b int, c int, PRIMARY KEY (a, b)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.multiple_clustering 
(a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed (a int, b int, c int, d int, PRIMARY KEY (a, b, 
c, d)) WITH CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+for (boolean isCompact : new boolean[]{false, true})
+{
+String tableSuffix = isCompact ? _compact : ;
+String compactOption = isCompact ?  WITH COMPACT STORAGE : ;
+
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_partition + 
tableSuffix + (a int PRIMARY KEY, b int) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.compound_partition 
+tableSuffix + (a int, b int, c int, PRIMARY KEY ((a, b))) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_clustering + 
tableSuffix + (a int, b int, c int, PRIMARY KEY (a, b)) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.multiple_clustering + 
tableSuffix + (a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)) + 
compactOption);
+
+compactOption = isCompact ?  COMPACT STORAGE AND  : ;
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed + tableSuffix +
+(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH  + compactOption +  CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+}
 clientState = ClientState.forInternalCalls();
 }
 
@@ -207,40 +221,46 @@ public class MultiColumnRelationTest
 @Test
 public void testSingleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 0, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 1, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 2, 0));
-UntypedResultSet results = execute(SELECT * FROM %s.single_clustering 
WHERE a=0 AND (b) = (1));
-assertEquals(1, results.size());
-checkRow(0, results, 0, 1, 0);
-
-results = execute(SELECT * FROM %s.single_clustering WHERE a=0 AND 
(b) = (3));
-assertEquals(0, results.size());
+for (String tableSuffix : new String[]{, _compact})
+{
+execute(INSERT INTO %s.single_clustering + tableSuffix + (a, b, 
c) VALUES (0, 0, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 1, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 2, 0));
+UntypedResultSet results = execute(SELECT * FROM 
%s.single_clustering + tableSuffix +  WHERE a=0 AND (b) = (1));
+assertEquals(1, results.size());
+checkRow(0, results, 0, 1, 0);
+
+results = execute(SELECT * FROM %s.single_clustering + 
tableSuffix +  WHERE a=0 AND (b) = (3));
+assertEquals(0, results.size());
+}
 }
 
 @Test
 public void testMultipleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 0, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 1));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 2, 
0, 0));
-UntypedResultSet results = execute(SELECT * FROM 
%s.multiple_clustering WHERE a=0 AND (b) = 

[1/5] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk b8cf17284 - 907591851


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java 
b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index 498d332..ea4f1a6 100644
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@ -57,11 +57,25 @@ public class MultiColumnRelationTest
 {
 SchemaLoader.loadSchema();
 executeSchemaChange(CREATE KEYSPACE IF NOT EXISTS %s WITH replication 
= {'class': 'SimpleStrategy', 'replication_factor': '1'});
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_partition (a 
int PRIMARY KEY, b int));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.compound_partition 
(a int, b int, c int, PRIMARY KEY ((a, b;
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.single_clustering 
(a int, b int, c int, PRIMARY KEY (a, b)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS %s.multiple_clustering 
(a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)));
-executeSchemaChange(CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed (a int, b int, c int, d int, PRIMARY KEY (a, b, 
c, d)) WITH CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+for (boolean isCompact : new boolean[]{false, true})
+{
+String tableSuffix = isCompact ? _compact : ;
+String compactOption = isCompact ?  WITH COMPACT STORAGE : ;
+
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_partition + 
tableSuffix + (a int PRIMARY KEY, b int) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.compound_partition 
+tableSuffix + (a int, b int, c int, PRIMARY KEY ((a, b))) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.single_clustering + 
tableSuffix + (a int, b int, c int, PRIMARY KEY (a, b)) + compactOption);
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS %s.multiple_clustering + 
tableSuffix + (a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)) + 
compactOption);
+
+compactOption = isCompact ?  COMPACT STORAGE AND  : ;
+executeSchemaChange(
+CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed + tableSuffix +
+(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH  + compactOption +  CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
+}
 clientState = ClientState.forInternalCalls();
 }
 
@@ -207,40 +221,46 @@ public class MultiColumnRelationTest
 @Test
 public void testSingleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 0, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 1, 0));
-execute(INSERT INTO %s.single_clustering (a, b, c) VALUES (0, 2, 0));
-UntypedResultSet results = execute(SELECT * FROM %s.single_clustering 
WHERE a=0 AND (b) = (1));
-assertEquals(1, results.size());
-checkRow(0, results, 0, 1, 0);
-
-results = execute(SELECT * FROM %s.single_clustering WHERE a=0 AND 
(b) = (3));
-assertEquals(0, results.size());
+for (String tableSuffix : new String[]{, _compact})
+{
+execute(INSERT INTO %s.single_clustering + tableSuffix + (a, b, 
c) VALUES (0, 0, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 1, 0));
+execute(INSERT INTO %s.single_clustering + tableSuffix +  (a, 
b, c) VALUES (0, 2, 0));
+UntypedResultSet results = execute(SELECT * FROM 
%s.single_clustering + tableSuffix +  WHERE a=0 AND (b) = (1));
+assertEquals(1, results.size());
+checkRow(0, results, 0, 1, 0);
+
+results = execute(SELECT * FROM %s.single_clustering + 
tableSuffix +  WHERE a=0 AND (b) = (3));
+assertEquals(0, results.size());
+}
 }
 
 @Test
 public void testMultipleClusteringColumnEquality() throws Throwable
 {
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 0, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
0, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 0));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 1, 
1, 1));
-execute(INSERT INTO %s.multiple_clustering (a, b, c, d) VALUES (0, 2, 
0, 0));
-UntypedResultSet results = execute(SELECT * FROM 
%s.multiple_clustering WHERE a=0 AND (b) = (1));
-  

[2/5] cassandra git commit: Fix multicolumn relation + COMPACT STORAGE issues

2014-11-19 Thread tylerhobbs
Fix multicolumn relation + COMPACT STORAGE issues

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8264


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

Branch: refs/heads/trunk
Commit: 084d93daf6b6031909fc318e57a2a205ad32c237
Parents: 1945384
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:25:09 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:25:09 2014 -0600

--
 CHANGES.txt |2 +
 .../cql3/statements/SelectStatement.java|   95 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 1464 +-
 3 files changed, 840 insertions(+), 721 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index fff6d3a..01ea887 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Fix some failing queries that use multi-column relations
+   on COMPACT STORAGE tables (CASSANDRA-8264)
  * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
  * Disable SSLv3 for POODLE (CASSANDRA-8265)
  * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/084d93da/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index f1d1aab..db25716 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -713,9 +713,9 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 CFDefinition.Name name = idIter.next();
 assert r != null  !r.isSlice();
 
-ListByteBuffer values = r.values(variables);
-if (values.size() == 1)
+if (r.isEQ())
 {
+ListByteBuffer values = r.values(variables);
 ByteBuffer val = values.get(0);
 if (val == null)
 throw new InvalidRequestException(String.format(Invalid 
null value for clustering key part %s, name.name));
@@ -723,26 +723,56 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 }
 else
 {
-// We have a IN, which we only support for the last column.
-// If compact, just add all values and we're done. Otherwise,
-// for each value of the IN, creates all the columns 
corresponding to the selection.
-if (values.isEmpty())
-return null;
-SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
-IteratorByteBuffer iter = values.iterator();
-while (iter.hasNext())
+if (!r.isMultiColumn())
 {
-ByteBuffer val = iter.next();
-ColumnNameBuilder b = iter.hasNext() ? builder.copy() : 
builder;
-if (val == null)
-throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
-b.add(val);
-if (cfDef.isCompact)
-columns.add(b.build());
-else
-columns.addAll(addSelectedColumns(b));
+// We have a IN, which we only support for the last column.
+// If compact, just add all values and we're done. 
Otherwise,
+// for each value of the IN, creates all the columns 
corresponding to the selection.
+ListByteBuffer values = r.values(variables);
+if (values.isEmpty())
+return null;
+SortedSetByteBuffer columns = new 
TreeSetByteBuffer(cfDef.cfm.comparator);
+IteratorByteBuffer iter = values.iterator();
+while (iter.hasNext())
+{
+ByteBuffer val = iter.next();
+ColumnNameBuilder b = iter.hasNext() ? builder.copy() 
: builder;
+if (val == null)
+throw new 
InvalidRequestException(String.format(Invalid null value for clustering key 
part %s, name.name));
+  

[5/5] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 90759185114d72d1b71409672ee406cb967427a8
Parents: b8cf172 25a4c9e
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:28:58 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:28:58 2014 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java|  15 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 938 ++-
 3 files changed, 494 insertions(+), 461 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90759185/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/90759185/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--



[4/5] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 25a4c9e1f7388b35d7c51bdb36766618026cb0c7
Parents: 289314a 084d93d
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:28:51 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:28:51 2014 -0600

--
 CHANGES.txt |   2 +
 .../cql3/statements/SelectStatement.java|  15 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 938 ++-
 3 files changed, 494 insertions(+), 461 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/CHANGES.txt
--
diff --cc CHANGES.txt
index 80c6872,01ea887..8dbcbc8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,6 +1,14 @@@
 -2.0.12:
 +2.1.3
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries 
(CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 +Merged from 2.0:
+  * Fix some failing queries that use multi-column relations
+on COMPACT STORAGE tables (CASSANDRA-8264)
   * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
   * Disable SSLv3 for POODLE (CASSANDRA-8265)
   * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 09d1e52,db25716..688d1d5
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -1120,45 -1077,15 +1120,56 @@@ public class SelectStatement implement
  return expressions;
  }
  
 -private void validateIndexExpressionValue(ByteBuffer value, 
CFDefinition.Name name) throws InvalidRequestException
 +private static ByteBuffer validateIndexedValue(ColumnDefinition def, 
ByteBuffer value) throws InvalidRequestException
  {
  if (value == null)
 -throw new InvalidRequestException(String.format(Unsupported null 
value for indexed column %s, name));
 +throw new InvalidRequestException(String.format(Unsupported null 
value for indexed column %s, def.name));
  if (value.remaining()  0x)
  throw new InvalidRequestException(Index expression values may 
not be larger than 64K);
 +return value;
  }
  
 -private static IndexOperator reverse(IndexOperator op)
++private CellName makeExclusiveSliceBound(Bound bound, CellNameType type, 
QueryOptions options) throws InvalidRequestException
++{
++if (sliceRestriction.isInclusive(bound))
++return null;
++
++if (sliceRestriction.isMultiColumn())
++return type.makeCellName(((MultiColumnRestriction.Slice) 
sliceRestriction).componentBounds(bound, options).toArray());
++else
++return type.makeCellName(sliceRestriction.bound(bound, options));
++}
++
 +private IteratorCell applySliceRestriction(final IteratorCell cells, 
final QueryOptions options) throws InvalidRequestException
 +{
 +assert sliceRestriction != null;
 +
 +final CellNameType type = cfm.comparator;
- final CellName excludedStart = 
sliceRestriction.isInclusive(Bound.START) ? null : 
type.makeCellName(sliceRestriction.bound(Bound.START, options));
- final CellName excludedEnd = sliceRestriction.isInclusive(Bound.END) 
? null : type.makeCellName(sliceRestriction.bound(Bound.END, options));
++final CellName excludedStart = makeExclusiveSliceBound(Bound.START, 
type, options);
++final CellName excludedEnd = makeExclusiveSliceBound(Bound.END, type, 
options);
 +
 +return new AbstractIteratorCell()
 +{
 +protected Cell computeNext()
 +{
 +while (cells.hasNext())
 +{
 +Cell c = cells.next();
 +
 +// For dynamic CF, the column could be out of the 
requested bounds (because we don't support strict bounds internally (unless
 

[3/5] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

2014-11-19 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
--
diff --cc test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
index bcf4f27,ea4f1a6..4c3ba2a
--- a/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/MultiColumnRelationTest.java
@@@ -17,522 -17,1234 +17,542 @@@
   */
  package org.apache.cassandra.cql3;
  
 -import org.apache.cassandra.SchemaLoader;
 -import org.apache.cassandra.db.ConsistencyLevel;
 -import org.apache.cassandra.db.marshal.*;
 -import org.apache.cassandra.exceptions.InvalidRequestException;
 -import org.apache.cassandra.exceptions.RequestExecutionException;
 -import org.apache.cassandra.exceptions.RequestValidationException;
 -import org.apache.cassandra.exceptions.SyntaxException;
 -import org.apache.cassandra.gms.Gossiper;
 -import org.apache.cassandra.service.ClientState;
 -import org.apache.cassandra.service.QueryState;
 -import org.apache.cassandra.transport.messages.ResultMessage;
 -import org.apache.cassandra.utils.ByteBufferUtil;
 -import org.apache.cassandra.utils.MD5Digest;
 -import org.junit.AfterClass;
 -import org.junit.BeforeClass;
  import org.junit.Test;
 -import org.slf4j.Logger;
 -import org.slf4j.LoggerFactory;
  
 -import java.nio.ByteBuffer;
 -import java.util.*;
 -
 -import static org.apache.cassandra.cql3.QueryProcessor.process;
 -import static org.apache.cassandra.cql3.QueryProcessor.processInternal;
 -import static org.junit.Assert.assertTrue;
 -import static org.junit.Assert.assertEquals;
 -import static com.google.common.collect.Lists.newArrayList;
 -import static org.junit.Assert.fail;
 -
 -public class MultiColumnRelationTest
 +public class MultiColumnRelationTest extends CQLTester
  {
 -private static final Logger logger = 
LoggerFactory.getLogger(MultiColumnRelationTest.class);
 -static ClientState clientState;
 -static String keyspace = multi_column_relation_test;
 -
 -@BeforeClass
 -public static void setUpClass() throws Throwable
 -{
 -SchemaLoader.loadSchema();
 -executeSchemaChange(CREATE KEYSPACE IF NOT EXISTS %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': '1'});
 -for (boolean isCompact : new boolean[]{false, true})
 -{
 -String tableSuffix = isCompact ? _compact : ;
 -String compactOption = isCompact ?  WITH COMPACT STORAGE : ;
 -
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.single_partition + 
tableSuffix + (a int PRIMARY KEY, b int) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.compound_partition 
+tableSuffix + (a int, b int, c int, PRIMARY KEY ((a, b))) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.single_clustering + 
tableSuffix + (a int, b int, c int, PRIMARY KEY (a, b)) + compactOption);
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS %s.multiple_clustering + 
tableSuffix + (a int, b int, c int, d int, PRIMARY KEY (a, b, c, d)) + 
compactOption);
 -
 -compactOption = isCompact ?  COMPACT STORAGE AND  : ;
 -executeSchemaChange(
 -CREATE TABLE IF NOT EXISTS 
%s.multiple_clustering_reversed + tableSuffix +
 -(a int, b int, c int, d int, PRIMARY KEY (a, b, c, 
d)) WITH  + compactOption +  CLUSTERING ORDER BY (b DESC, c ASC, d DESC));
 -}
 -clientState = ClientState.forInternalCalls();
 -}
 -
 -@AfterClass
 -public static void stopGossiper()
 -{
 -Gossiper.instance.stop();
 -}
 -
 -private static void executeSchemaChange(String query) throws Throwable
 -{
 -try
 -{
 -process(String.format(query, keyspace), ConsistencyLevel.ONE);
 -} catch (RuntimeException exc)
 -{
 -throw exc.getCause();
 -}
 -}
 -
 -private static UntypedResultSet execute(String query) throws Throwable
 -{
 -try
 -{
 -return processInternal(String.format(query, keyspace));
 -} catch (RuntimeException exc)
 -{
 -if (exc.getCause() != null)
 -throw exc.getCause();
 -throw exc;
 -}
 -}
 -
 -private MD5Digest prepare(String query) throws RequestValidationException
 -{
 -ResultMessage.Prepared prepared = 
QueryProcessor.prepare(String.format(query, keyspace), clientState, false);
 -return prepared.statementId;
 -}
 -
 -private UntypedResultSet executePrepared(MD5Digest statementId, 
QueryOptions options) throws RequestValidationException, 
RequestExecutionException
 -{
 -CQLStatement statement = 

cassandra git commit: Fix CONTAINS (KEY) filtering on frozen collection clustering cols

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 25a4c9e1f - e3862bc3e


Fix CONTAINS (KEY) filtering on frozen collection clustering cols

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8302


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

Branch: refs/heads/cassandra-2.1
Commit: e3862bc3e08115806055fe7239f93433407a3dc6
Parents: 25a4c9e
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:37:26 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:37:26 2014 -0600

--
 CHANGES.txt |  3 ++
 .../cql3/statements/SelectStatement.java|  8 +--
 .../org/apache/cassandra/cql3/CQLTester.java|  7 +++
 .../cassandra/cql3/FrozenCollectionsTest.java   | 56 ++--
 4 files changed, 67 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 8dbcbc8..c00e671 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,7 @@
 2.1.3
+ * Fix filtering for CONTAINS (KEY) relations on frozen collection
+   clustering columns when the query is restricted to a single
+   partition (CASSANDRA-8203)
  * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
  * Add more log info if readMeter is null (CASSANDRA-8238)
  * add check of the system wall clock time at startup (CASSANDRA-8305)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 688d1d5..de3d67c 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1981,12 +1981,12 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 else if (stmt.selectACollection())
 throw new 
InvalidRequestException(String.format(Cannot restrict column \%s\ by IN 
relation as a collection is selected by the query, cdef.name));
 }
-/*
-else if (restriction.isContains()  !hasQueriableIndex)
+else if (restriction.isContains())
 {
-throw new InvalidRequestException(String.format(Cannot 
restrict column \%s\ by a CONTAINS relation without a secondary index, 
cdef.name));
+if (!hasQueriableIndex)
+throw new 
InvalidRequestException(String.format(Cannot restrict column \%s\ by a 
CONTAINS relation without a secondary index, cdef.name));
+stmt.usesSecondaryIndexing = true;
 }
-*/
 
 previous = cdef;
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/test/unit/org/apache/cassandra/cql3/CQLTester.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java 
b/test/unit/org/apache/cassandra/cql3/CQLTester.java
index a110af6..470b701 100644
--- a/test/unit/org/apache/cassandra/cql3/CQLTester.java
+++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java
@@ -248,6 +248,13 @@ public abstract class CQLTester
 }
 }
 
+protected void dropIndex(String query) throws Throwable
+{
+String fullQuery = String.format(query, KEYSPACE);
+logger.info(fullQuery);
+schemaChange(fullQuery);
+}
+
 private static void schemaChange(String query)
 {
 try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java 
b/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
index 203adae..bf7ccfd 100644
--- a/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
+++ b/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
@@ -615,10 +615,10 @@ public class FrozenCollectionsTest extends CQLTester
  SELECT * FROM %s WHERE c CONTAINS KEY ?, 1);
 
 // normal indexes on frozen collections don't support CONTAINS or 
CONTAINS KEY
-assertInvalidMessage(No 

[1/2] cassandra git commit: Fix CONTAINS (KEY) filtering on frozen collection clustering cols

2014-11-19 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 907591851 - 1bd5c64ba


Fix CONTAINS (KEY) filtering on frozen collection clustering cols

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8302


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

Branch: refs/heads/trunk
Commit: e3862bc3e08115806055fe7239f93433407a3dc6
Parents: 25a4c9e
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:37:26 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:37:26 2014 -0600

--
 CHANGES.txt |  3 ++
 .../cql3/statements/SelectStatement.java|  8 +--
 .../org/apache/cassandra/cql3/CQLTester.java|  7 +++
 .../cassandra/cql3/FrozenCollectionsTest.java   | 56 ++--
 4 files changed, 67 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 8dbcbc8..c00e671 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,7 @@
 2.1.3
+ * Fix filtering for CONTAINS (KEY) relations on frozen collection
+   clustering columns when the query is restricted to a single
+   partition (CASSANDRA-8203)
  * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
  * Add more log info if readMeter is null (CASSANDRA-8238)
  * add check of the system wall clock time at startup (CASSANDRA-8305)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 688d1d5..de3d67c 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1981,12 +1981,12 @@ public class SelectStatement implements CQLStatement, 
MeasurableForPreparedCache
 else if (stmt.selectACollection())
 throw new 
InvalidRequestException(String.format(Cannot restrict column \%s\ by IN 
relation as a collection is selected by the query, cdef.name));
 }
-/*
-else if (restriction.isContains()  !hasQueriableIndex)
+else if (restriction.isContains())
 {
-throw new InvalidRequestException(String.format(Cannot 
restrict column \%s\ by a CONTAINS relation without a secondary index, 
cdef.name));
+if (!hasQueriableIndex)
+throw new 
InvalidRequestException(String.format(Cannot restrict column \%s\ by a 
CONTAINS relation without a secondary index, cdef.name));
+stmt.usesSecondaryIndexing = true;
 }
-*/
 
 previous = cdef;
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/test/unit/org/apache/cassandra/cql3/CQLTester.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java 
b/test/unit/org/apache/cassandra/cql3/CQLTester.java
index a110af6..470b701 100644
--- a/test/unit/org/apache/cassandra/cql3/CQLTester.java
+++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java
@@ -248,6 +248,13 @@ public abstract class CQLTester
 }
 }
 
+protected void dropIndex(String query) throws Throwable
+{
+String fullQuery = String.format(query, KEYSPACE);
+logger.info(fullQuery);
+schemaChange(fullQuery);
+}
+
 private static void schemaChange(String query)
 {
 try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e3862bc3/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java 
b/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
index 203adae..bf7ccfd 100644
--- a/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
+++ b/test/unit/org/apache/cassandra/cql3/FrozenCollectionsTest.java
@@ -615,10 +615,10 @@ public class FrozenCollectionsTest extends CQLTester
  SELECT * FROM %s WHERE c CONTAINS KEY ?, 1);
 
 // normal indexes on frozen collections don't support CONTAINS or 
CONTAINS KEY
-assertInvalidMessage(No secondary indexes 

[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2014-11-19 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 1bd5c64ba108ded9c0e7fc3d5f7b8315ece48798
Parents: 9075918 e3862bc
Author: Tyler Hobbs ty...@datastax.com
Authored: Wed Nov 19 11:38:17 2014 -0600
Committer: Tyler Hobbs ty...@datastax.com
Committed: Wed Nov 19 11:38:17 2014 -0600

--
 CHANGES.txt |  3 ++
 .../cql3/statements/SelectStatement.java|  8 +--
 .../org/apache/cassandra/cql3/CQLTester.java|  7 +++
 .../cassandra/cql3/FrozenCollectionsTest.java   | 56 ++--
 4 files changed, 67 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1bd5c64b/CHANGES.txt
--
diff --cc CHANGES.txt
index 749fdd2,c00e671..f41e7c3
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,38 -1,7 +1,41 @@@
 +3.0
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer 
apis (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup 
(CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support pure user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 
7781, 7929,
 +   7924, 7812, 8063, 7813)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * improve concurrency of repair (CASSANDRA-6455, 8208)
 +
  2.1.3
+  * Fix filtering for CONTAINS (KEY) relations on frozen collection
+clustering columns when the query is restricted to a single
+partition (CASSANDRA-8203)
   * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
   * Add more log info if readMeter is null (CASSANDRA-8238)
   * add check of the system wall clock time at startup (CASSANDRA-8305)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1bd5c64b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
--
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index e042578,de3d67c..99c2297
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -1944,15 -1976,17 +1944,15 @@@ public class SelectStatement implement
  }
  else if (restriction.isIN())
  {
 -if (!restriction.isMultiColumn()  i != 
stmt.columnRestrictions.length - 1)
 -throw new 
InvalidRequestException(String.format(Clustering column \%s\ cannot be 
restricted by an IN relation, cdef.name));
 -else if (stmt.selectACollection())
 +if (stmt.selectACollection())
  throw new 
InvalidRequestException(String.format(Cannot restrict column \%s\ by IN 
relation as a collection is selected by the query, cdef.name));
  }
- /*
- else if (restriction.isContains()  !hasQueriableIndex)
+ else if (restriction.isContains())
  {
- throw new 

[jira] [Created] (CASSANDRA-8342) Remove historical guidance for concurrent reader and tunings.

2014-11-19 Thread Matt Stump (JIRA)
Matt Stump created CASSANDRA-8342:
-

 Summary: Remove historical guidance for concurrent reader and 
tunings.
 Key: CASSANDRA-8342
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8342
 Project: Cassandra
  Issue Type: Improvement
Reporter: Matt Stump


The cassandra.yaml and documentation provide guidance on tuning concurrent 
readers or concurrent writers to system resources (cores, spindles). Testing 
performed by both myself and customers demonstrates no benefit for thread pool 
sizes above 64 in size, and for thread pools greater than 128 in size a 
decrease in throughput. This is due to thread scheduling and synchronization 
bottlenecks within Cassandra. 

Additionally, for lower end systems reducing these thread pools provides very 
little benefit because the bottleneck is typically moved to either IO or CPU.

I propose that we set the default value to 64 (current default is 32), and 
remove all guidance/recommendations regarding tuning.

This recommendation may change in 3.0, but that would require further 
experimentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8342) Remove historical guidance for concurrent reader and writer tunings.

2014-11-19 Thread Matt Stump (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Stump updated CASSANDRA-8342:
--
Summary: Remove historical guidance for concurrent reader and writer 
tunings.  (was: Remove historical guidance for concurrent reader and tunings.)

 Remove historical guidance for concurrent reader and writer tunings.
 

 Key: CASSANDRA-8342
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8342
 Project: Cassandra
  Issue Type: Improvement
Reporter: Matt Stump

 The cassandra.yaml and documentation provide guidance on tuning concurrent 
 readers or concurrent writers to system resources (cores, spindles). Testing 
 performed by both myself and customers demonstrates no benefit for thread 
 pool sizes above 64 in size, and for thread pools greater than 128 in size a 
 decrease in throughput. This is due to thread scheduling and synchronization 
 bottlenecks within Cassandra. 
 Additionally, for lower end systems reducing these thread pools provides very 
 little benefit because the bottleneck is typically moved to either IO or CPU.
 I propose that we set the default value to 64 (current default is 32), and 
 remove all guidance/recommendations regarding tuning.
 This recommendation may change in 3.0, but that would require further 
 experimentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8343) Secondary index creation causes moves/bootstraps to fail

2014-11-19 Thread Michael Frisch (JIRA)
Michael Frisch created CASSANDRA-8343:
-

 Summary: Secondary index creation causes moves/bootstraps to fail
 Key: CASSANDRA-8343
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8343
 Project: Cassandra
  Issue Type: Bug
Reporter: Michael Frisch


Node moves/bootstraps are failing if the stream timeout is set to a value in 
which secondary index creation cannot complete.  This happens because at the 
end of the very last stream the StreamInSession.closeIfFinished() function 
calls maybeBuildSecondaryIndexes on every column family.  If the stream time + 
all CF's index creation takes longer than your stream timeout then the socket 
closes from the sender's side, the receiver of the stream tries to write to 
said socket because it's not null, an IOException is thrown but not caught in 
closeIfFinished(), the exception is caught somewhere and not logged, 
AbstractStreamSession.close() is never called, and the CountDownLatch is never 
decremented.  This causes the move/bootstrap to continue forever until the node 
is restarted.

This problem of stream time + secondary index creation time exists on 
decommissioning/unbootstrap as well but since it's on the sending side the 
timeout triggers the onFailure() callback which does decrement the 
CountDownLatch leading to completion.

A cursory glance at the 2.0 code leads me to believe this problem would exist 
there as well.

Temporary workaround: set a really high/infinite stream timeout.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8150) Simplify and enlarge new heap calculation

2014-11-19 Thread Matt Stump (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14185270#comment-14185270
 ] 

Matt Stump edited comment on CASSANDRA-8150 at 11/19/14 6:56 PM:
-

That's not quite true:
https://github.com/apache/cassandra/blob/trunk/conf/cassandra-env.sh#L75-L77

We'll use the min((100 * cores), (1/4 * max_heap))



was (Author: mstump):
That's not quite true:
https://github.com/apache/cassandra/blob/trunk/conf/cassandra-env.sh#L75-L77

We'll use the min((100 * cores), (1/4 * max_heap))

Please reopen.

 Simplify and enlarge new heap calculation
 -

 Key: CASSANDRA-8150
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8150
 Project: Cassandra
  Issue Type: Improvement
  Components: Config
Reporter: Matt Stump
Assignee: Brandon Williams

 It's been found that the old twitter recommendations of 100m per core up to 
 800m is harmful and should no longer be used.
 Instead the formula used should be 1/3 or 1/4 max heap with a max of 2G. 1/3 
 or 1/4 is debatable and I'm open to suggestions. If I were to hazard a guess 
 1/3 is probably better for releases greater than 2.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7386) JBOD threshold to prevent unbalanced disk utilization

2014-11-19 Thread Yuki Morishita (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218311#comment-14218311
 ] 

Yuki Morishita commented on CASSANDRA-7386:
---

LGTM, except in the test code:

{code}
// at least (rule of thumb) 100 iterations
if (i = 100)
break;
// random weighted writeable directory algorithm fails to return all possible 
directories after
// many tries
if (i = 1000)
fail();
{code}

I think you mean to check the second `if` first?

 JBOD threshold to prevent unbalanced disk utilization
 -

 Key: CASSANDRA-7386
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7386
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Chris Lohfink
Assignee: Robert Stupp
Priority: Minor
 Fix For: 2.1.3

 Attachments: 7386-2.0-v3.txt, 7386-2.0-v4.txt, 7386-2.1-v3.txt, 
 7386-2.1-v4.txt, 7386-v1.patch, 7386v2.diff, Mappe1.ods, 
 mean-writevalue-7disks.png, patch_2_1_branch_proto.diff, 
 sstable-count-second-run.png, test1_no_patch.jpg, test1_with_patch.jpg, 
 test2_no_patch.jpg, test2_with_patch.jpg, test3_no_patch.jpg, 
 test3_with_patch.jpg


 Currently the pick the disks are picked first by number of current tasks, 
 then by free space.  This helps with performance but can lead to large 
 differences in utilization in some (unlikely but possible) scenarios.  Ive 
 seen 55% to 10% and heard reports of 90% to 10% on IRC.  With both LCS and 
 STCS (although my suspicion is that STCS makes it worse since harder to be 
 balanced).
 I purpose the algorithm change a little to have some maximum range of 
 utilization where it will pick by free space over load (acknowledging it can 
 be slower).  So if a disk A is 30% full and disk B is 5% full it will never 
 pick A over B until it balances out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8150) Simplify and enlarge new heap calculation

2014-11-19 Thread Matt Stump (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218353#comment-14218353
 ] 

Matt Stump commented on CASSANDRA-8150:
---

I'm going to advocate strongly for 40-50% by default for eden. 

Additionally I'm going to advocate that we change the following:
- Increase ceiling on MAX_HEAP to 20G.
- Increasing the MaxTenuringThreshold to 6 or 8
- Include Instagram CMS enhancements.
- Increase thread/core affinity for GC
- Set XX:ParallelGCThreads and XX:ConcGCThreads to min(20, number of cores).
- Possibly, set XX:MaxGCPauseMillis to 20ms, but I haven't really tested this 
one.

Instagram CMS settings:
JVM_OPTS=$JVM_OPTS -XX:+CMSScavengeBeforeRemark
JVM_OPTS=$JVM_OPTS -XX:CMSMaxAbortablePrecleanTime=6
JVM_OPTS=$JVM_OPTS -XX:CMSWaitDuration=3

Thread/core affinity settings:
JVM_OPTS=$JVM_OPTS -XX:+UnlockDiagnosticVMOptions
JVM_OPTS=$JVM_OPTS -XX:+UseGCTaskAffinity
JVM_OPTS=$JVM_OPTS -XX:+BindGCTaskThreadsToCPUs
JVM_OPTS=$JVM_OPTS -XX:ParGCCardsPerStrideChunk=32768

I've seen decreased GC pause frequency, latency, and an increase in throughput 
using the above recommendations with customer installations using the above 
recommendations. This was observed with both read heavy and balanced workloads.

+[~rbranson] +[~tjake]

 Simplify and enlarge new heap calculation
 -

 Key: CASSANDRA-8150
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8150
 Project: Cassandra
  Issue Type: Improvement
  Components: Config
Reporter: Matt Stump
Assignee: Brandon Williams

 It's been found that the old twitter recommendations of 100m per core up to 
 800m is harmful and should no longer be used.
 Instead the formula used should be 1/3 or 1/4 max heap with a max of 2G. 1/3 
 or 1/4 is debatable and I'm open to suggestions. If I were to hazard a guess 
 1/3 is probably better for releases greater than 2.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8344) QueryProcessor evictionCheckTimer not named and non-daemon

2014-11-19 Thread Chris Lohfink (JIRA)
Chris Lohfink created CASSANDRA-8344:


 Summary: QueryProcessor evictionCheckTimer not named and non-daemon
 Key: CASSANDRA-8344
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8344
 Project: Cassandra
  Issue Type: Improvement
Reporter: Chris Lohfink
Assignee: Chris Lohfink
Priority: Trivial


QueryProcessor's evictionCheckTimer isn't daemon and is not named.  Makes it 
difficult to track down when blocking application (i.e. forked benchmarks from 
JMH will freeze waiting for completion).

for what its worth, little hack to work around it to make tests complete:
{code}
Field f = 
QueryProcessor.class.getDeclaredField(evictionCheckTimer);
f.setAccessible(true);
((ScheduledExecutorService)f.get(null)).shutdown();
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8344) QueryProcessor evictionCheckTimer not named and non-daemon

2014-11-19 Thread Chris Lohfink (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Lohfink updated CASSANDRA-8344:
-
Attachment: 8344.diff

 QueryProcessor evictionCheckTimer not named and non-daemon
 --

 Key: CASSANDRA-8344
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8344
 Project: Cassandra
  Issue Type: Improvement
Reporter: Chris Lohfink
Assignee: Chris Lohfink
Priority: Trivial
 Attachments: 8344.diff


 QueryProcessor's evictionCheckTimer isn't daemon and is not named.  Makes it 
 difficult to track down when blocking application (i.e. forked benchmarks 
 from JMH will freeze waiting for completion).
 for what its worth, little hack to work around it to make tests complete:
 {code}
 Field f = 
 QueryProcessor.class.getDeclaredField(evictionCheckTimer);
 f.setAccessible(true);
 ((ScheduledExecutorService)f.get(null)).shutdown();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7386) JBOD threshold to prevent unbalanced disk utilization

2014-11-19 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7386:

Attachment: 7386-2.1-v5.txt
7386-2.0-v5.txt

Patch v5 fixes the junit (only change).

Yeah - that was weird. Intention was to check at least 100 iterations (to see 
whether it gets wrong) and at max some more iterations to give it a very high 
chance to succeed.

 JBOD threshold to prevent unbalanced disk utilization
 -

 Key: CASSANDRA-7386
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7386
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Chris Lohfink
Assignee: Robert Stupp
Priority: Minor
 Fix For: 2.1.3

 Attachments: 7386-2.0-v3.txt, 7386-2.0-v4.txt, 7386-2.0-v5.txt, 
 7386-2.1-v3.txt, 7386-2.1-v4.txt, 7386-2.1-v5.txt, 7386-v1.patch, 
 7386v2.diff, Mappe1.ods, mean-writevalue-7disks.png, 
 patch_2_1_branch_proto.diff, sstable-count-second-run.png, 
 test1_no_patch.jpg, test1_with_patch.jpg, test2_no_patch.jpg, 
 test2_with_patch.jpg, test3_no_patch.jpg, test3_with_patch.jpg


 Currently the pick the disks are picked first by number of current tasks, 
 then by free space.  This helps with performance but can lead to large 
 differences in utilization in some (unlikely but possible) scenarios.  Ive 
 seen 55% to 10% and heard reports of 90% to 10% on IRC.  With both LCS and 
 STCS (although my suspicion is that STCS makes it worse since harder to be 
 balanced).
 I purpose the algorithm change a little to have some maximum range of 
 utilization where it will pick by free space over load (acknowledging it can 
 be slower).  So if a disk A is 30% full and disk B is 5% full it will never 
 pick A over B until it balances out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-8339) Reading columns marked as type different than default validation class from CQL causes errors

2014-11-19 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko reassigned CASSANDRA-8339:


Assignee: Aleksey Yeschenko  (was: Tyler Hobbs)

 Reading columns marked as type different than default validation class from 
 CQL causes errors
 -

 Key: CASSANDRA-8339
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8339
 Project: Cassandra
  Issue Type: Bug
Reporter: Erik Forsberg
Assignee: Aleksey Yeschenko

 As [discussed on users mailing 
 list|http://www.mail-archive.com/user%40cassandra.apache.org/msg39251.html] 
 I'm having trouble reading data from a table created via thrift, where some 
 columns are marked as having a validator different than the default one.
 Minimal working example:
 {noformat}
 #!/usr/bin/env python
 # Run this in virtualenv with pycassa and cassandra-driver installed via pip
 import pycassa
 import cassandra
 import calendar
 import traceback
 import time
 from uuid import uuid4
 keyspace = badcql
 sysmanager = pycassa.system_manager.SystemManager(localhost)
 sysmanager.create_keyspace(keyspace, 
 strategy_options={'replication_factor':'1'})
 sysmanager.create_column_family(keyspace, Users, 
 key_validation_class=pycassa.system_manager.LEXICAL_UUID_TYPE,
 
 comparator_type=pycassa.system_manager.ASCII_TYPE,
 
 default_validation_class=pycassa.system_manager.UTF8_TYPE)
 sysmanager.create_index(keyspace, Users, username, 
 pycassa.system_manager.UTF8_TYPE)
 sysmanager.create_index(keyspace, Users, email, 
 pycassa.system_manager.UTF8_TYPE)
 sysmanager.alter_column(keyspace, Users, default_account_id, 
 pycassa.system_manager.LEXICAL_UUID_TYPE)
 sysmanager.create_index(keyspace, Users, active, 
 pycassa.system_manager.INT_TYPE)
 sysmanager.alter_column(keyspace, Users, date_created, 
 pycassa.system_manager.LONG_TYPE)
 pool = pycassa.pool.ConnectionPool(keyspace, ['localhost:9160'])
 cf = pycassa.ColumnFamily(pool, Users)
 user_uuid = uuid4()
 cf.insert(user_uuid, {'username':'test_username', 'auth_method':'ldap', 
 'email':'t...@example.com', 'active':1, 
   'date_created':long(calendar.timegm(time.gmtime())), 
 'default_account_id':uuid4()})
 from cassandra.cluster import Cluster
 cassandra_cluster = Cluster([localhost])
 cassandra_session = cassandra_cluster.connect(keyspace)
 print username, cassandra_session.execute('SELECT value from Users where 
 key = %s and column1 = %s', (user_uuid, 'username',))
 print email, cassandra_session.execute('SELECT value from Users where key 
 = %s and column1 = %s', (user_uuid, 'email',))
 try:
 print default_account_id, cassandra_session.execute('SELECT value from 
 Users where key = %s and column1 = %s', (user_uuid, 'default_account_id',))
 except Exception as e:
 print Exception trying to get default_account_id, traceback.format_exc()
 cassandra_session = cassandra_cluster.connect(keyspace)
 try:
 print active, cassandra_session.execute('SELECT value from Users 
 where key = %s and column1 = %s', (user_uuid, 'active',))
 except Exception as e:
 print Exception trying to get active, traceback.format_exc()
 cassandra_session = cassandra_cluster.connect(keyspace)
 try:
 print date_created, cassandra_session.execute('SELECT value from 
 Users where key = %s and column1 = %s', (user_uuid, 'date_created',))
 except Exception as e:
 print Exception trying to get date_created, traceback.format_exc()
 
 {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CASSANDRA-8345) Client notifications should carry the entire delta of the information that changed

2014-11-19 Thread JIRA
Michaël Figuière created CASSANDRA-8345:
---

 Summary: Client notifications should carry the entire delta of the 
information that changed
 Key: CASSANDRA-8345
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8345
 Project: Cassandra
  Issue Type: Improvement
Reporter: Michaël Figuière


Currently when the schema changes, a {{SCHEMA_CHANGE}} notification is sent to 
the client to let it know that a modification happened in a specific table or 
keyspace. If the client register for these notifications, this is likely that 
it actually cares to have an up to date version of this information, so the 
next step is logically for the client to query the {{system}} keyspace to 
retrieve the latest version of the schema for the particular element that was 
mentioned in the notification.

The same thing happen with the {{TOPOLOGY_CHANGE}} notification as the client 
will follow up with a query to retrieve the details that changed in the 
{{system.peers}} table.

It would be interesting to send the entire delta of the information that 
changed within the notification. I see several advantages with this:
* This would ensure that the data that are sent to the client are as small as 
possible as such a delta will always be smaller than the resultset that would 
eventually be received for a formal query on the {{system}} keyspace.
* This avoid the Cassandra node to receive plenty of query after it issue a 
notification but rather to prepare a delta once and send it to everybody.
* This should improve the overall behaviour when dealing with very large 
schemas with frequent changes (typically due to a tentative of implementing 
multitenancy through separate keyspaces), as it has been observed that the the 
notifications and subsequent queries traffic can become non negligible in this 
case.
* This would eventually simplify the driver design by removing the need for an 
extra asynchronous operation to follow up with, although the benefit of this 
point will be real only once the previous versions of the protocols are far 
behind.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7563) UserType, TupleType and collections in UDFs

2014-11-19 Thread Tyler Hobbs (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218503#comment-14218503
 ] 

Tyler Hobbs commented on CASSANDRA-7563:


bq. The protocol version stuff got a bit bigger than I expected. But the new 
tests in UFTest pass. These test execution using executeInternal and using 
protocol version 2 + 3 via the Java Driver.

Looks good!

bq. I tried to make the new tests a bit more readable - hope it looks better 
now.

Thanks, this is definitely easier to read.

bq. Calling a UDF with a null value in a collection does not work - the Java 
Driver does not support that. Added a test for that (but with @Ignore 
annotation.

Sorry, I meant testing where the entire collection is null/empty.  For example, 
something like {{SELECT myfunc(mycollection) FROM ...}} where {{mycollection}} 
may be null/empty.

Some more review comments:

JavaSourceUDFFactory:
* Can you add quick docs explaining argDataTypes, returnDataType vs 
javaParamTypes, javaReturnType
* The example generated function for generateExecuteMethod() needs to be 
updated for protocolVersion in a couple of places

ScriptBasedUDF:
* Directly return {{decompose()}} result at the end of {{execute()}}

UDFunction:
* Can you add basic javadocs on type-related methods plus {{compose()}} and 
{{decompose()}}

UFTest:
* You mentioned that you had test coverage for various changes to UDTs used by 
functions, but I only see one that covers adding a field.  Can you add coverage 
for the other cases?  With the existing test, what happens if the UDT is 
altered and the function isn't replaced?  Make sure to cover failure scenarios 
in the tests.

It's getting close! Thanks for your hard work :)

 UserType, TupleType and collections in UDFs
 ---

 Key: CASSANDRA-7563
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7563
 Project: Cassandra
  Issue Type: Bug
Reporter: Robert Stupp
Assignee: Robert Stupp
 Fix For: 3.0

 Attachments: 7563-7740.txt, 7563.txt, 7563v2.txt, 7563v3.txt, 
 7563v4.txt


 * is Java Driver as a dependency required ?
 * is it possible to extract parts of the Java Driver for UDT/TT/coll support ?
 * CQL {{DROP TYPE}} must check UDFs
 * must check keyspace access permissions (if those exist)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8340) Use sstable min timestamp when deciding if an sstable should be included in DTCS compactions

2014-11-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218515#comment-14218515
 ] 

Björn Hegerfors commented on CASSANDRA-8340:


Actually, it's already implemented like that. The SSTables are paired with 
their age in the createSSTableAndMinTimestampPairs method. Max timestamps are 
only used in getNow and filterOldSSTables.

I used min timestamps based on the same reasoning as yours. I agree that major 
compaction is the way to go when switching.

 Use sstable min timestamp when deciding if an sstable should be included in 
 DTCS compactions
 

 Key: CASSANDRA-8340
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8340
 Project: Cassandra
  Issue Type: Improvement
Reporter: Marcus Eriksson
Priority: Minor

 Currently we check how old the newest data (max timestamp) in an sstable is 
 when we check if it should be compacted.
 If we instead switch to using min timestamp for this we have a pretty clean 
 migration path from STCS/LCS to DTCS. 
 My thinking is that before migrating, the user does a major compaction, which 
 creates a huge sstable containing all data, with min timestamp very far back 
 in time, then switching to DTCS, we will have a big sstable that we never 
 compact (ie, min timestamp of this big sstable is before 
 max_sstable_age_days), and all newer data will be after that, and that new 
 data will be properly compacted
 WDYT [~Bj0rn] ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8340) Use sstable min timestamp when deciding if an sstable should be included in DTCS compactions

2014-11-19 Thread Marcus Eriksson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218522#comment-14218522
 ] 

Marcus Eriksson commented on CASSANDRA-8340:


I meant using max timestamp in filterOldSSTables to avoid compacting the big 
sstable at all

 Use sstable min timestamp when deciding if an sstable should be included in 
 DTCS compactions
 

 Key: CASSANDRA-8340
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8340
 Project: Cassandra
  Issue Type: Improvement
Reporter: Marcus Eriksson
Priority: Minor

 Currently we check how old the newest data (max timestamp) in an sstable is 
 when we check if it should be compacted.
 If we instead switch to using min timestamp for this we have a pretty clean 
 migration path from STCS/LCS to DTCS. 
 My thinking is that before migrating, the user does a major compaction, which 
 creates a huge sstable containing all data, with min timestamp very far back 
 in time, then switching to DTCS, we will have a big sstable that we never 
 compact (ie, min timestamp of this big sstable is before 
 max_sstable_age_days), and all newer data will be after that, and that new 
 data will be properly compacted
 WDYT [~Bj0rn] ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8340) Use sstable min timestamp when deciding if an sstable should be included in DTCS compactions

2014-11-19 Thread Marcus Eriksson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218522#comment-14218522
 ] 

Marcus Eriksson edited comment on CASSANDRA-8340 at 11/19/14 9:23 PM:
--

I meant using min timestamp in filterOldSSTables to avoid compacting the big 
sstable at all


was (Author: krummas):
I meant using max timestamp in filterOldSSTables to avoid compacting the big 
sstable at all

 Use sstable min timestamp when deciding if an sstable should be included in 
 DTCS compactions
 

 Key: CASSANDRA-8340
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8340
 Project: Cassandra
  Issue Type: Improvement
Reporter: Marcus Eriksson
Priority: Minor

 Currently we check how old the newest data (max timestamp) in an sstable is 
 when we check if it should be compacted.
 If we instead switch to using min timestamp for this we have a pretty clean 
 migration path from STCS/LCS to DTCS. 
 My thinking is that before migrating, the user does a major compaction, which 
 creates a huge sstable containing all data, with min timestamp very far back 
 in time, then switching to DTCS, we will have a big sstable that we never 
 compact (ie, min timestamp of this big sstable is before 
 max_sstable_age_days), and all newer data will be after that, and that new 
 data will be properly compacted
 WDYT [~Bj0rn] ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7404) Use direct i/o for sequential operations (compaction/streaming)

2014-11-19 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218578#comment-14218578
 ] 

Jonathan Ellis commented on CASSANDRA-7404:
---

I bet we could make a single builder work.

 Use direct i/o for sequential operations (compaction/streaming)
 ---

 Key: CASSANDRA-7404
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7404
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Jason Brown
Assignee: Ariel Weisberg
  Labels: performance
 Fix For: 3.0


 Investigate using linux's direct i/o for operations where we read 
 sequentially through a file (repair and bootstrap streaming, compaction 
 reads, and so on). Direct i/o does not go through the kernel page page, so it 
 should leave the hot cache pages used for live reads unaffected.
 Note: by using direct i/o, we will probably take a performance hit on reading 
 the file we're sequentially scanning through (that is, compactions may get 
 slower), but the goal of this ticket is to limit the impact of these 
 background tasks on the main read/write functionality. Of course, I'll 
 measure any perf hit that is incurred, and see if there's any mechanisms to 
 mitigate it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8338) Simplify Token Selection

2014-11-19 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218583#comment-14218583
 ] 

Jonathan Ellis commented on CASSANDRA-8338:
---

Is it really worth spending time on non-vnode tokens at this point?

 Simplify Token Selection
 

 Key: CASSANDRA-8338
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8338
 Project: Cassandra
  Issue Type: Improvement
  Components: Config
Reporter: Joaquin Casares
Priority: Trivial
  Labels: lhf

 When creating provisioning scripts, especially when running tools like Chef, 
 each node is launched individually. When not using vnodes your initial setup 
 will always be unbalanced unless you handle token assignment within your 
 scripts. 
 I spoke to someone recently who was using this in production and his 
 operations team wasn't too pleased that they had to use OpsCenter as an extra 
 step for rebalancing. Instead, we should provide this functionality out of 
 the box for new clusters.
 Instead, could we have the following options below the initial_token section?
 {CODE}
 # datacenter_index: 0
 # node_index: 0
 # datacenter_size: 1
 {CODE}
 The above configuration options, when uncommented, would do the math of:
 {CODE}
 token = node_index * (range / datacenter_size) + (datacenter_index * 100) 
 + start_of_range
 {CODE}
 This means that users don't have to repeatedly implement the initial_token 
 selection code nor know the range and offsets of their partitioner.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8337) mmap underflow during validation compaction

2014-11-19 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218588#comment-14218588
 ] 

Jonathan Ellis commented on CASSANDRA-8337:
---

Were you running 2.0.x previously?  Is this new in 2.1?

 mmap underflow during validation compaction
 ---

 Key: CASSANDRA-8337
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8337
 Project: Cassandra
  Issue Type: Bug
Reporter: Alexander Sterligov
Assignee: Joshua McKenzie
 Attachments: thread_dump


 During full parallel repair I often get errors like the following
 {quote}
 [2014-11-19 01:02:39,355] Repair session 116beaf0-6f66-11e4-afbb-c1c082008cbe 
 for range (3074457345618263602,-9223372036854775808] failed with error 
 org.apache.cassandra.exceptions.RepairException: [repair 
 #116beaf0-6f66-11e4-afbb-c1c082008cbe on iss/target_state_history, 
 (3074457345618263602,-9223372036854775808]] Validation failed in 
 /95.108.242.19
 {quote}
 At the log of the node there are always same exceptions:
 {quote}
 ERROR [ValidationExecutor:2] 2014-11-19 01:02:10,847 
 JVMStabilityInspector.java:94 - JVM state determined to be unstable.  Exiting 
 forcefully due to:
 org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
 mmap segment underflow; remaining is 15 but 47 requested
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1518)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1385)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPositionsForRanges(SSTableReader.java:1315)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1706)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1694)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.AbstractCompactionStrategy.getScanners(AbstractCompactionStrategy.java:276)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.WrappingCompactionStrategy.getScanners(WrappingCompactionStrategy.java:320)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.doValidationCompaction(CompactionManager.java:917)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.access$600(CompactionManager.java:97)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$9.call(CompactionManager.java:557)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_51]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
 Caused by: java.io.IOException: mmap segment underflow; remaining is 15 but 
 47 requested
 at 
 org.apache.cassandra.io.util.MappedFileDataInput.readBytes(MappedFileDataInput.java:135)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:348) 
 ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.readWithShortLength(ByteBufferUtil.java:327)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1460)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 ... 13 common frames omitted
 {quote}
 Now i'm using die disk_failure_policy to determine such conditions faster, 
 but I get them even with stop policy.
 Streams related to host with such exception are hanged. Thread dump is 
 attached. Only restart helps.
 After retry I get errors from other nodes.
 scrub doesn't help and report that sstables are ok.
 Sequential repairs doesn't cause such exceptions.
 Load is about 1000 write rps and 50 read rps per node.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8337) mmap underflow during validation compaction

2014-11-19 Thread Jonathan Ellis (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Ellis updated CASSANDRA-8337:
--
Assignee: Joshua McKenzie

 mmap underflow during validation compaction
 ---

 Key: CASSANDRA-8337
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8337
 Project: Cassandra
  Issue Type: Bug
Reporter: Alexander Sterligov
Assignee: Joshua McKenzie
 Attachments: thread_dump


 During full parallel repair I often get errors like the following
 {quote}
 [2014-11-19 01:02:39,355] Repair session 116beaf0-6f66-11e4-afbb-c1c082008cbe 
 for range (3074457345618263602,-9223372036854775808] failed with error 
 org.apache.cassandra.exceptions.RepairException: [repair 
 #116beaf0-6f66-11e4-afbb-c1c082008cbe on iss/target_state_history, 
 (3074457345618263602,-9223372036854775808]] Validation failed in 
 /95.108.242.19
 {quote}
 At the log of the node there are always same exceptions:
 {quote}
 ERROR [ValidationExecutor:2] 2014-11-19 01:02:10,847 
 JVMStabilityInspector.java:94 - JVM state determined to be unstable.  Exiting 
 forcefully due to:
 org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
 mmap segment underflow; remaining is 15 but 47 requested
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1518)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1385)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPositionsForRanges(SSTableReader.java:1315)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1706)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1694)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.AbstractCompactionStrategy.getScanners(AbstractCompactionStrategy.java:276)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.WrappingCompactionStrategy.getScanners(WrappingCompactionStrategy.java:320)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.doValidationCompaction(CompactionManager.java:917)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.access$600(CompactionManager.java:97)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$9.call(CompactionManager.java:557)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_51]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
 Caused by: java.io.IOException: mmap segment underflow; remaining is 15 but 
 47 requested
 at 
 org.apache.cassandra.io.util.MappedFileDataInput.readBytes(MappedFileDataInput.java:135)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:348) 
 ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.readWithShortLength(ByteBufferUtil.java:327)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1460)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 ... 13 common frames omitted
 {quote}
 Now i'm using die disk_failure_policy to determine such conditions faster, 
 but I get them even with stop policy.
 Streams related to host with such exception are hanged. Thread dump is 
 attached. Only restart helps.
 After retry I get errors from other nodes.
 scrub doesn't help and report that sstables are ok.
 Sequential repairs doesn't cause such exceptions.
 Load is about 1000 write rps and 50 read rps per node.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8338) Simplify Token Selection

2014-11-19 Thread Joaquin Casares (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218592#comment-14218592
 ] 

Joaquin Casares commented on CASSANDRA-8338:


Until DSE fully supports vnodes for all components I would hope so since we 
still have future installs using non-vnode clusters/data centers.

 Simplify Token Selection
 

 Key: CASSANDRA-8338
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8338
 Project: Cassandra
  Issue Type: Improvement
  Components: Config
Reporter: Joaquin Casares
Priority: Trivial
  Labels: lhf

 When creating provisioning scripts, especially when running tools like Chef, 
 each node is launched individually. When not using vnodes your initial setup 
 will always be unbalanced unless you handle token assignment within your 
 scripts. 
 I spoke to someone recently who was using this in production and his 
 operations team wasn't too pleased that they had to use OpsCenter as an extra 
 step for rebalancing. Instead, we should provide this functionality out of 
 the box for new clusters.
 Instead, could we have the following options below the initial_token section?
 {CODE}
 # datacenter_index: 0
 # node_index: 0
 # datacenter_size: 1
 {CODE}
 The above configuration options, when uncommented, would do the math of:
 {CODE}
 token = node_index * (range / datacenter_size) + (datacenter_index * 100) 
 + start_of_range
 {CODE}
 This means that users don't have to repeatedly implement the initial_token 
 selection code nor know the range and offsets of their partitioner.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8340) Use sstable min timestamp when deciding if an sstable should be included in DTCS compactions

2014-11-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218593#comment-14218593
 ] 

Björn Hegerfors commented on CASSANDRA-8340:


OK, let's see. This is a big SSTable with a timestamp span of [t0, t1]. Since 
it came out of a major compaction, t1 is close to the current time. DTCS would 
never generate an SSTable that large with t1 that close to current time. But as 
time passes, [t0, t1] eventually becomes a timestamp span that even DTCS could 
have generated. Only beyond that point in time would DTCS actually consider 
compacting it, because it's t0 that governs when it compacts next, not t1. This 
is because t0 is so old and so far away from the min timestamp of any other 
SSTable. I'm certain of this. I haven't got a formula for this (I wish to make 
one), but I think that the major compacted SSTable may even have to double its 
age before next compaction will happen, so if the min timestamp was older than 
max_sstable_age_days when switching strategies, the max timestamp will be older 
than that before any compaction was ever considered.

In other words, your scenario is not in any way a particular reason to change 
the max_sstable_age_days behavior. There may still be other reasons.

Did you get that? I had a hard time figuring out a sensible way to formulate my 
reasoning here. Rewrote this 3 times :P

 Use sstable min timestamp when deciding if an sstable should be included in 
 DTCS compactions
 

 Key: CASSANDRA-8340
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8340
 Project: Cassandra
  Issue Type: Improvement
Reporter: Marcus Eriksson
Priority: Minor

 Currently we check how old the newest data (max timestamp) in an sstable is 
 when we check if it should be compacted.
 If we instead switch to using min timestamp for this we have a pretty clean 
 migration path from STCS/LCS to DTCS. 
 My thinking is that before migrating, the user does a major compaction, which 
 creates a huge sstable containing all data, with min timestamp very far back 
 in time, then switching to DTCS, we will have a big sstable that we never 
 compact (ie, min timestamp of this big sstable is before 
 max_sstable_age_days), and all newer data will be after that, and that new 
 data will be properly compacted
 WDYT [~Bj0rn] ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-7563) UserType, TupleType and collections in UDFs

2014-11-19 Thread Robert Stupp (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-7563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-7563:

Attachment: 7563v5.txt

 UserType, TupleType and collections in UDFs
 ---

 Key: CASSANDRA-7563
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7563
 Project: Cassandra
  Issue Type: Bug
Reporter: Robert Stupp
Assignee: Robert Stupp
 Fix For: 3.0

 Attachments: 7563-7740.txt, 7563.txt, 7563v2.txt, 7563v3.txt, 
 7563v4.txt, 7563v5.txt


 * is Java Driver as a dependency required ?
 * is it possible to extract parts of the Java Driver for UDT/TT/coll support ?
 * CQL {{DROP TYPE}} must check UDFs
 * must check keyspace access permissions (if those exist)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7075) Add the ability to automatically distribute your commitlogs across all data volumes

2014-11-19 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218596#comment-14218596
 ] 

Jonathan Ellis commented on CASSANDRA-7075:
---

Do you have time to review, [~jasobrown]?

 Add the ability to automatically distribute your commitlogs across all data 
 volumes
 ---

 Key: CASSANDRA-7075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7075
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Tupshin Harper
Assignee: Branimir Lambov
Priority: Minor
  Labels: performance
 Fix For: 3.0


 given the prevalance of ssds (no need to separate commitlog and data), and 
 improved jbod support, along with CASSANDRA-3578, it seems like we should 
 have an option to have one commitlog per data volume, to even the load. i've 
 been seeing more and more cases where there isn't an obvious extra volume 
 to put the commitlog on, and sticking it on only one of the jbodded ssd 
 volumes leads to IO imbalance.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7563) UserType, TupleType and collections in UDFs

2014-11-19 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218614#comment-14218614
 ] 

Robert Stupp commented on CASSANDRA-7563:
-

Heh - it all started with a simple pure approach :)

Attached v5 with changes regarding the comments.
Just one enhancement: you can no longer drop a type that is used by a UDF's 
return or argument type (updated DropTypeStatement for that).

 UserType, TupleType and collections in UDFs
 ---

 Key: CASSANDRA-7563
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7563
 Project: Cassandra
  Issue Type: Bug
Reporter: Robert Stupp
Assignee: Robert Stupp
 Fix For: 3.0

 Attachments: 7563-7740.txt, 7563.txt, 7563v2.txt, 7563v3.txt, 
 7563v4.txt, 7563v5.txt


 * is Java Driver as a dependency required ?
 * is it possible to extract parts of the Java Driver for UDT/TT/coll support ?
 * CQL {{DROP TYPE}} must check UDFs
 * must check keyspace access permissions (if those exist)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8053) Support for user defined aggregate functions

2014-11-19 Thread Robert Stupp (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218616#comment-14218616
 ] 

Robert Stupp commented on CASSANDRA-8053:
-

When CASSANDRA-7563 is committed, I'll rebase the patch for this one.

 Support for user defined aggregate functions
 

 Key: CASSANDRA-8053
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8053
 Project: Cassandra
  Issue Type: New Feature
Reporter: Robert Stupp
Assignee: Robert Stupp
  Labels: cql, udf
 Fix For: 3.0

 Attachments: 8053v1.txt


 CASSANDRA-4914 introduces aggregate functions.
 This ticket is about to decide how we can support user defined aggregate 
 functions. UD aggregate functions should be supported for all UDF flavors 
 (class, java, jsr223).
 Things to consider:
 * Special implementations for each scripting language should be omitted
 * No exposure of internal APIs (e.g. {{AggregateFunction}} interface)
 * No need for users to deal with serializers / codecs



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7075) Add the ability to automatically distribute your commitlogs across all data volumes

2014-11-19 Thread Jason Brown (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218639#comment-14218639
 ] 

Jason Brown commented on CASSANDRA-7075:


Sure, will do.

 Add the ability to automatically distribute your commitlogs across all data 
 volumes
 ---

 Key: CASSANDRA-7075
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7075
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Tupshin Harper
Assignee: Branimir Lambov
Priority: Minor
  Labels: performance
 Fix For: 3.0


 given the prevalance of ssds (no need to separate commitlog and data), and 
 improved jbod support, along with CASSANDRA-3578, it seems like we should 
 have an option to have one commitlog per data volume, to even the load. i've 
 been seeing more and more cases where there isn't an obvious extra volume 
 to put the commitlog on, and sticking it on only one of the jbodded ssd 
 volumes leads to IO imbalance.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


cassandra git commit: Centralize shared executors

2014-11-19 Thread aleksey
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 e3862bc3e - 4397c3447


Centralize shared executors

patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-8055


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

Branch: refs/heads/cassandra-2.1
Commit: 4397c34476070ea15ee0d2b9c625887a8b08b622
Parents: e3862bc
Author: Sam Tunnicliffe s...@beobal.com
Authored: Thu Nov 20 01:42:03 2014 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Thu Nov 20 01:57:01 2014 +0300

--
 CHANGES.txt |  1 +
 src/java/org/apache/cassandra/auth/Auth.java| 17 
 .../cassandra/auth/PasswordAuthenticator.java   | 18 
 .../apache/cassandra/cache/AutoSavingCache.java | 10 ++---
 .../concurrent/ScheduledExecutors.java  | 43 
 .../apache/cassandra/cql3/QueryProcessor.java   |  5 +--
 .../apache/cassandra/db/BatchlogManager.java|  8 +++-
 .../apache/cassandra/db/ColumnFamilyStore.java  | 42 +++
 .../cassandra/db/HintedHandOffManager.java  |  7 ++--
 .../db/commitlog/CommitLogArchiver.java |  2 +-
 .../io/sstable/SSTableDeletingTask.java |  6 +--
 .../cassandra/io/sstable/SSTableReader.java |  3 +-
 .../org/apache/cassandra/io/util/FileUtils.java |  4 +-
 .../locator/DynamicEndpointSnitch.java  |  5 ++-
 .../apache/cassandra/net/MessagingService.java  |  4 +-
 .../cassandra/service/CassandraDaemon.java  |  3 +-
 .../cassandra/service/LoadBroadcaster.java  |  3 +-
 .../cassandra/service/MigrationManager.java |  3 +-
 .../cassandra/service/StorageService.java   | 38 -
 .../apache/cassandra/utils/ResourceWatcher.java |  4 +-
 .../org/apache/cassandra/cql3/CQLTester.java|  6 +--
 .../org/apache/cassandra/db/KeyCacheTest.java   |  5 +--
 22 files changed, 139 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c00e671..41a5aaf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.3
+ * Centralize shared executors (CASSANDRA-8055)
  * Fix filtering for CONTAINS (KEY) relations on frozen collection
clustering columns when the query is restricted to a single
partition (CASSANDRA-8203)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/src/java/org/apache/cassandra/auth/Auth.java
--
diff --git a/src/java/org/apache/cassandra/auth/Auth.java 
b/src/java/org/apache/cassandra/auth/Auth.java
index 4f18111..ed7aa87 100644
--- a/src/java/org/apache/cassandra/auth/Auth.java
+++ b/src/java/org/apache/cassandra/auth/Auth.java
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
@@ -189,15 +190,13 @@ public class Auth implements AuthMBean
 // the delay is here to give the node some time to see its peers - to 
reduce
 // Skipped default superuser setup: some nodes were not ready log 
spam.
 // It's the only reason for the delay.
-StorageService.tasks.schedule(new Runnable()
-  {
-  public void run()
-  {
-  setupDefaultSuperuser();
-  }
-  },
-  SUPERUSER_SETUP_DELAY,
-  TimeUnit.MILLISECONDS);
+ScheduledExecutors.nonPeriodicTasks.schedule(new Runnable()
+{
+public void run()
+{
+setupDefaultSuperuser();
+}
+}, SUPERUSER_SETUP_DELAY, TimeUnit.MILLISECONDS);
 
 try
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
--
diff --git a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java 
b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
index 1218ee2..9570770 100644
--- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
+++ 

[1/2] cassandra git commit: Centralize shared executors

2014-11-19 Thread aleksey
Repository: cassandra
Updated Branches:
  refs/heads/trunk 1bd5c64ba - 8badc2856


Centralize shared executors

patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-8055


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

Branch: refs/heads/trunk
Commit: 4397c34476070ea15ee0d2b9c625887a8b08b622
Parents: e3862bc
Author: Sam Tunnicliffe s...@beobal.com
Authored: Thu Nov 20 01:42:03 2014 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Thu Nov 20 01:57:01 2014 +0300

--
 CHANGES.txt |  1 +
 src/java/org/apache/cassandra/auth/Auth.java| 17 
 .../cassandra/auth/PasswordAuthenticator.java   | 18 
 .../apache/cassandra/cache/AutoSavingCache.java | 10 ++---
 .../concurrent/ScheduledExecutors.java  | 43 
 .../apache/cassandra/cql3/QueryProcessor.java   |  5 +--
 .../apache/cassandra/db/BatchlogManager.java|  8 +++-
 .../apache/cassandra/db/ColumnFamilyStore.java  | 42 +++
 .../cassandra/db/HintedHandOffManager.java  |  7 ++--
 .../db/commitlog/CommitLogArchiver.java |  2 +-
 .../io/sstable/SSTableDeletingTask.java |  6 +--
 .../cassandra/io/sstable/SSTableReader.java |  3 +-
 .../org/apache/cassandra/io/util/FileUtils.java |  4 +-
 .../locator/DynamicEndpointSnitch.java  |  5 ++-
 .../apache/cassandra/net/MessagingService.java  |  4 +-
 .../cassandra/service/CassandraDaemon.java  |  3 +-
 .../cassandra/service/LoadBroadcaster.java  |  3 +-
 .../cassandra/service/MigrationManager.java |  3 +-
 .../cassandra/service/StorageService.java   | 38 -
 .../apache/cassandra/utils/ResourceWatcher.java |  4 +-
 .../org/apache/cassandra/cql3/CQLTester.java|  6 +--
 .../org/apache/cassandra/db/KeyCacheTest.java   |  5 +--
 22 files changed, 139 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c00e671..41a5aaf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.3
+ * Centralize shared executors (CASSANDRA-8055)
  * Fix filtering for CONTAINS (KEY) relations on frozen collection
clustering columns when the query is restricted to a single
partition (CASSANDRA-8203)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/src/java/org/apache/cassandra/auth/Auth.java
--
diff --git a/src/java/org/apache/cassandra/auth/Auth.java 
b/src/java/org/apache/cassandra/auth/Auth.java
index 4f18111..ed7aa87 100644
--- a/src/java/org/apache/cassandra/auth/Auth.java
+++ b/src/java/org/apache/cassandra/auth/Auth.java
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
@@ -189,15 +190,13 @@ public class Auth implements AuthMBean
 // the delay is here to give the node some time to see its peers - to 
reduce
 // Skipped default superuser setup: some nodes were not ready log 
spam.
 // It's the only reason for the delay.
-StorageService.tasks.schedule(new Runnable()
-  {
-  public void run()
-  {
-  setupDefaultSuperuser();
-  }
-  },
-  SUPERUSER_SETUP_DELAY,
-  TimeUnit.MILLISECONDS);
+ScheduledExecutors.nonPeriodicTasks.schedule(new Runnable()
+{
+public void run()
+{
+setupDefaultSuperuser();
+}
+}, SUPERUSER_SETUP_DELAY, TimeUnit.MILLISECONDS);
 
 try
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4397c344/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
--
diff --git a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java 
b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
index 1218ee2..9570770 100644
--- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
+++ 

[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2014-11-19 Thread aleksey
Merge branch 'cassandra-2.1' into trunk

Conflicts:
src/java/org/apache/cassandra/cql3/QueryProcessor.java
src/java/org/apache/cassandra/db/ColumnFamilyStore.java
src/java/org/apache/cassandra/db/HintedHandOffManager.java
src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
src/java/org/apache/cassandra/service/StorageService.java
test/unit/org/apache/cassandra/db/KeyCacheTest.java


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

Branch: refs/heads/trunk
Commit: 8badc285666360ce7444c0b954e9aaa8e93200ca
Parents: 1bd5c64 4397c34
Author: Aleksey Yeschenko alek...@apache.org
Authored: Thu Nov 20 02:10:40 2014 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Thu Nov 20 02:10:40 2014 +0300

--
 CHANGES.txt |  1 +
 src/java/org/apache/cassandra/auth/Auth.java| 17 ---
 .../cassandra/auth/PasswordAuthenticator.java   | 18 ---
 .../apache/cassandra/cache/AutoSavingCache.java | 10 ++--
 .../concurrent/ScheduledExecutors.java  | 43 +
 .../apache/cassandra/cql3/QueryProcessor.java   |  5 +-
 .../apache/cassandra/db/BatchlogManager.java|  8 +++-
 .../apache/cassandra/db/ColumnFamilyStore.java  | 49 +++-
 .../cassandra/db/HintedHandOffManager.java  |  7 +--
 .../db/commitlog/CommitLogArchiver.java |  2 +-
 .../io/sstable/SSTableDeletingTask.java |  6 +--
 .../io/sstable/format/SSTableReader.java| 28 +--
 .../org/apache/cassandra/io/util/FileUtils.java |  4 +-
 .../locator/DynamicEndpointSnitch.java  |  5 +-
 .../apache/cassandra/net/MessagingService.java  |  4 +-
 .../cassandra/service/CassandraDaemon.java  |  3 +-
 .../cassandra/service/LoadBroadcaster.java  |  3 +-
 .../cassandra/service/MigrationManager.java |  3 +-
 .../cassandra/service/StorageService.java   | 43 -
 .../apache/cassandra/utils/ResourceWatcher.java |  4 +-
 .../org/apache/cassandra/cql3/CQLTester.java|  6 +--
 .../org/apache/cassandra/db/KeyCacheTest.java   |  6 +--
 22 files changed, 156 insertions(+), 119 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8badc285/CHANGES.txt
--
diff --cc CHANGES.txt
index f41e7c3,41a5aaf..08c31a9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,38 -1,5 +1,39 @@@
 +3.0
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer 
apis (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup 
(CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support pure user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 
7781, 7929,
 +   7924, 7812, 8063, 7813)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * improve concurrency of repair (CASSANDRA-6455, 8208)
 +
  2.1.3
+  * Centralize shared executors (CASSANDRA-8055)
   * Fix filtering for CONTAINS (KEY) relations on frozen collection
 clustering columns when the query is restricted to a single
 partition (CASSANDRA-8203)


[jira] [Resolved] (CASSANDRA-8344) QueryProcessor evictionCheckTimer not named and non-daemon

2014-11-19 Thread Aleksey Yeschenko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksey Yeschenko resolved CASSANDRA-8344.
--
Resolution: Duplicate

Just fixed today by CASSANDRA-8055.

 QueryProcessor evictionCheckTimer not named and non-daemon
 --

 Key: CASSANDRA-8344
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8344
 Project: Cassandra
  Issue Type: Improvement
Reporter: Chris Lohfink
Assignee: Chris Lohfink
Priority: Trivial
 Attachments: 8344.diff


 QueryProcessor's evictionCheckTimer isn't daemon and is not named.  Makes it 
 difficult to track down when blocking application (i.e. forked benchmarks 
 from JMH will freeze waiting for completion).
 for what its worth, little hack to work around it to make tests complete:
 {code}
 Field f = 
 QueryProcessor.class.getDeclaredField(evictionCheckTimer);
 f.setAccessible(true);
 ((ScheduledExecutorService)f.get(null)).shutdown();
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8337) mmap underflow during validation compaction

2014-11-19 Thread Alexander Sterligov (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218701#comment-14218701
 ] 

Alexander Sterligov commented on CASSANDRA-8337:


This cluster were always running 2.1 - 2.1.0 and then 2.1.2.

Unfortunatelly I had to downgrade that 18 replicas today to 2.0.11 and the 
problem has gone. I have not succeeded to reproduce problem on a smaller setup.

Some time ago I tried incremental repairs, but had very same problems even 
faster than with full repair. I've unset repairedAt flag as described in 
documentation.

I also truncated some tables with consistency ALL, but after some write load 
exceptions start to raise again for these tables.

I tried sstablescrub for all sstables on totally offline cluster and it found 
no problems. Then parallel repair again failed due to the same exceptions. 
That's not corrupted sstables.

If I retry parallel repair over and over again it finally finishes with no 
errors. Also same effect if I do sequential repair and parallel repair right 
after it finishes. Also repair finishes successfully if the number of streams 
is not high.

There's no dendency to degradation - just spontaneous failures of repairs and 
annoying hanged streams.

Heavy write or read load doesn't directly cause such problems. But after heavy 
write load with low consistency repair fails.

Overall, it looks like reproduction scenario is large number of short streams 
(~30 per node for several seconds) and it seems 2.1 streaming has race 
condition.


 mmap underflow during validation compaction
 ---

 Key: CASSANDRA-8337
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8337
 Project: Cassandra
  Issue Type: Bug
Reporter: Alexander Sterligov
Assignee: Joshua McKenzie
 Attachments: thread_dump


 During full parallel repair I often get errors like the following
 {quote}
 [2014-11-19 01:02:39,355] Repair session 116beaf0-6f66-11e4-afbb-c1c082008cbe 
 for range (3074457345618263602,-9223372036854775808] failed with error 
 org.apache.cassandra.exceptions.RepairException: [repair 
 #116beaf0-6f66-11e4-afbb-c1c082008cbe on iss/target_state_history, 
 (3074457345618263602,-9223372036854775808]] Validation failed in 
 /95.108.242.19
 {quote}
 At the log of the node there are always same exceptions:
 {quote}
 ERROR [ValidationExecutor:2] 2014-11-19 01:02:10,847 
 JVMStabilityInspector.java:94 - JVM state determined to be unstable.  Exiting 
 forcefully due to:
 org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
 mmap segment underflow; remaining is 15 but 47 requested
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1518)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPosition(SSTableReader.java:1385)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getPositionsForRanges(SSTableReader.java:1315)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1706)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1694)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.AbstractCompactionStrategy.getScanners(AbstractCompactionStrategy.java:276)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.WrappingCompactionStrategy.getScanners(WrappingCompactionStrategy.java:320)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.doValidationCompaction(CompactionManager.java:917)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager.access$600(CompactionManager.java:97)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.db.compaction.CompactionManager$9.call(CompactionManager.java:557)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_51]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_51]
 at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
 Caused by: java.io.IOException: mmap segment underflow; remaining is 15 but 
 47 requested
 at 
 org.apache.cassandra.io.util.MappedFileDataInput.readBytes(MappedFileDataInput.java:135)
  ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:348) 
 ~[apache-cassandra-2.1.2.jar:2.1.2]
 at 
 

[3/3] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

2014-11-19 Thread yukim
Merge branch 'cassandra-2.1' into trunk

Conflicts:
src/java/org/apache/cassandra/db/compaction/CompactionManager.java
src/java/org/apache/cassandra/db/compaction/Scrubber.java
src/java/org/apache/cassandra/service/StorageService.java
src/java/org/apache/cassandra/streaming/StreamReader.java


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

Branch: refs/heads/trunk
Commit: 201a05511791c6ea9adad40c0bab4e1e4714d8ee
Parents: 8badc28 2291a60
Author: Yuki Morishita yu...@apache.org
Authored: Wed Nov 19 17:31:34 2014 -0600
Committer: Yuki Morishita yu...@apache.org
Committed: Wed Nov 19 17:31:34 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  |   5 -
 .../org/apache/cassandra/db/Directories.java| 161 ---
 .../db/compaction/CompactionManager.java|  12 +-
 .../cassandra/db/compaction/Scrubber.java   |   6 +-
 .../cassandra/io/util/DiskAwareRunnable.java|  14 +-
 .../cassandra/service/StorageService.java   |  20 ---
 .../cassandra/streaming/StreamReader.java   |   2 +-
 .../cassandra/streaming/StreamReceiveTask.java  |   8 +-
 .../apache/cassandra/db/DirectoriesTest.java| 128 +++
 10 files changed, 252 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/201a0551/CHANGES.txt
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/201a0551/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/201a0551/src/java/org/apache/cassandra/db/Directories.java
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/201a0551/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
--
diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 05b916f,61628ff..55311a0
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@@ -1046,78 -989,62 +1048,78 @@@ public class CompactionManager implemen
  if (!new File(sstable.getFilename()).exists())
  {
  logger.info(Skipping anticompaction for {}, required sstable 
was compacted and is no longer available., sstable);
 +i.remove();
  continue;
  }
 +if (groupMaxDataAge  sstable.maxDataAge)
 +groupMaxDataAge = sstable.maxDataAge;
 +}
 +
 + 
 +if (anticompactionGroup.size() == 0)
 +{
 +logger.info(No valid anticompactions for this group, All 
sstables were compacted and are no longer available);
 +return 0;
 +}
  
 -logger.info(Anticompacting {}, sstable);
 -SetSSTableReader sstableAsSet = new HashSet();
 -sstableAsSet.add(sstable);
 +logger.info(Anticompacting {}, anticompactionGroup);
 +SetSSTableReader sstableAsSet = new HashSet(anticompactionGroup);
  
- File destination = cfs.directories.getDirectoryForNewSSTables();
 -File destination = 
cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstableAsSet,
 OperationType.ANTICOMPACTION));
 -SSTableRewriter repairedSSTableWriter = new SSTableRewriter(cfs, 
sstableAsSet, sstable.maxDataAge, false);
 -SSTableRewriter unRepairedSSTableWriter = new 
SSTableRewriter(cfs, sstableAsSet, sstable.maxDataAge, false);
++File destination = 
cfs.directories.getWriteableLocationAsFile(cfs.getExpectedCompactedFileSize(sstableAsSet,
 OperationType.ANTICOMPACTION));
 +SSTableRewriter repairedSSTableWriter = new SSTableRewriter(cfs, 
sstableAsSet, groupMaxDataAge, false);
 +SSTableRewriter unRepairedSSTableWriter = new SSTableRewriter(cfs, 
sstableAsSet, groupMaxDataAge, false);
  
 -try (AbstractCompactionStrategy.ScannerList scanners = 
cfs.getCompactionStrategy().getScanners(new 
HashSet(Collections.singleton(sstable)));
 - CompactionController controller = new 
CompactionController(cfs, sstableAsSet, CFMetaData.DEFAULT_GC_GRACE_SECONDS))
 -{
 -
repairedSSTableWriter.switchWriter(CompactionManager.createWriter(cfs, 
destination, expectedBloomFilterSize, repairedAt, sstable));
 - 

[1/3] cassandra git commit: improve JBOD disk utilization

2014-11-19 Thread yukim
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 4397c3447 - 2291a60e9
  refs/heads/trunk 8badc2856 - 201a05511


improve JBOD disk utilization


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

Branch: refs/heads/cassandra-2.1
Commit: 2291a60e9eded4486528acc0a8d12a062b21fc26
Parents: 4397c34
Author: Robert Stupp sn...@snazy.de
Authored: Wed Nov 19 16:17:05 2014 -0600
Committer: Yuki Morishita yu...@apache.org
Committed: Wed Nov 19 17:17:40 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  |   5 -
 .../org/apache/cassandra/db/Directories.java| 161 ---
 .../db/compaction/CompactionManager.java|  12 +-
 .../cassandra/db/compaction/Scrubber.java   |   5 +-
 .../cassandra/io/util/DiskAwareRunnable.java|  14 +-
 .../cassandra/service/StorageService.java   |  20 ---
 .../cassandra/streaming/StreamReader.java   |   3 +-
 .../cassandra/streaming/StreamReceiveTask.java  |   8 +-
 .../apache/cassandra/db/DirectoriesTest.java| 128 +++
 10 files changed, 252 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 41a5aaf..e008ab9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,7 @@
  * Fix overflow on histogram computation (CASSANDRA-8028)
  * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
  * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
+ * Improve JBOD disk utilization (CASSANDRA-7386)
 Merged from 2.0:
  * Fix some failing queries that use multi-column relations
on COMPACT STORAGE tables (CASSANDRA-8264)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 7e1dd18..dec5370 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -2240,11 +2240,6 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 return directories.getSnapshotDetails();
 }
 
-public boolean hasUnreclaimedSpace()
-{
-return getLiveDiskSpaceUsed()  getTotalDiskSpaceUsed();
-}
-
 public long getTotalDiskSpaceUsed()
 {
 return metric.totalDiskSpaceUsed.count();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/src/java/org/apache/cassandra/db/Directories.java
--
diff --git a/src/java/org/apache/cassandra/db/Directories.java 
b/src/java/org/apache/cassandra/db/Directories.java
index 4319481..eb33bd8 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -29,8 +29,7 @@ import java.nio.file.Path;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -39,8 +38,6 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
 import com.google.common.collect.Iterables;
-import com.google.common.primitives.Longs;
-import com.google.common.util.concurrent.Uninterruptibles;
 
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -96,7 +93,6 @@ public class Directories
 dataDirectories[i] = new DataDirectory(new File(locations[i]));
 }
 
-
 /**
  * Checks whether Cassandra has RWX permissions to the specified 
directory.  Logs an error with
  * the details if it does not.
@@ -198,7 +194,7 @@ public class Directories
 for (int i = 0; i  dataDirectories.length; ++i)
 {
 // check if old SSTable directory exists
-dataPaths[i] = new File(dataDirectories[i].location, 
join(metadata.ksName, this.metadata.cfName));
+dataPaths[i] = new File(dataDirectories[i].location, 
join(metadata.ksName, metadata.cfName));
 }
 boolean olderDirectoryExists = 

[2/3] cassandra git commit: improve JBOD disk utilization

2014-11-19 Thread yukim
improve JBOD disk utilization


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

Branch: refs/heads/trunk
Commit: 2291a60e9eded4486528acc0a8d12a062b21fc26
Parents: 4397c34
Author: Robert Stupp sn...@snazy.de
Authored: Wed Nov 19 16:17:05 2014 -0600
Committer: Yuki Morishita yu...@apache.org
Committed: Wed Nov 19 17:17:40 2014 -0600

--
 CHANGES.txt |   1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  |   5 -
 .../org/apache/cassandra/db/Directories.java| 161 ---
 .../db/compaction/CompactionManager.java|  12 +-
 .../cassandra/db/compaction/Scrubber.java   |   5 +-
 .../cassandra/io/util/DiskAwareRunnable.java|  14 +-
 .../cassandra/service/StorageService.java   |  20 ---
 .../cassandra/streaming/StreamReader.java   |   3 +-
 .../cassandra/streaming/StreamReceiveTask.java  |   8 +-
 .../apache/cassandra/db/DirectoriesTest.java| 128 +++
 10 files changed, 252 insertions(+), 105 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 41a5aaf..e008ab9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,7 @@
  * Fix overflow on histogram computation (CASSANDRA-8028)
  * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
  * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
+ * Improve JBOD disk utilization (CASSANDRA-7386)
 Merged from 2.0:
  * Fix some failing queries that use multi-column relations
on COMPACT STORAGE tables (CASSANDRA-8264)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
--
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 7e1dd18..dec5370 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -2240,11 +2240,6 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 return directories.getSnapshotDetails();
 }
 
-public boolean hasUnreclaimedSpace()
-{
-return getLiveDiskSpaceUsed()  getTotalDiskSpaceUsed();
-}
-
 public long getTotalDiskSpaceUsed()
 {
 return metric.totalDiskSpaceUsed.count();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2291a60e/src/java/org/apache/cassandra/db/Directories.java
--
diff --git a/src/java/org/apache/cassandra/db/Directories.java 
b/src/java/org/apache/cassandra/db/Directories.java
index 4319481..eb33bd8 100644
--- a/src/java/org/apache/cassandra/db/Directories.java
+++ b/src/java/org/apache/cassandra/db/Directories.java
@@ -29,8 +29,7 @@ import java.nio.file.Path;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -39,8 +38,6 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
 import com.google.common.collect.Iterables;
-import com.google.common.primitives.Longs;
-import com.google.common.util.concurrent.Uninterruptibles;
 
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -96,7 +93,6 @@ public class Directories
 dataDirectories[i] = new DataDirectory(new File(locations[i]));
 }
 
-
 /**
  * Checks whether Cassandra has RWX permissions to the specified 
directory.  Logs an error with
  * the details if it does not.
@@ -198,7 +194,7 @@ public class Directories
 for (int i = 0; i  dataDirectories.length; ++i)
 {
 // check if old SSTable directory exists
-dataPaths[i] = new File(dataDirectories[i].location, 
join(metadata.ksName, this.metadata.cfName));
+dataPaths[i] = new File(dataDirectories[i].location, 
join(metadata.ksName, metadata.cfName));
 }
 boolean olderDirectoryExists = Iterables.any(Arrays.asList(dataPaths), 
new PredicateFile()
 {
@@ -237,11 +233,10 @@ public class Directories
  */
 public File 

[jira] [Commented] (CASSANDRA-8061) tmplink files are not removed

2014-11-19 Thread Alexander Sterligov (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218721#comment-14218721
 ] 

Alexander Sterligov commented on CASSANDRA-8061:


Answering the questions from CASSANDRA-8248:

Out kernel specialist told that the overcommitment in RES memory is just a 
rounding error, caused by lot's of small mmaped files.

I got this problem on full repair. Repair streamed a lot of small sstables to 
the node (~1000), which were then compacted (32 compactors). All of the 
sstables were finally compacted into 1 (i rised max_threshold), but it didn't 
help at all - still a lot of small mmaped files.


 tmplink files are not removed
 -

 Key: CASSANDRA-8061
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8061
 Project: Cassandra
  Issue Type: Bug
  Components: Core
 Environment: Linux
Reporter: Gianluca Borello
Assignee: Marcus Eriksson
Priority: Critical
 Fix For: 2.1.3

 Attachments: 8248-thread_dump.txt


 After installing 2.1.0, I'm experiencing a bunch of tmplink files that are 
 filling my disk. I found https://issues.apache.org/jira/browse/CASSANDRA-7803 
 and that is very similar, and I confirm it happens both on 2.1.0 as well as 
 from the latest commit on the cassandra-2.1 branch 
 (https://github.com/apache/cassandra/commit/aca80da38c3d86a40cc63d9a122f7d45258e4685
  from the cassandra-2.1)
 Even starting with a clean keyspace, after a few hours I get:
 {noformat}
 $ sudo find /raid0 | grep tmplink | xargs du -hs
 2.7G  
 /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Data.db
 13M   
 /raid0/cassandra/data/draios/protobuf1-ccc6dce04beb11e4abf997b38fbf920b/draios-protobuf1-tmplink-ka-4515-Index.db
 1.8G  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Data.db
 12M   
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-1788-Index.db
 5.2M  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Index.db
 822M  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-2678-Data.db
 7.3M  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Index.db
 1.2G  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3283-Data.db
 6.7M  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Index.db
 1.1G  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-3951-Data.db
 11M   
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Index.db
 1.7G  
 /raid0/cassandra/data/draios/protobuf_by_agent1-cd071a304beb11e4abf997b38fbf920b/draios-protobuf_by_agent1-tmplink-ka-4799-Data.db
 812K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Index.db
 122M  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-208-Data.db
 744K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-739-Index.db
 660K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-193-Index.db
 796K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Index.db
 137M  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-230-Data.db
 161M  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Data.db
 139M  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-234-Data.db
 940K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-786-Index.db
 936K  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-269-Index.db
 161M  
 /raid0/cassandra/data/draios/mounted_fs_by_agent1-d7bf3e304beb11e4abf997b38fbf920b/draios-mounted_fs_by_agent1-tmplink-ka-786-Data.db
 672K  
 

[jira] [Commented] (CASSANDRA-8325) Cassandra 2.1.x fails to start on FreeBSD (JVM crash)

2014-11-19 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218918#comment-14218918
 ] 

graham sanderson commented on CASSANDRA-8325:
-

I don't have FreeBSD, but posting my comment from user thread

{bq}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{bq}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator.
In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}

 Cassandra 2.1.x fails to start on FreeBSD (JVM crash)
 -

 Key: CASSANDRA-8325
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8325
 Project: Cassandra
  Issue Type: Bug
 Environment: FreeBSD 10.0 with openjdk version 1.7.0_71, 64-Bit 
 Server VM
Reporter: Leonid Shalupov
 Attachments: hs_err_pid1856.log, system.log


 See attached error file after JVM crash
 {quote}
 FreeBSD xxx.intellij.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu 
 Jan 16 22:34:59 UTC 2014 
 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 {quote}
 {quote}
  % java -version
 openjdk version 1.7.0_71
 OpenJDK Runtime Environment (build 1.7.0_71-b14)
 OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)
 {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8325) Cassandra 2.1.x fails to start on FreeBSD (JVM crash)

2014-11-19 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218918#comment-14218918
 ] 

graham sanderson edited comment on CASSANDRA-8325 at 11/20/14 2:55 AM:
---

I don't have FreeBSD, but posting my comment from user thread

{quote}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{quote}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator.
In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}


was (Author: graham sanderson):
I don't have FreeBSD, but posting my comment from user thread

{bq}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{bq}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator.
In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}

 Cassandra 2.1.x fails to start on FreeBSD (JVM crash)
 -

 Key: CASSANDRA-8325
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8325
 Project: Cassandra
  Issue Type: Bug
 Environment: FreeBSD 10.0 with openjdk version 1.7.0_71, 64-Bit 
 Server VM
Reporter: Leonid Shalupov
 Attachments: hs_err_pid1856.log, system.log


 See attached error file after JVM crash
 {quote}
 FreeBSD xxx.intellij.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu 
 Jan 16 22:34:59 UTC 2014 
 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 {quote}
 {quote}
  % java -version
 openjdk version 1.7.0_71
 OpenJDK Runtime Environment (build 1.7.0_71-b14)
 OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)
 {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8325) Cassandra 2.1.x fails to start on FreeBSD (JVM crash)

2014-11-19 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218918#comment-14218918
 ] 

graham sanderson edited comment on CASSANDRA-8325 at 11/20/14 2:57 AM:
---

I don't have FreeBSD, but posting my comment from user thread

{quote}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{quote}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator. 
Also IMHO it'd seem a bit bizarre to support sun.misc.Unsafe, but silently not 
implement the methods.

In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}


was (Author: graham sanderson):
I don't have FreeBSD, but posting my comment from user thread

{quote}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{quote}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator.
In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}

 Cassandra 2.1.x fails to start on FreeBSD (JVM crash)
 -

 Key: CASSANDRA-8325
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8325
 Project: Cassandra
  Issue Type: Bug
 Environment: FreeBSD 10.0 with openjdk version 1.7.0_71, 64-Bit 
 Server VM
Reporter: Leonid Shalupov
 Attachments: hs_err_pid1856.log, system.log


 See attached error file after JVM crash
 {quote}
 FreeBSD xxx.intellij.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu 
 Jan 16 22:34:59 UTC 2014 
 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 {quote}
 {quote}
  % java -version
 openjdk version 1.7.0_71
 OpenJDK Runtime Environment (build 1.7.0_71-b14)
 OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)
 {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8325) Cassandra 2.1.x fails to start on FreeBSD (JVM crash)

2014-11-19 Thread graham sanderson (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218918#comment-14218918
 ] 

graham sanderson edited comment on CASSANDRA-8325 at 11/20/14 2:57 AM:
---

I don't have FreeBSD, but posting my comment from user thread

{quote}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{quote}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator. 
Also IMHO it'd seem a bit bizarre to support sun.misc.Unsafe, but silently not 
implement the methods.

In any case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}


was (Author: graham sanderson):
I don't have FreeBSD, but posting my comment from user thread

{quote}
Only thing I can see from looking at the exception, is that it looks like maybe 
the “peer” value in the RefCountedMemory object is probably 0

Given that Unsafe.allocateMemory should not return 0 even on allocation failure 
(it should throw OOM, though you should add a log statement to the Memory class 
to check that) - I’d suggest logging to see if anyone is calling 
SSTableReader.releaseSummary, which could set the peer to 0
{quote}
Note this particular use of sun.misc.Unsafe is new in 2.1, however I thought 
there were others in 2.0. It is possible your JVM doesn't support {{public 
native long Unsafe.allocateMemory(long l);}} and returns 0, though in that case 
you pretty much just need to switch back to the on heap memtable allocator. 
Also IMHO it'd seem a bit bizarre to support sun.misc.Unsafe, but silently not 
implement the methods.

In either case, if you cannot recompile Cassandra for new logging, you can 
certainly write a simple Jave program which calls {{public native long 
allocateMemory(long l);}}

 Cassandra 2.1.x fails to start on FreeBSD (JVM crash)
 -

 Key: CASSANDRA-8325
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8325
 Project: Cassandra
  Issue Type: Bug
 Environment: FreeBSD 10.0 with openjdk version 1.7.0_71, 64-Bit 
 Server VM
Reporter: Leonid Shalupov
 Attachments: hs_err_pid1856.log, system.log


 See attached error file after JVM crash
 {quote}
 FreeBSD xxx.intellij.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu 
 Jan 16 22:34:59 UTC 2014 
 r...@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
 {quote}
 {quote}
  % java -version
 openjdk version 1.7.0_71
 OpenJDK Runtime Environment (build 1.7.0_71-b14)
 OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)
 {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-7386) JBOD threshold to prevent unbalanced disk utilization

2014-11-19 Thread Alan Boudreault (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14218955#comment-14218955
 ] 

Alan Boudreault commented on CASSANDRA-7386:


[~snazy] [~yukim], while doing tests for CASSANDRA-8329, I've noticed an 
important regression related to this patch. I'll give you more info and graphes 
asap tomorrow morning.

 JBOD threshold to prevent unbalanced disk utilization
 -

 Key: CASSANDRA-7386
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7386
 Project: Cassandra
  Issue Type: Improvement
  Components: Core
Reporter: Chris Lohfink
Assignee: Robert Stupp
Priority: Minor
 Fix For: 2.1.3

 Attachments: 7386-2.0-v3.txt, 7386-2.0-v4.txt, 7386-2.0-v5.txt, 
 7386-2.1-v3.txt, 7386-2.1-v4.txt, 7386-2.1-v5.txt, 7386-v1.patch, 
 7386v2.diff, Mappe1.ods, mean-writevalue-7disks.png, 
 patch_2_1_branch_proto.diff, sstable-count-second-run.png, 
 test1_no_patch.jpg, test1_with_patch.jpg, test2_no_patch.jpg, 
 test2_with_patch.jpg, test3_no_patch.jpg, test3_with_patch.jpg


 Currently the pick the disks are picked first by number of current tasks, 
 then by free space.  This helps with performance but can lead to large 
 differences in utilization in some (unlikely but possible) scenarios.  Ive 
 seen 55% to 10% and heard reports of 90% to 10% on IRC.  With both LCS and 
 STCS (although my suspicion is that STCS makes it worse since harder to be 
 balanced).
 I purpose the algorithm change a little to have some maximum range of 
 utilization where it will pick by free space over load (acknowledging it can 
 be slower).  So if a disk A is 30% full and disk B is 5% full it will never 
 pick A over B until it balances out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Chris Lohfink (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Lohfink updated CASSANDRA-8341:
-
Attachment: 8341v2.txt

 Expose time spent in each thread pool
 -

 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor
  Labels: metrics
 Attachments: 8341.patch, 8341v2.txt


 Can increment a counter with time spent in each queue.  This can provide 
 context on how much time is spent percentage wise in each stage.  
 Additionally can be used with littles law in future if ever want to try to 
 tune the size of the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CASSANDRA-8341) Expose time spent in each thread pool

2014-11-19 Thread Chris Lohfink (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14219017#comment-14219017
 ] 

Chris Lohfink commented on CASSANDRA-8341:
--

as reference point, I did a [simplistic 
benchmark|https://gist.github.com/clohfink/9ee94e3767b5d8170220] (on a 2014 
MBP) with JMH of a few scenarios from patch v1:

{code}
BenchmarkMode  Samples  Score   Error   Units
baseline avgt   15   8300.492 ±92.987   ns/op
staticWrap   avgt   15   8438.268 ±   132.177   ns/op
threadlocal  avgt   15   8464.201 ±   161.554   ns/op
wrapped  avgt   15   8424.011 ±   134.407   ns/op
baseline   sample   253749   8197.106 ±16.157   ns/op
staticWrap sample   251910   8233.368 ±14.841   ns/op
threadlocalsample   244075   8540.737 ±   106.365   ns/op
wrappedsample   247083   8443.597 ±99.892   ns/op
baseline   ss   15  49466.667 ±  8039.477  ns
staticWrap ss   15  44466.667 ±  7697.095  ns
threadlocalss   15  52266.667 ± 11679.329  ns
wrappedss   15  6.000 ± 24000.352  ns
{code}

As a v2 I removed the meter, and switched to using currentmiilis instead of 
nanotime (~1/3 speed).  I switched the normal ThreadPool one to just do 
everything in overriden execute.  It wasn't as simple for the SEPExecutor.  
Since I didn't want to break the separation between the JMX SEP and the parent 
SEP by collecting metrics in the SEPWorker so I think keeping the threadlocal 
approach with a before/after execute callback is a little cleaner (match the 
ThreadExecutor api).  With [those 
changes|https://gist.github.com/clohfink/b51eb027c55008377d93]:

{code}
BenchmarkMode  Samples   ScoreError   Units
baseline avgt   158052.932 ± 92.517   ns/op
staticWrap   avgt   158313.957 ±295.964   ns/op
threadlocal  avgt   158553.304 ±189.656   ns/op
wrapped  avgt   158354.060 ±169.359   ns/op
baseline   sample   2528128209.038 ± 14.917   ns/op
staticWrap sample   2486488356.810 ± 15.974   ns/op
threadlocalsample   2473628388.620 ± 17.310   ns/op
wrappedsample   2497848338.419 ± 68.509   ns/op
baseline   ss   15   44933.333 ±   8305.190  ns
staticWrap ss   15   50533.333 ±  13136.009  ns
threadlocalss   15  303600.000 ± 964458.694  ns
wrappedss   15   50066.667 ±   7300.839  ns
{code}

Problem with using ms precision is that a lot of the time it takes less then a 
ms to do a task so it ends up being very below the actual value.  I was 
hesitant to use getCurrentThreadCpuTime as a measure, but its a ns collection 
and much more meaningful then walltime.  Kinda ideal so I [gave it a 
shot|https://gist.github.com/clohfink/50e22ab895a7a700661b] - its 1 little more 
then 1us cost per task execution:

{code}
BenchmarkMode  Samples  Score   Error   Units
baseline avgt   15   8187.818 ±   162.270   ns/op
staticWrap   avgt   15   9585.818 ±   185.490   ns/op
threadlocal  avgt   15   9508.422 ±   166.103   ns/op
wrapped  avgt   15   9380.099 ±   142.239   ns/op
baseline   sample   251564   8259.852 ±30.677   ns/op
staticWrap sample   221622   9365.621 ±19.831   ns/op
threadlocalsample   218599   9521.815 ±33.865   ns/op
wrappedsample   213108   9743.400 ±24.726   ns/op
baseline   ss   15  49333.333 ±  8663.130  ns
staticWrap ss   15  45533.333 ±  9543.739  ns
threadlocalss   15  56933.333 ± 12742.318  ns
wrappedss   15  52800.000 ± 12001.537  ns
{code}

 Expose time spent in each thread pool
 -

 Key: CASSANDRA-8341
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8341
 Project: Cassandra
  Issue Type: New Feature
  Components: Core
Reporter: Chris Lohfink
Priority: Minor
  Labels: metrics
 Attachments: 8341.patch, 8341v2.txt


 Can increment a counter with time spent in each queue.  This can provide 
 context on how much time is spent percentage wise in each stage.  
 Additionally can be used with littles law in future if ever want to try to 
 tune the size of the pools.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CASSANDRA-8253) cassandra-stress 2.1 doesn't support LOCAL_ONE

2014-11-19 Thread Liang Xie (JIRA)

 [ 
https://issues.apache.org/jira/browse/CASSANDRA-8253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Liang Xie reassigned CASSANDRA-8253:


Assignee: Liang Xie

 cassandra-stress 2.1 doesn't support LOCAL_ONE
 --

 Key: CASSANDRA-8253
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8253
 Project: Cassandra
  Issue Type: Bug
Reporter: J.B. Langston
Assignee: Liang Xie

 Looks like a simple oversight in argument parsing:
 ➜  bin  ./cassandra-stress write cl=LOCAL_ONE
 Invalid value LOCAL_ONE; must match pattern 
 ONE|QUORUM|LOCAL_QUORUM|EACH_QUORUM|ALL|ANY
 Also, CASSANDRA-7077 argues that it should be using LOCAL_ONE by default.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)