[jira] [Comment Edited] (CASSANDRA-8940) Inconsistent select count and select distinct

2015-04-14 Thread Frens Jan Rumph (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14492700#comment-14492700
 ] 

Frens Jan Rumph edited comment on CASSANDRA-8940 at 4/15/15 6:42 AM:
-

[~blerer], sorry for the delay ... been a bit busy past few weeks.

I've whipped up a script which should reproduce my problems: 

{code}
import cassandra.cluster
import cassandra.concurrent

import string
import sys


def setup_schema(session):
print("setting up schema")

session.execute("CREATE KEYSPACE IF NOT EXISTS count_test WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': 1};")
session.set_keyspace("count_test")

session.execute("""
CREATE TABLE IF NOT EXISTS tbl (
id text,
bucket bigint,
offset int,
value double,
PRIMARY KEY ((id, bucket), offset)
)
""")


def insert_test_data(session):
# setup parameters for the inserts
ids = string.lowercase[:5]
bucket_count = 10
offset_count = 1

print('inserting data for %s ids, %s buckets and %s offsets' % 
(len(ids), bucket_count, offset_count))

# clear the table
session.execute("TRUNCATE tbl;")

# prepare the insert
insert = session.prepare("INSERT INTO tbl (id, bucket, offset, value) 
VALUES (?, ?, ?, ?)")

# insert a CQL row for each tag, bucket and offset
inserts = [
(insert, (t, b, o, 0))
for t in ids
for b in xrange(bucket_count)
for o in xrange(offset_count)
]
_ = cassandra.concurrent.execute_concurrent(session, inserts)

return len(inserts)


if __name__ == '__main__':
contact_points = sys.argv[1:]
print('connecting to %s' % ', '.join(contact_points))
session = cassandra.cluster.Cluster(contact_points).connect()

try:
setup_schema(session)
inserted = insert_test_data(session)
print("inserted %s rows" % inserted)

for count in (session.execute("SELECT count(*) FROM tbl", 
timeout=120) for _ in range(10)):
print('queried count was %s%s' % (count[0].count, '' if 
count[0].count == inserted else ' (fail)'))
finally:
session.shutdown()
{code}

In my setup this yields (on a particular run):
{code}
setting up schema
inserting data for 5 ids, 10 buckets and 1000 offsets
inserted 5 rows
queried count was 5
queried count was 49396 (fail)
queried count was 49918 (fail)
queried count was 5
queried count was 5
queried count was 5
queried count was 49993 (fail)
queried count was 48997 (fail)
queried count was 49772 (fail)
queried count was 49551 (fail)
{code}

As you can see the counts vary. The number of failures seem to be correlated to 
the number of rows in the cluster. E.g. with only 1000 rows there are no wrong 
counts.

As for my set-up: I'm using a three node cluster (cas-1, cas-2 and cas-3) which 
run on Vagrant + LXC. I planned on writing a script using CCM to be portable, 
but I wasn't able to reproduce the results with CCM! I've tried both Cassandra 
2.1.2 and 2.1.4 with CCM. That was rather disappointing. Or looking at it 
differently ... it might be considered a clue to where things go wrong ...

Any of this ring a bell? Do you perhaps have pointers for me to dig deeper?


was (Author: frensjan):
[~blerer], sorry for the delay ... been a bit busy past few weeks.

I've whipped up a script which should reproduce my problems: 

{code}
import cassandra.cluster
import cassandra.concurrent

import string
import sys


def setup_schema(session):
print("setting up schema")

session.execute("CREATE KEYSPACE IF NOT EXISTS count_test WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': 1};")
session.set_keyspace("count_test")

session.execute("""
CREATE TABLE IF NOT EXISTS tbl (
id text,
bucket bigint,
offset int,
value double,
PRIMARY KEY ((id, bucket), offset)
)
""")


def insert_test_data(session):
# setup parameters for the inserts
ids = string.lowercase[:5]
bucket_count = 10
offset_count = 1000

print('inserting data for %s ids, %s buckets and %s offsets' % 
(len(ids), bucket_count, offset_count))

# clear the table
session.execute("TRUNCATE tbl;")

# prepare the insert
insert = session.prepare("INSERT INTO tbl (id, bucket, offset, value) 
VALUES (?, ?, ?, ?)")

# insert a CQL row for each tag, bucket and offset
   

[jira] [Updated] (CASSANDRA-8940) Inconsistent select count and select distinct

2015-04-14 Thread Frens Jan Rumph (JIRA)

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

Frens Jan Rumph updated CASSANDRA-8940:
---
Attachment: Vagrantfile
setup_hosts.sh
install_cassandra.sh

Great [~blerer]!

As I said before, I had issues reproducing my issue with CCM. The set-up in 
which I could reproduce it was built on Vagrant + LXC ... which I didn't want 
to bother you with ;) So I put some effort in a more general set-up based on 
Vagrant + Virtualbox, see the attached files.

The vagrant file creates a 3 node cluster on CentOS 7 with Cassandra 2.1 (2.1.4 
at the time of writing ... depends on the packaging by datastax, so might bump 
in the future on a new patch version).

At first I thought I had the same issue as with trying to use CCM, but 
apparently I needed to increase the number of rows written from 50k to 500k 
(with 5 ids, 10 buckets each (so 50 partitions) and 100k rows per partition).

Example output from my setup:
{code}
connecting to 192.168.33.11, 192.168.33.12, 192.168.33.13
setting up schema
inserting data for 5 ids, 10 buckets and 1 offsets
inserted 50 rows
queried count was 494495 (fail)
queried count was 493530 (fail)
queried count was 494604 (fail)
queried count was 49 (fail)
queried count was 50
queried count was 494382 (fail)
queried count was 494204 (fail)
queried count was 494625 (fail)
queried count was 50
queried count was 494758 (fail)
{code}

Note that I have slightly modified the script to accept contact points for 
{{cassandra.cluster.Cluster(...)}} and also increased the number of rows 
inserted as mentioned before. So it can be executed with e.g. {{python2 test.py 
192.168.33.11 192.168.33.12 192.168.33.13}}

I haven't had the time do something like a proper sweep of the variables, but I 
tried a configuration with 5 ids, 1 bucket per id (so 5 unique partition keys) 
and 100k rows per partition which also seems to fail, but in a perhaps 
interesting different way, for example:

{code}
setting up schema
inserting data for 5 ids, 1 buckets and 10 offsets
inserted 50 rows
queried count was 50
queried count was 50
queried count was 403172 (fail)
queried count was 50
queried count was 50
queried count was 302821 (fail)
queried count was 50
queried count was 50
queried count was 304049 (fail)
queried count was 50
{code}

With 5 ids, 100 bucket per id and 1k rows per partition - in my set-up - things 
do seem to pan out better, only one failure out of ten (in a particular run):
{code}
connecting to 192.168.33.11, 192.168.33.12, 192.168.33.13
setting up schema
inserting data for 5 ids, 100 buckets and 1000 offsets
inserted 50 rows
queried count was 50
queried count was 50
queried count was 50
queried count was 50
queried count was 50
queried count was 498740 (fail)
queried count was 50
queried count was 50
queried count was 50
queried count was 50
{code}

> Inconsistent select count and select distinct
> -
>
> Key: CASSANDRA-8940
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8940
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: 2.1.2
>Reporter: Frens Jan Rumph
>Assignee: Benjamin Lerer
> Attachments: Vagrantfile, install_cassandra.sh, setup_hosts.sh
>
>
> When performing {{select count( * ) from ...}} I expect the results to be 
> consistent over multiple query executions if the table at hand is not written 
> to / deleted from in the mean time. However, in my set-up it is not. The 
> counts returned vary considerable (several percent). The same holds for 
> {{select distinct partition-key-columns from ...}}.
> I have a table in a keyspace with replication_factor = 1 which is something 
> like:
> {code}
> CREATE TABLE tbl (
> id frozen,
> bucket bigint,
> offset int,
> value double,
> PRIMARY KEY ((id, bucket), offset)
> )
> {code}
> The frozen udt is:
> {code}
> CREATE TYPE id_type (
> tags map
> );
> {code}
> The table contains around 35k rows (I'm not trying to be funny here ...). The 
> consistency level for the queries was ONE.



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


[jira] [Commented] (CASSANDRA-9184) sstable.CorruptSSTableException

2015-04-14 Thread Relish Chackochan (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495649#comment-14495649
 ] 

Relish Chackochan commented on CASSANDRA-9184:
--

Thank You for the response.

Can you help me to identify the issue ( tools, commands ) , The servers are 
running on production environment.

> sstable.CorruptSSTableException
> ---
>
> Key: CASSANDRA-9184
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9184
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Apache Cassandra 1.2.16 on RHEL 6.5
>Reporter: Relish Chackochan
>
> We have 8 node Cassandra cluster with 1.2.16 version (  RHEL 6.5 64-bit ) on 
> Vmware ESXi server and having SSTable Corrupt Error facing frequently on 
> multiple columfamily. Using "nodetol scrub" i am able to resolve the issue. i 
> would like to know why this is happening frequently. is this related to any 
> configuration parameters or VMware related issue.
> Can someone help on this.
> org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
> dataSize of 3691036590893839668 starting at 362204813 would be larger than 
> file /opt/lib
> /cassandra/data/X/XX/-X-ic-1144-Data.db length 486205378



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


[jira] [Commented] (CASSANDRA-7212) Allow to switch user within CQLSH session

2015-04-14 Thread Sachin Janani (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495624#comment-14495624
 ] 

Sachin Janani commented on CASSANDRA-7212:
--

[~carlyeks] ^^^


> Allow to switch user within CQLSH session
> -
>
> Key: CASSANDRA-7212
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7212
> Project: Cassandra
>  Issue Type: Improvement
>  Components: API
> Environment: [cqlsh 4.1.1 | Cassandra 2.0.7.31 | CQL spec 3.1.1 | 
> Thrift protocol 19.39.0]
>Reporter: Jose Martinez Poblete
>  Labels: cqlsh
> Attachments: 7212_1.patch, 7212_v2.patch
>
>
> Once a user is logged into CQLSH, it is not possible to switch to another 
> user  without exiting and relaunch
> This is a feature offered in postgres and probably other databases:
> http://secure.encivasolutions.com/knowledgebase.php?action=displayarticle&id=1126
>  
> Perhaps this could be implemented on CQLSH as part of the "USE" directive:
> USE  [USER] [password] 



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


cassandra git commit: remove extraneous @Override javadoc 'tag'

2015-04-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk b38a6683f -> e502fe5b1


remove extraneous @Override javadoc 'tag'


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

Branch: refs/heads/trunk
Commit: e502fe5b1bf2020936197ed1953f9e3023c7d85a
Parents: b38a668
Author: Dave Brosius 
Authored: Wed Apr 15 00:02:57 2015 -0400
Committer: Dave Brosius 
Committed: Wed Apr 15 00:02:57 2015 -0400

--
 src/java/org/apache/cassandra/auth/DataResource.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e502fe5b/src/java/org/apache/cassandra/auth/DataResource.java
--
diff --git a/src/java/org/apache/cassandra/auth/DataResource.java 
b/src/java/org/apache/cassandra/auth/DataResource.java
index d2bc8fb..f64ed93 100644
--- a/src/java/org/apache/cassandra/auth/DataResource.java
+++ b/src/java/org/apache/cassandra/auth/DataResource.java
@@ -191,7 +191,6 @@ public class DataResource implements IResource
 }
 
 /**
- @Override
  * @return column family of the resource. Throws IllegalStateException if 
it's not a table-level resource.
  */
 public String getTable()



cassandra git commit: remove dead fields

2015-04-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 700e3279e -> b38a6683f


remove dead fields


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

Branch: refs/heads/trunk
Commit: b38a6683f97abeef64cee8f45e05c90e1db2e8df
Parents: 700e327
Author: Dave Brosius 
Authored: Tue Apr 14 21:43:53 2015 -0400
Committer: Dave Brosius 
Committed: Tue Apr 14 21:43:53 2015 -0400

--
 src/java/org/apache/cassandra/cql3/ColumnCondition.java | 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b38a6683/src/java/org/apache/cassandra/cql3/ColumnCondition.java
--
diff --git a/src/java/org/apache/cassandra/cql3/ColumnCondition.java 
b/src/java/org/apache/cassandra/cql3/ColumnCondition.java
index dcd8bca..921a073 100644
--- a/src/java/org/apache/cassandra/cql3/ColumnCondition.java
+++ b/src/java/org/apache/cassandra/cql3/ColumnCondition.java
@@ -481,7 +481,6 @@ public class ColumnCondition
 static class CollectionBound extends Bound
 {
 private final Term.Terminal value;
-private final QueryOptions options;
 
 private CollectionBound(ColumnCondition condition, QueryOptions 
options) throws InvalidRequestException
 {
@@ -489,7 +488,6 @@ public class ColumnCondition
 assert column.type.isCollection() && condition.collectionElement 
== null;
 assert condition.operator != Operator.IN;
 this.value = condition.value.bind(options);
-this.options = options;
 }
 
 public boolean appliesTo(Composite rowPrefix, ColumnFamily current, 
final long now) throws InvalidRequestException
@@ -643,14 +641,12 @@ public class ColumnCondition
 public static class CollectionInBound extends Bound
 {
 private final List inValues;
-private final QueryOptions options;
 
 private CollectionInBound(ColumnCondition condition, QueryOptions 
options) throws InvalidRequestException
 {
 super(condition.column, condition.operator);
 assert column.type instanceof CollectionType && 
condition.collectionElement == null;
 assert condition.operator == Operator.IN;
-this.options = options;
 inValues = new ArrayList<>();
 if (condition.inValues == null)
 {



[jira] [Commented] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495515#comment-14495515
 ] 

Jonathan Ellis commented on CASSANDRA-9191:
---

It's already logged at debug.

{code}
if (Tracing.isTracing())
{
Tracing.trace("{}; received {} of {} responses{}",
  isTimeout ? "Timed out" : "Failed", 
responseCount, blockFor, gotData);
}
else if (logger.isDebugEnabled())
{
logger.debug("Read {}; received {} of {} responses{}", 
(isTimeout ? "timeout" : "failure"), responseCount, blockFor, gotData);
}
{code}

And yes, debug gives you way too much stuff, but that's exactly the problem 
Brandon called out.  There's no way around it when everyone wants different 
niche pieces of info logged.

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Commented] (CASSANDRA-9193) Facility to write dynamic code to selectively trigger trace or log for queries

2015-04-14 Thread Jon Haddad (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495458#comment-14495458
 ] 

Jon Haddad commented on CASSANDRA-9193:
---

Going on record as loving this idea.  

> Facility to write dynamic code to selectively trigger trace or log for queries
> --
>
> Key: CASSANDRA-9193
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9193
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Matt Stump
>
> I want the equivalent of dtrace for Cassandra. I want the ability to 
> intercept a query with a dynamic script (assume JS) and based on logic in 
> that script trigger the statement for trace or logging. 
> Examples 
> - Trace only INSERT statements to a particular CF. 
> - Trace statements for a particular partition or consistency level.
> - Log statements that fail to reach the desired consistency for read or write.
> - Log If the request size for read or write exceeds some threshold
> At some point in the future it would be helpful to also do things such as log 
> partitions greater than X bytes or Z cells when performing compaction. 
> Essentially be able to inject custom code dynamically without a reboot to the 
> different stages of C*. 
> The code should be executed synchronously as part of the monitored task, but 
> we should provide the ability to log or execute CQL asynchronously from the 
> provided API.
> Further down the line we could use this functionality to modify/rewrite 
> requests or tasks dynamically.



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


[jira] [Commented] (CASSANDRA-9193) Facility to write dynamic code to selectively trigger trace or log for queries

2015-04-14 Thread Patrick McFadin (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495451#comment-14495451
 ] 

Patrick McFadin commented on CASSANDRA-9193:


I don't think this is too far away from CASSANDRA-7526 with addition of 
metadata. 

I have used something similar on F5 network appliances in a feature called 
iRules. It was a feature to run a trigger based on a network event. My favorite 
part was how the user specified actions. You assigned a rule to a network port 
and wrote a collection of actions on events. If I were to translate that to a 
Cassandra use case, you would assign a rule set to a Table. Inside the rule set 
would be actions on events. Something like this pseudo code:

{
   onRequest {
  if(consistencyLevel == ALL) {
 log.WARN ("Dude. Seriously?")
  }
   }

   onResponse {
  if (consistencyError) {
 ...do something...
  }

  if (data.size > 50) {
 log.WARN ("Dude. Seriously?")
  }
   }
}

Not proposing syntax but you get the idea. Could be a very powerful tool for 
troubleshooting and insight. 



> Facility to write dynamic code to selectively trigger trace or log for queries
> --
>
> Key: CASSANDRA-9193
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9193
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Matt Stump
>
> I want the equivalent of dtrace for Cassandra. I want the ability to 
> intercept a query with a dynamic script (assume JS) and based on logic in 
> that script trigger the statement for trace or logging. 
> Examples 
> - Trace only INSERT statements to a particular CF. 
> - Trace statements for a particular partition or consistency level.
> - Log statements that fail to reach the desired consistency for read or write.
> - Log If the request size for read or write exceeds some threshold
> At some point in the future it would be helpful to also do things such as log 
> partitions greater than X bytes or Z cells when performing compaction. 
> Essentially be able to inject custom code dynamically without a reboot to the 
> different stages of C*. 
> The code should be executed synchronously as part of the monitored task, but 
> we should provide the ability to log or execute CQL asynchronously from the 
> provided API.
> Further down the line we could use this functionality to modify/rewrite 
> requests or tasks dynamically.



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


[jira] [Comment Edited] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Matt Stump (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495166#comment-14495166
 ] 

Matt Stump edited comment on CASSANDRA-9191 at 4/14/15 11:49 PM:
-

Histograms don't provide the data granularity I'm looking for. I want the 
actual statement. I was on a call today where I'm told "statements are failing 
due to consistency failure" and I'm given no access to developers or access to 
code. I'm ok with the feature being off by default as long as I can turn it on 
via nodetool. Either that or give me the swiss army knife that is 
CASSANDRA-9193.


was (Author: mstump):
Histograms don't provide the data granularity I'm looking for. I want the 
actual statement. I was on a call today where I'm told "statements are failing 
due to consistency failure" and I'm given no access to developers or access to 
code. I'm ok with the feature being off by default as long as I can turn it on 
via nodetool. Either that or give me the swiss army knife that is #9193.

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Commented] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Matt Stump (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495166#comment-14495166
 ] 

Matt Stump commented on CASSANDRA-9191:
---

Histograms don't provide the data granularity I'm looking for. I want the 
actual statement. I was on a call today where I'm told "statements are failing 
due to consistency failure" and I'm given no access to developers or access to 
code. I'm ok with the feature being off by default as long as I can turn it on 
via nodetool. Either that or give me the swiss army knife that is #9193.

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Commented] (CASSANDRA-9193) Facility to write dynamic code to selectively trigger trace or log for queries

2015-04-14 Thread Albert P Tobey (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495157#comment-14495157
 ] 

Albert P Tobey commented on CASSANDRA-9193:
---

Javascript makes sense since Nashorn ships with Java 8. No dependencies to add 
to C*.

Looks like you can get at a lot of the stuff we'd need as soon as a REPL or 
some way to run scripts is available:
http://moduscreate.com/javascript-and-the-jvm/

> Facility to write dynamic code to selectively trigger trace or log for queries
> --
>
> Key: CASSANDRA-9193
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9193
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: Matt Stump
>
> I want the equivalent of dtrace for Cassandra. I want the ability to 
> intercept a query with a dynamic script (assume JS) and based on logic in 
> that script trigger the statement for trace or logging. 
> Examples 
> - Trace only INSERT statements to a particular CF. 
> - Trace statements for a particular partition or consistency level.
> - Log statements that fail to reach the desired consistency for read or write.
> - Log If the request size for read or write exceeds some threshold
> At some point in the future it would be helpful to also do things such as log 
> partitions greater than X bytes or Z cells when performing compaction. 
> Essentially be able to inject custom code dynamically without a reboot to the 
> different stages of C*. 
> The code should be executed synchronously as part of the monitored task, but 
> we should provide the ability to log or execute CQL asynchronously from the 
> provided API.
> Further down the line we could use this functionality to modify/rewrite 
> requests or tasks dynamically.



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


[jira] [Commented] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495142#comment-14495142
 ] 

Brandon Williams commented on CASSANDRA-9191:
-

Pretty much.  Jonathan suggested a histogram which sounds good to me.

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Comment Edited] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Ryan Svihla (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495136#comment-14495136
 ] 

Ryan Svihla edited comment on CASSANDRA-9191 at 4/14/15 11:25 PM:
--

JMX counter at least maybe (or is that what you mean by 'expose' ?


was (Author: rssvihla):
JMX counter maybe?

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Commented] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Ryan Svihla (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495136#comment-14495136
 ] 

Ryan Svihla commented on CASSANDRA-9191:


JMX counter maybe?

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


[jira] [Created] (CASSANDRA-9193) Facility to write dynamic code to selectively trigger trace or log for queries

2015-04-14 Thread Matt Stump (JIRA)
Matt Stump created CASSANDRA-9193:
-

 Summary: Facility to write dynamic code to selectively trigger 
trace or log for queries
 Key: CASSANDRA-9193
 URL: https://issues.apache.org/jira/browse/CASSANDRA-9193
 Project: Cassandra
  Issue Type: New Feature
Reporter: Matt Stump


I want the equivalent of dtrace for Cassandra. I want the ability to intercept 
a query with a dynamic script (assume JS) and based on logic in that script 
trigger the statement for trace or logging. 

Examples 
- Trace only INSERT statements to a particular CF. 
- Trace statements for a particular partition or consistency level.
- Log statements that fail to reach the desired consistency for read or write.
- Log If the request size for read or write exceeds some threshold

At some point in the future it would be helpful to also do things such as log 
partitions greater than X bytes or Z cells when performing compaction. 
Essentially be able to inject custom code dynamically without a reboot to the 
different stages of C*. 

The code should be executed synchronously as part of the monitored task, but we 
should provide the ability to log or execute CQL asynchronously from the 
provided API.

Further down the line we could use this functionality to modify/rewrite 
requests or tasks dynamically.



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


[jira] [Commented] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495120#comment-14495120
 ] 

Brandon Williams commented on CASSANDRA-9191:
-

I'm not against exposing this, but I am against logging it.  Someone is going 
to get into a situation where this is happening a lot, the logs are going to 
dominate the cpu and cause more timeouts, which means more logging of these 
"errors."

> Log and count failure to obtain requested consistency
> -
>
> Key: CASSANDRA-9191
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Matt Stump
>
> Cassandra should have a way to log failed requests due to failure to obtain 
> requested consistency. This should be logged as error or warning by default. 
> Also exposed should be a counter for the benefit of opscenter. 
> Currently the only way to log this is at the client. Often the application 
> and DB teams are separate and it's very difficult to obtain client logs. Also 
> because it's only visible to the client no visibility is given to opscenter 
> making it difficult for the field to track down or isolate systematic or node 
> level errors.



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


cassandra git commit: Merge branch 'cassandra-2.1' into trunk Allow takeColumnFamilySnapshot to take a list of tables patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348 (fixup for NodeT

2015-04-14 Thread dbrosius
Repository: cassandra
Updated Branches:
  refs/heads/trunk 2e4c7a5a7 -> 700e3279e


Merge branch 'cassandra-2.1' into trunk
Allow takeColumnFamilySnapshot to take a list of tables
patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348
(fixup for NodeTool commands moving out to top level classes)


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

Branch: refs/heads/trunk
Commit: 700e3279e68c9c72d50e821a855cae38b5e5b169
Parents: 2e4c7a5
Author: Dave Brosius 
Authored: Tue Apr 14 19:13:53 2015 -0400
Committer: Dave Brosius 
Committed: Tue Apr 14 19:13:53 2015 -0400

--
 src/java/org/apache/cassandra/tools/nodetool/Snapshot.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/700e3279/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
--
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java 
b/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
index d2eab9a..14c14ad 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
@@ -42,7 +42,7 @@ public class Snapshot extends NodeToolCmd
 @Option(title = "tag", name = {"-t", "--tag"}, description = "The name of 
the snapshot")
 private String snapshotName = Long.toString(System.currentTimeMillis());
 
-@Option(title = "kclist", name = { "-kc", "--kc-list" }, description = 
"The list of Keyspace.Column family to take snapshot.(you must not specify only 
keyspace)")
+@Option(title = "ktlist", name = { "-kc", "--kc.list", "-kt", "--kt-list" 
}, description = "The list of Keyspace.table to take snapshot.(you must not 
specify only keyspace)")
 private String kcList = null;
 
 @Override
@@ -53,6 +53,7 @@ public class Snapshot extends NodeToolCmd
 StringBuilder sb = new StringBuilder();
 
 sb.append("Requested creating snapshot(s) for ");
+
 // Create a separate path for kclist to avoid breaking of already 
existing scripts
 if (null != kcList && !kcList.isEmpty())
 {



[jira] [Updated] (CASSANDRA-8413) Bloom filter false positive ratio is not honoured

2015-04-14 Thread Benedict (JIRA)

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

Benedict updated CASSANDRA-8413:

Reviewer: Benedict

> Bloom filter false positive ratio is not honoured
> -
>
> Key: CASSANDRA-8413
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8413
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Benedict
>Assignee: Robert Stupp
> Fix For: 3.0
>
> Attachments: 8413-patch.txt, 8413.hack-3.0.txt, 8413.hack.txt
>
>
> Whilst thinking about CASSANDRA-7438 and hash bits, I realised we have a 
> problem with sabotaging our bloom filters when using the murmur3 partitioner. 
> I have performed a very quick test to confirm this risk is real.
> Since a typical cluster uses the same murmur3 hash for partitioning as we do 
> for bloom filter lookups, and we own a contiguous range, we can guarantee 
> that the top X bits collide for all keys on the node. This translates into 
> poor bloom filter distribution. I quickly hacked LongBloomFilterTest to 
> simulate the problem, and the result in these tests is _up to_ a doubling of 
> the actual false positive ratio. The actual change will depend on the key 
> distribution, the number of keys, the false positive ratio, the number of 
> nodes, the token distribution, etc. But seems to be a real problem for 
> non-vnode clusters of at least ~128 nodes in size.



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


[jira] [Commented] (CASSANDRA-7384) Collect metrics on queries by consistency level

2015-04-14 Thread Matt Stump (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495086#comment-14495086
 ] 

Matt Stump commented on CASSANDRA-7384:
---

Requesting reopen. It's pretty common that a customer uses an incorrect 
consistency level for their environment. I have to go and manually check each 
statement in their code. This is time consuming and their are often multiple 
apps written by multiple teams which may or may not be on speaking terms with 
the DB team which owns the DB. The counters would be helpful as a quick sanity 
check to know whether I need to try and find bad actors. Scenarios where this 
would be helpful are people writing at ALL, or QUORUM in a multi-dc arrangement.

> Collect metrics on queries by consistency level
> ---
>
> Key: CASSANDRA-7384
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7384
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Core
>Reporter: Vishy Kasar
>Assignee: sankalp kohli
>Priority: Minor
> Fix For: 2.0.13
>
>
> We had cases where cassandra client users thought that they were doing 
> queries at one consistency level but turned out to be not correct. It will be 
> good to collect metrics on number of queries done at various consistency 
> level on the server. See the equivalent JIRA on java driver: 
> https://datastax-oss.atlassian.net/browse/JAVA-354



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


[jira] [Created] (CASSANDRA-9192) Tuple columns with UDTs not updated when the UDT is altered

2015-04-14 Thread Tyler Hobbs (JIRA)
Tyler Hobbs created CASSANDRA-9192:
--

 Summary: Tuple columns with UDTs not updated when the UDT is 
altered
 Key: CASSANDRA-9192
 URL: https://issues.apache.org/jira/browse/CASSANDRA-9192
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Tyler Hobbs
Assignee: Tyler Hobbs
Priority: Minor
 Fix For: 2.1.5


When a tuple column contains a UDT and the UDT is altered, we do not update the 
tuple column:
{noformat}
cqlsh> create keyspace ks1 WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '1' };
cqlsh> create type ks1.foo (a int, b int);
cqlsh> create table ks1.mytable (a int primary key, b frozen>);
cqlsh> insert into ks1.mytable (a, b) VALUES (1, (1, {a: 1, b: 1}));
cqlsh> alter type ks1.foo ADD c int;
cqlsh> insert into ks1.mytable (a, b) VALUES (1, (1, {a: 1, b: 1}));
cqlsh> insert into ks1.mytable (a, b) VALUES (1, (1, {a: 1, b: 1, c: 1}));
InvalidRequest: code=2200 [Invalid query] message="Unknown field 'c' in value 
of user defined type foo"
{noformat}



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


[jira] [Created] (CASSANDRA-9191) Log and count failure to obtain requested consistency

2015-04-14 Thread Matt Stump (JIRA)
Matt Stump created CASSANDRA-9191:
-

 Summary: Log and count failure to obtain requested consistency
 Key: CASSANDRA-9191
 URL: https://issues.apache.org/jira/browse/CASSANDRA-9191
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Matt Stump


Cassandra should have a way to log failed requests due to failure to obtain 
requested consistency. This should be logged as error or warning by default. 
Also exposed should be a counter for the benefit of opscenter. 

Currently the only way to log this is at the client. Often the application and 
DB teams are separate and it's very difficult to obtain client logs. Also 
because it's only visible to the client no visibility is given to opscenter 
making it difficult for the field to track down or isolate systematic or node 
level errors.



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


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

2015-04-14 Thread tylerhobbs
Merge branch 'cassandra-2.1' into trunk

Conflicts:
CHANGES.txt


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

Branch: refs/heads/trunk
Commit: 2e4c7a5a7ebccd288c803477e5d35f78e5f511b9
Parents: d383f5c ca07614
Author: Tyler Hobbs 
Authored: Tue Apr 14 17:43:45 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 17:43:45 2015 -0500

--
 CHANGES.txt |  2 +
 .../cql3/statements/AlterTypeStatement.java | 43 +---
 .../apache/cassandra/cql3/UserTypesTest.java| 40 --
 3 files changed, 59 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e4c7a5a/CHANGES.txt
--
diff --cc CHANGES.txt
index a8c1eb0,7ebaa89..7f87a88
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,101 -1,6 +1,103 @@@
 +3.0
 + * Add user/role permissions for user-defined functions (CASSANDRA-7557)
 + * Allow cassandra config to be updated to restart daemon without unloading 
classes (CASSANDRA-9046)
 + * Don't initialize compaction writer before checking if iter is empty 
(CASSANDRA-9117)
 + * Remove line number generation from default logback.xml
 + * Don't execute any functions at prepare-time (CASSANDRA-9037)
 + * Share file handles between all instances of a SegmentedFile 
(CASSANDRA-8893)
 + * Make it possible to major compact LCS (CASSANDRA-7272)
 + * Make FunctionExecutionException extend RequestExecutionException
 +   (CASSANDRA-9055)
 + * Add support for SELECT JSON, INSERT JSON syntax and new toJson(), 
fromJson()
 +   functions (CASSANDRA-7970)
 + * Optimise max purgeable timestamp calculation in compaction (CASSANDRA-8920)
 + * Constrain internode message buffer sizes, and improve IO class hierarchy 
(CASSANDRA-8670) 
 + * New tool added to validate all sstables in a node (CASSANDRA-5791)
 + * Push notification when tracing completes for an operation (CASSANDRA-7807)
 + * Delay "node up" and "node added" notifications until native protocol 
server is started (CASSANDRA-8236)
 + * Compressed Commit Log (CASSANDRA-6809)
 + * Optimise IntervalTree (CASSANDRA-8988)
 + * Add a key-value payload for third party usage (CASSANDRA-8553)
 + * Bump metrics-reporter-config dependency for metrics 3.0 (CASSANDRA-8149)
 + * Partition intra-cluster message streams by size, not type (CASSANDRA-8789)
 + * Add WriteFailureException to native protocol, notify coordinator of
 +   write failures (CASSANDRA-8592)
 + * Convert SequentialWriter to nio (CASSANDRA-8709)
 + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 
8761, 8850)
 + * Record client ip address in tracing sessions (CASSANDRA-8162)
 + * Indicate partition key columns in response metadata for prepared
 +   statements (CASSANDRA-7660)
 + * Merge UUIDType and TimeUUIDType parse logic (CASSANDRA-8759)
 + * Avoid memory allocation when searching index summary (CASSANDRA-8793)
 + * Optimise (Time)?UUIDType Comparisons (CASSANDRA-8730)
 + * Make CRC32Ex into a separate maven dependency (CASSANDRA-8836)
 + * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
 + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
 + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
 + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order and ignore duplicate values in partition key IN 
restrictions (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsi

[1/2] cassandra git commit: Don't check other keyspaces when a UDT is altered

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk d383f5cb2 -> 2e4c7a5a7


Don't check other keyspaces when a UDT is altered

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


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

Branch: refs/heads/trunk
Commit: ca076140472bfde1209423946441f1bd5a35efc1
Parents: f1115cf
Author: blerer 
Authored: Tue Apr 14 17:42:06 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 17:43:06 2015 -0500

--
 CHANGES.txt |  2 +
 .../cql3/statements/AlterTypeStatement.java | 43 +---
 .../apache/cassandra/cql3/UserTypesTest.java| 40 --
 3 files changed, 59 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca076140/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c3e6c6c..7ebaa89 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.5
+ * Don't check other keyspaces for schema changes when an user-defined
+   type is altered (CASSANDRA-9187)
  * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
  * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
  * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca076140/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
index 576011f..64e7627 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
@@ -106,33 +106,30 @@ public abstract class AlterTypeStatement extends 
SchemaAlteringStatement
 // but we also need to find all existing user types and CF using it 
and change them.
 MigrationManager.announceTypeUpdate(updated, isLocalOnly);
 
-for (KSMetaData ksm2 : Schema.instance.getKeyspaceDefinitions())
+for (CFMetaData cfm : ksm.cfMetaData().values())
 {
-for (CFMetaData cfm : ksm2.cfMetaData().values())
-{
-CFMetaData copy = cfm.copy();
-boolean modified = false;
-for (ColumnDefinition def : copy.allColumns())
-modified |= updateDefinition(copy, def, toUpdate.keyspace, 
toUpdate.name, updated);
-if (modified)
-MigrationManager.announceColumnFamilyUpdate(copy, false, 
isLocalOnly);
-}
+CFMetaData copy = cfm.copy();
+boolean modified = false;
+for (ColumnDefinition def : copy.allColumns())
+modified |= updateDefinition(copy, def, toUpdate.keyspace, 
toUpdate.name, updated);
+if (modified)
+MigrationManager.announceColumnFamilyUpdate(copy, false, 
isLocalOnly);
+}
 
-// Other user types potentially using the updated type
-for (UserType ut : ksm2.userTypes.getAllTypes().values())
+// Other user types potentially using the updated type
+for (UserType ut : ksm.userTypes.getAllTypes().values())
+{
+// Re-updating the type we've just updated would be harmless but 
useless so we avoid it.
+// Besides, we use the occasion to drop the old version of the 
type if it's a type rename
+if (ut.keyspace.equals(toUpdate.keyspace) && 
ut.name.equals(toUpdate.name))
 {
-// Re-updating the type we've just updated would be harmless 
but useless so we avoid it.
-// Besides, we use the occasion to drop the old version of the 
type if it's a type rename
-if (ut.keyspace.equals(toUpdate.keyspace) && 
ut.name.equals(toUpdate.name))
-{
-if (!ut.keyspace.equals(updated.keyspace) || 
!ut.name.equals(updated.name))
-MigrationManager.announceTypeDrop(ut);
-continue;
-}
-AbstractType upd = updateWith(ut, toUpdate.keyspace, 
toUpdate.name, updated);
-if (upd != null)
-MigrationManager.announceTypeUpdate((UserType)upd, 
isLocalOnly);
+if (!ut.keyspace.equals(updated.keyspace) || 
!ut.name.equals(updated.name))
+MigrationManager.ann

cassandra git commit: Don't check other keyspaces when a UDT is altered

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 f1115cfdf -> ca0761404


Don't check other keyspaces when a UDT is altered

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


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

Branch: refs/heads/cassandra-2.1
Commit: ca076140472bfde1209423946441f1bd5a35efc1
Parents: f1115cf
Author: blerer 
Authored: Tue Apr 14 17:42:06 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 17:43:06 2015 -0500

--
 CHANGES.txt |  2 +
 .../cql3/statements/AlterTypeStatement.java | 43 +---
 .../apache/cassandra/cql3/UserTypesTest.java| 40 --
 3 files changed, 59 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca076140/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c3e6c6c..7ebaa89 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.5
+ * Don't check other keyspaces for schema changes when an user-defined
+   type is altered (CASSANDRA-9187)
  * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
  * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
  * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca076140/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
index 576011f..64e7627 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
@@ -106,33 +106,30 @@ public abstract class AlterTypeStatement extends 
SchemaAlteringStatement
 // but we also need to find all existing user types and CF using it 
and change them.
 MigrationManager.announceTypeUpdate(updated, isLocalOnly);
 
-for (KSMetaData ksm2 : Schema.instance.getKeyspaceDefinitions())
+for (CFMetaData cfm : ksm.cfMetaData().values())
 {
-for (CFMetaData cfm : ksm2.cfMetaData().values())
-{
-CFMetaData copy = cfm.copy();
-boolean modified = false;
-for (ColumnDefinition def : copy.allColumns())
-modified |= updateDefinition(copy, def, toUpdate.keyspace, 
toUpdate.name, updated);
-if (modified)
-MigrationManager.announceColumnFamilyUpdate(copy, false, 
isLocalOnly);
-}
+CFMetaData copy = cfm.copy();
+boolean modified = false;
+for (ColumnDefinition def : copy.allColumns())
+modified |= updateDefinition(copy, def, toUpdate.keyspace, 
toUpdate.name, updated);
+if (modified)
+MigrationManager.announceColumnFamilyUpdate(copy, false, 
isLocalOnly);
+}
 
-// Other user types potentially using the updated type
-for (UserType ut : ksm2.userTypes.getAllTypes().values())
+// Other user types potentially using the updated type
+for (UserType ut : ksm.userTypes.getAllTypes().values())
+{
+// Re-updating the type we've just updated would be harmless but 
useless so we avoid it.
+// Besides, we use the occasion to drop the old version of the 
type if it's a type rename
+if (ut.keyspace.equals(toUpdate.keyspace) && 
ut.name.equals(toUpdate.name))
 {
-// Re-updating the type we've just updated would be harmless 
but useless so we avoid it.
-// Besides, we use the occasion to drop the old version of the 
type if it's a type rename
-if (ut.keyspace.equals(toUpdate.keyspace) && 
ut.name.equals(toUpdate.name))
-{
-if (!ut.keyspace.equals(updated.keyspace) || 
!ut.name.equals(updated.name))
-MigrationManager.announceTypeDrop(ut);
-continue;
-}
-AbstractType upd = updateWith(ut, toUpdate.keyspace, 
toUpdate.name, updated);
-if (upd != null)
-MigrationManager.announceTypeUpdate((UserType)upd, 
isLocalOnly);
+if (!ut.keyspace.equals(updated.keyspace) || 
!ut.name.equals(updated.name))
+Migr

[jira] [Commented] (CASSANDRA-9139) LeveledCompactionStrategyTest failing in test-compression target

2015-04-14 Thread Tyler Hobbs (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14495013#comment-14495013
 ] 

Tyler Hobbs commented on CASSANDRA-9139:


+1 with a small nit: there are unneeded curly braces around the single-line 
for-loop in SSTable.java

> LeveledCompactionStrategyTest failing in test-compression target
> 
>
> Key: CASSANDRA-9139
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9139
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tests
>Reporter: Philip Thompson
>Assignee: Marcus Eriksson
> Fix For: 2.0.15
>
> Attachments: 0001-9139.patch
>
>
> {{org.apache.cassandra.db.compaction.LeveledCompactionStrategyTest.testValidationMultipleSSTablePerLevel}}
>  and 
> {{org.apache.cassandra.db.compaction.LeveledCompactionStrategyTest.testCompactionProgress}}
>  are both failing in the test-compression target.
> I tried bisecting, but was not able to find a time that they passed. 
> Reproduce with {{ant test-compression 
> -Dtest.name=LeveledCompactionStrategyTest}}



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


[jira] [Assigned] (CASSANDRA-9190) Map keys aren’t properly serialized as strings in SELECT JSON queries

2015-04-14 Thread Brandon Williams (JIRA)

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

Brandon Williams reassigned CASSANDRA-9190:
---

Assignee: Tyler Hobbs

> Map keys aren’t properly serialized as strings in SELECT JSON queries
> -
>
> Key: CASSANDRA-9190
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9190
> Project: Cassandra
>  Issue Type: Bug
>  Components: API
>Reporter: Gianluca Righetto
>Assignee: Tyler Hobbs
>
> When I run a SELECT JSON query on a table that contains a column of type map, 
> the JSON output doesn’t wrap the map keys with quotes, thus creating a 
> non-standard JSON representation, which doesn’t play along with JSON parsers 
> very well. 
> Here’s an example where the map keys are actually a set:
> {code}
> create table table1 (id int primary key, mymap map>,int>);
> insert into table1 (id,mymap) values (1, {{1,2,3,4}:1});
> select json id,mymap from table1;
> {code}
> The output is:
> {noformat}
> {"id": 1, "mymap": {[1, 2, 3, 4]: 1}}
> {noformat}
> But what I expected was that the map key, in this case the entire integer 
> set, would be wrapped with quotes.
> The same thing happens when the key is a primitive, such as int, or when it’s 
> another type of collection.
> I tried this with the latest version of the Cassandra codebase from the 
> repository’s trunk (1f65a12c33).



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


[jira] [Created] (CASSANDRA-9190) Map keys aren’t properly serialized as strings in SELECT JSON queries

2015-04-14 Thread Gianluca Righetto (JIRA)
Gianluca Righetto created CASSANDRA-9190:


 Summary: Map keys aren’t properly serialized as strings in SELECT 
JSON queries
 Key: CASSANDRA-9190
 URL: https://issues.apache.org/jira/browse/CASSANDRA-9190
 Project: Cassandra
  Issue Type: Bug
  Components: API
Reporter: Gianluca Righetto


When I run a SELECT JSON query on a table that contains a column of type map, 
the JSON output doesn’t wrap the map keys with quotes, thus creating a 
non-standard JSON representation, which doesn’t play along with JSON parsers 
very well. 

Here’s an example where the map keys are actually a set:

{code}
create table table1 (id int primary key, mymap map>,int>);
insert into table1 (id,mymap) values (1, {{1,2,3,4}:1});
select json id,mymap from table1;
{code}

The output is:

{noformat}
{"id": 1, "mymap": {[1, 2, 3, 4]: 1}}
{noformat}

But what I expected was that the map key, in this case the entire integer set, 
would be wrapped with quotes.
The same thing happens when the key is a primitive, such as int, or when it’s 
another type of collection.

I tried this with the latest version of the Cassandra codebase from the 
repository’s trunk (1f65a12c33).



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


[jira] [Updated] (CASSANDRA-9189) DROP ROLE shouldn't cache information about non-existent roles

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-9189:
--
Reviewer: Aleksey Yeschenko

> DROP ROLE shouldn't cache information about non-existent roles
> --
>
> Key: CASSANDRA-9189
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9189
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sam Tunnicliffe
>Assignee: Sam Tunnicliffe
> Fix For: 3.0
>
> Attachments: 9189.txt
>
>
> {{DropRoleStatement#checkAccess}} involves a check of the target role's 
> superuser status in order to ensure that only superusers can drop another  
> with su privileges.
> When used in conjunction with {{IF EXISTS}}, this causes a cache entry for a 
> non-existent role to be inserted into the roles cache as 
> {{Roles#hasSuperuserStatus}} goes via the cache. {{RolesCache}} is a map from 
> a single role to the set of roles of which it has transitively been granted 
> (basically a map of {{RoleResource}} -> {{Set}}). So in this 
> case an empty set is cached for the role. 
> This can be problematic when the {{DROP ROLE IF EXISTS}} is followed by a 
> {{CREATE ROLE}} as until the cache entry expires any authorization request 
> for that role will use the cache to fetch the set of roles that need to be 
> included in the permission check. Finding an empty set, all authz checks will 
> result in failure. This pattern is particularly common in automated tests.



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


cassandra git commit: Force ByteBuffer big-endianness in IndexSummary binary search

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 1f65a12c3 -> d383f5cb2


Force ByteBuffer big-endianness in IndexSummary binary search

Patch by Sam Tunnicliffe; reviewed by Benedict Elliot Smith for
CASSANDRA-9062


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

Branch: refs/heads/trunk
Commit: d383f5cb2bee8b04c3ad8f8c740b232ef7a883e2
Parents: 1f65a12
Author: Sam Tunnicliffe 
Authored: Tue Apr 14 16:31:32 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 16:31:32 2015 -0500

--
 src/java/org/apache/cassandra/io/sstable/IndexSummary.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d383f5cb/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
--
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java 
b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
index eed0dfd..fbefe13 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
@@ -107,7 +107,8 @@ public class IndexSummary extends WrappedSharedCloseable
 // Harmony's Collections implementation
 public int binarySearch(RowPosition key)
 {
-ByteBuffer hollow = MemoryUtil.getHollowDirectByteBuffer();
+// We will be comparing non-native Keys, so use a buffer with 
appropriate byte order
+ByteBuffer hollow = 
MemoryUtil.getHollowDirectByteBuffer().order(ByteOrder.BIG_ENDIAN);
 int low = 0, mid = offsetCount, high = mid - 1, result = -1;
 while (low <= high)
 {



[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Vladimir (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494867#comment-14494867
 ] 

Vladimir commented on CASSANDRA-9120:
-

I mean JMX options, like "-Xmx  maximum java heap size". If save that info 
within the cache data, Cassandra could check that cache was saved when java 
started with other options and skip it.

> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494852#comment-14494852
 ] 

Ariel Weisberg commented on CASSANDRA-9120:
---

Maybe we should improve the error message on OOM? If there is an OOM loading 
the cache log a message that guides the operator towards what to do?

bq. In this case it could be good to add some information about startup options 
(same file or separate).
What do you mean by add information?

I am just looking for something that doesn't have a potential downside. 
Creating that file is a one way ticket to skipping the caches no matter how 
many restarts there are to get the system up. If there is some other bug or 
configuration issue preventing the database from coming up it could be an 
issue. 

> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Vladimir (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494844#comment-14494844
 ] 

Vladimir commented on CASSANDRA-9120:
-

It depends on what we are trying to fix:
- if corrupted file/cache I see no good solution w/o checksum.
- If operator reduced heap size or other - in this case we need to recognize it 
and skip cache. In this case it could be good to add some information about 
startup options (same file or separate).

> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494831#comment-14494831
 ] 

Ariel Weisberg commented on CASSANDRA-9120:
---

That would automate the process, but if the server went down during startup 
that would basically cause the caches to be skipped. I think I am more 
comfortable having operators delete or move the cache themselves, but I know 
that one extra step could really hang people up.

I think the entire thing is fraught. Without a checksum we could be reading 
random offsets into SSTables for partitions and cells. This is just band-aiding 
one specific set of bytes that might be corrupted.


> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Vladimir (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494806#comment-14494806
 ] 

Vladimir commented on CASSANDRA-9120:
-

If there is no way to add checksum, I'd try some simple: - create some status 
file that indicates that we are trying to load cache file, delete it if loaded 
successfully or failed by some reason that isn't OutOfMemory. Try to read that 
file at next run and ignore cache. It's still fine to use 
estimateMemorySizeForKeys as well but this isn't reliable as you mentioned and 
can be useless.

> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-9120) OutOfMemoryError when read auto-saved cache (probably broken)

2015-04-14 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494746#comment-14494746
 ] 

Ariel Weisberg commented on CASSANDRA-9120:
---

I am on board with the patch for 2.0 and 2.1, but it seems like it could be a 
little more accurate at calculating element size (I think it undercounts by a 
large amount). If you instantiate a toy minimal size IndexInfo and invoke 
memorySize() you should get a more accurate bound and can put that into a 
static final field.

You can cache the result of maxMemory() in a static final field. Apparently it 
is implemented as a JNI call (unless it is also an intrinsic which I wouldn't 
expect). 

The last thing to think about is estimateMemorySizeForKeys(int). It's a lot of 
multiplication and division and some of the constants might not be fully 
evaluated if they are tucked into a MemoryLayoutSpecification. I don't want to 
get carried away trying to make it better, but I am uncomfortable because we 
don't have a suite of benchmarks that will run to let us know if this change 
has an impact. If you have a simple idea for how to make this approximation 
simpler to calculate that would be great.


> OutOfMemoryError when read auto-saved cache (probably broken)
> -
>
> Key: CASSANDRA-9120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9120
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Vladimir
> Fix For: 3.0, 2.0.15, 2.1.5
>
>
> Found during tests on a 100 nodes cluster. After restart I found that one 
> node constantly crashes with OutOfMemory Exception. I guess that auto-saved 
> cache was corrupted and Cassandra can't recognize it. I see that similar 
> issues was already fixed (when negative size of some structure was read). 
> Does auto-saved cache have checksum? it'd help to reject corrupted cache at 
> the very beginning.
> As far as I can see current code still have that problem. Stack trace is:
> {code}
> INFO [main] 2015-03-28 01:04:13,503 AutoSavingCache.java (line 114) reading 
> saved cache 
> /storage/core/loginsight/cidata/cassandra/saved_caches/system-sstable_activity-KeyCache-b.db
> ERROR [main] 2015-03-28 01:04:14,718 CassandraDaemon.java (line 513) 
> Exception encountered during startup
> java.lang.OutOfMemoryError: Java heap space
> at java.util.ArrayList.(Unknown Source)
> at 
> org.apache.cassandra.db.RowIndexEntry$Serializer.deserialize(RowIndexEntry.java:120)
> at 
> org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:365)
> at 
> org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.(ColumnFamilyStore.java:262)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:421)
> at 
> org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:392)
> at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:315)
> at org.apache.cassandra.db.Keyspace.(Keyspace.java:272)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:114)
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:92)
> at 
> org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:536)
> at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:261)
> at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:496)
> at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
> {code}
> I looked at source code of Cassandra and see:
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cassandra/cassandra-all/2.0.10/org/apache/cassandra/db/RowIndexEntry.java
> 119 int entries = in.readInt();
> 120 List columnsIndex = new 
> ArrayList(entries);
> It seems that value entries is invalid (negative) and it tries too allocate 
> an array with huge initial capacity and hits OOM. I have deleted saved_cache 
> directory and was able to start node correctly. We should expect that it may 
> happen in real world. Cassandra should be able to skip incorrect cached data 
> and run.



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


[jira] [Commented] (CASSANDRA-7409) Allow multiple overlapping sstables in L1

2015-04-14 Thread Alan Boudreault (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494737#comment-14494737
 ] 

Alan Boudreault commented on CASSANDRA-7409:


FYI, there are 2 performance scenarios done: 
https://drive.google.com/drive/u/0/folders/0BwZ_GPM33j6KfktyN29kelQzd3NEYnNhTnpfajE2UDRwTTUtQkxwQVQ4YnpqaEMxSUk4TXM

> Allow multiple overlapping sstables in L1
> -
>
> Key: CASSANDRA-7409
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7409
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Carl Yeksigian
>Assignee: Carl Yeksigian
>  Labels: compaction
> Fix For: 3.0
>
>
> Currently, when a normal L0 compaction takes place (not STCS), we take up to 
> MAX_COMPACTING_L0 L0 sstables and all of the overlapping L1 sstables and 
> compact them together. If we didn't have to deal with the overlapping L1 
> tables, we could compact a higher number of L0 sstables together into a set 
> of non-overlapping L1 sstables.
> This could be done by delaying the invariant that L1 has no overlapping 
> sstables. Going from L1 to L2, we would be compacting fewer sstables together 
> which overlap.
> When reading, we will not have the same one sstable per level (except L0) 
> guarantee, but this can be bounded (once we have too many sets of sstables, 
> either compact them back into the same level, or compact them up to the next 
> level).
> This could be generalized to allow any level to be the maximum for this 
> overlapping strategy.



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


[jira] [Updated] (CASSANDRA-9134) Fix leak detected errors in unit tests

2015-04-14 Thread Tyler Hobbs (JIRA)

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

Tyler Hobbs updated CASSANDRA-9134:
---
Attachment: 9134-trunk.txt

> Fix leak detected errors in unit tests
> --
>
> Key: CASSANDRA-9134
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9134
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Stefania
>Assignee: Stefania
>Priority: Minor
> Fix For: 3.0
>
> Attachments: 9134-trunk.txt
>
>
> There are several of these errors when running unit tests on trunk:
> {code}
> [junit] ERROR 01:09:36 LEAK DETECTED: a reference 
> (org.apache.cassandra.utils.concurrent.Ref$State@317c884a) to class 
> org.apache.cassandra.io.util.SafeMemory$MemoryTidy@943674927:Memory@[7f1bcc0078e0..7f1bcc007908)
>  was not released before the reference was garbage collected
> [junit] ERROR 01:09:36 LEAK DETECTED: a reference 
> (org.apache.cassandra.utils.concurrent.Ref$State@317c884a) to class 
> org.apache.cassandra.io.util.SafeMemory$MemoryTidy@943674927:Memory@[7f1bcc0078e0..7f1bcc007908)
>  was not released before the reference was garbage collected
> [junit] ERROR 01:09:36 Allocate trace 
> org.apache.cassandra.utils.concurrent.Ref$State@317c884a:
> [junit] Thread[CompactionExecutor:1,1,main]
> [junit]   at java.lang.Thread.getStackTrace(Thread.java:1589)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$Debug.(Ref.java:200)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$State.(Ref.java:133)
> [junit]   at org.apache.cassandra.utils.concurrent.Ref.(Ref.java:60)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemory.(SafeMemory.java:33)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemoryWriter.(SafeMemoryWriter.java:31)
> [junit]   at 
> org.apache.cassandra.io.sstable.IndexSummaryBuilder.(IndexSummaryBuilder.java:112)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.(BigTableWriter.java:491)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.(BigTableWriter.java:83)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:107)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:89)
> [junit]   at 
> org.apache.cassandra.db.compaction.writers.DefaultCompactionWriter.(DefaultCompactionWriter.java:53)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.getCompactionAwareWriter(CompactionTask.java:253)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:153)
> [junit]   at 
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:73)
> [junit]   at 
> org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:58)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionTask.run(CompactionManager.java:239)
> [junit]   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [junit]   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> [junit]   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [junit]   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [junit]   at java.lang.Thread.run(Thread.java:745)
> [junit] 
> [junit] ERROR 01:09:36 Allocate trace 
> org.apache.cassandra.utils.concurrent.Ref$State@317c884a:
> [junit] Thread[CompactionExecutor:1,1,main]
> [junit]   at java.lang.Thread.getStackTrace(Thread.java:1589)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$Debug.(Ref.java:200)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$State.(Ref.java:133)
> [junit]   at org.apache.cassandra.utils.concurrent.Ref.(Ref.java:60)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemory.(SafeMemory.java:33)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemoryWriter.(SafeMemoryWriter.java:31)
> [junit]   at 
> org.apache.cassandra.io.sstable.IndexSummaryBuilder.(IndexSummaryBuilder.java:112)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.(BigTableWriter.java:491)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.(BigTableWriter.java:83)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:107)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:89)
> [ju

[jira] [Updated] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-9179:
--
Assignee: Branimir Lambov

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>Priority: Minor
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Comment Edited] (CASSANDRA-9137) nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true

2015-04-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494720#comment-14494720
 ] 

Jonathan Ellis edited comment on CASSANDRA-9137 at 4/14/15 7:35 PM:


committed


was (Author: jbellis):
committed, but leaving open until INFRA-9440 is resolved so I can assign to 
Andrey

> nodetool doesn't work when Cassandra run with the property 
> java.net.preferIPv6Addresses=true
> 
>
> Key: CASSANDRA-9137
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9137
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Andrey Trubachev
>Assignee: Andrey Trubachev
> Fix For: 2.0.15, 2.1.5
>
> Attachments: cassandra-2.0.14-9137.txt, cassandra-2.1.4-9137.txt
>
>
> nodetool doesn't work when Cassandra run with the property 
> {{java.net.preferIPv6Addresses=true}}.
> {noformat}
> $ sudo netstat -tlpn | grep $(cat /var/run/cassandra/cassandra.pid) | grep 
> 7199
> tcp6   0  0 ::1:7199:::*LISTEN
>   27560/java
> {noformat}
> {noformat}
> $ nodetool -h ::1 status
> nodetool: Failed to connect to '::1:7199' - ConnectException: 'Connection 
> refused'.
> {noformat}
> Hardcoded value  of the property {{java.rmi.server.hostname}} 
> (https://github.com/apache/cassandra/blob/cassandra-2.1.4/src/java/org/apache/cassandra/service/CassandraDaemon.java#L91)
>  makes RMI returns the address {{127.0.0.1}} instead of {{::1}} that 
> jmxServer listens to.
> {noformat}
> 21:52:26.300192 IP6 (hlim 64, next-header TCP (6) payload length: 259) 
> ::1.7199 > ::1.58706: Flags [P.], cksum 0x010b (incorrect -> 0x6a57), seq 
> 23:250, ack 88, win 2048, options [nop,nop,TS val 1833457 ecr 1833456], 
> length 227
> `..@...R.4./...
> Qw..SZ.y...L.[sr..javax.management.remote.rmi.RMIServerImpl_Stub...pxr..java.rmi.server.RemoteStub..epxr..javSZ.y...L.[.xoteObject.a...a3pxpw4..UnicastRef2..
>  127.0.0.1...(.Ld
> 21:52:26.336400 IP6 (hlim 64, next-header TCP (6) payload length: 32) 
> ::1.58706 > ::1.7199: Flags [.], cksum 0x0028 (incorrect -> 0xfe1c), seq 88, 
> ack 250, win 2048, options [nop,nop,TS val 1833467 ecr 1833457], length 0
> ` .@.R./.4...(.
> 
> {noformat}
> jmxServer listens to the an ip address that was resolved from {{localhost}} 
> and it depends on value of the property {{java.net.preferIPv6Addresses}} or 
> lack of it (
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/RMIServerSocketFactoryImpl.java#L13).
> This is a simple patch that works correctly with 
> {{java.net.preferIPv6Addresses=(true|false)}} and 
> {{java.net.preferIPv4Stack=(true|false)}}:
> {code}
> diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
> b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> index 3e398bf..66e9cca 100644
> --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
> +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> @@ -88,7 +88,7 @@ public class CassandraDaemon
>  }
>  else
>  {
> -System.setProperty("java.rmi.server.hostname","127.0.0.1");
> +System.setProperty("java.rmi.server.hostname", 
> InetAddress.getLoopbackAddress().getHostAddress());
>  try
>  {
> {code}



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


cassandra git commit: Fix detected leaks in unit tests

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0df28d14a -> 1f65a12c3


Fix detected leaks in unit tests

Patch by Stefania Alborghetti; reviewed by Tyler Hobbs for
CASSANDRA-9134


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

Branch: refs/heads/trunk
Commit: 1f65a12c33e730b9f5bd56e6c8d00ed39bc456a1
Parents: 0df28d1
Author: Stefania Alborghetti 
Authored: Tue Apr 14 14:34:38 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 14:35:30 2015 -0500

--
 .../io/sstable/format/SSTableReader.java| 22 +++-
 .../cassandra/io/sstable/IndexSummaryTest.java  |  1 +
 2 files changed, 13 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1f65a12c/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
--
diff --git a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java 
b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
index 24540b8..7b39266 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
@@ -386,17 +386,19 @@ public abstract class SSTableReader extends SSTable 
implements SelfRefCountedhttp://git-wip-us.apache.org/repos/asf/cassandra/blob/1f65a12c/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
--
diff --git a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java 
b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
index 6471558..7442a22 100644
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
@@ -90,6 +90,7 @@ public class IndexSummaryTest
 assertEquals(dis.readUTF(), "JUNK");
 is.close();
 FileUtils.closeQuietly(dis);
+random.right.close();
 }
 
 @Test



[jira] [Updated] (CASSANDRA-9137) nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-9137:
--
Assignee: Andrey Trubachev

> nodetool doesn't work when Cassandra run with the property 
> java.net.preferIPv6Addresses=true
> 
>
> Key: CASSANDRA-9137
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9137
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Andrey Trubachev
>Assignee: Andrey Trubachev
> Fix For: 2.0.15, 2.1.5
>
> Attachments: cassandra-2.0.14-9137.txt, cassandra-2.1.4-9137.txt
>
>
> nodetool doesn't work when Cassandra run with the property 
> {{java.net.preferIPv6Addresses=true}}.
> {noformat}
> $ sudo netstat -tlpn | grep $(cat /var/run/cassandra/cassandra.pid) | grep 
> 7199
> tcp6   0  0 ::1:7199:::*LISTEN
>   27560/java
> {noformat}
> {noformat}
> $ nodetool -h ::1 status
> nodetool: Failed to connect to '::1:7199' - ConnectException: 'Connection 
> refused'.
> {noformat}
> Hardcoded value  of the property {{java.rmi.server.hostname}} 
> (https://github.com/apache/cassandra/blob/cassandra-2.1.4/src/java/org/apache/cassandra/service/CassandraDaemon.java#L91)
>  makes RMI returns the address {{127.0.0.1}} instead of {{::1}} that 
> jmxServer listens to.
> {noformat}
> 21:52:26.300192 IP6 (hlim 64, next-header TCP (6) payload length: 259) 
> ::1.7199 > ::1.58706: Flags [P.], cksum 0x010b (incorrect -> 0x6a57), seq 
> 23:250, ack 88, win 2048, options [nop,nop,TS val 1833457 ecr 1833456], 
> length 227
> `..@...R.4./...
> Qw..SZ.y...L.[sr..javax.management.remote.rmi.RMIServerImpl_Stub...pxr..java.rmi.server.RemoteStub..epxr..javSZ.y...L.[.xoteObject.a...a3pxpw4..UnicastRef2..
>  127.0.0.1...(.Ld
> 21:52:26.336400 IP6 (hlim 64, next-header TCP (6) payload length: 32) 
> ::1.58706 > ::1.7199: Flags [.], cksum 0x0028 (incorrect -> 0xfe1c), seq 88, 
> ack 250, win 2048, options [nop,nop,TS val 1833467 ecr 1833457], length 0
> ` .@.R./.4...(.
> 
> {noformat}
> jmxServer listens to the an ip address that was resolved from {{localhost}} 
> and it depends on value of the property {{java.net.preferIPv6Addresses}} or 
> lack of it (
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/RMIServerSocketFactoryImpl.java#L13).
> This is a simple patch that works correctly with 
> {{java.net.preferIPv6Addresses=(true|false)}} and 
> {{java.net.preferIPv4Stack=(true|false)}}:
> {code}
> diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
> b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> index 3e398bf..66e9cca 100644
> --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
> +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> @@ -88,7 +88,7 @@ public class CassandraDaemon
>  }
>  else
>  {
> -System.setProperty("java.rmi.server.hostname","127.0.0.1");
> +System.setProperty("java.rmi.server.hostname", 
> InetAddress.getLoopbackAddress().getHostAddress());
>  try
>  {
> {code}



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


[jira] [Commented] (CASSANDRA-9137) nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true

2015-04-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494720#comment-14494720
 ] 

Jonathan Ellis commented on CASSANDRA-9137:
---

committed, but leaving open until INFRA-9440 is resolved so I can assign to 
Andrey

> nodetool doesn't work when Cassandra run with the property 
> java.net.preferIPv6Addresses=true
> 
>
> Key: CASSANDRA-9137
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9137
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Andrey Trubachev
> Fix For: 2.0.15, 2.1.5
>
> Attachments: cassandra-2.0.14-9137.txt, cassandra-2.1.4-9137.txt
>
>
> nodetool doesn't work when Cassandra run with the property 
> {{java.net.preferIPv6Addresses=true}}.
> {noformat}
> $ sudo netstat -tlpn | grep $(cat /var/run/cassandra/cassandra.pid) | grep 
> 7199
> tcp6   0  0 ::1:7199:::*LISTEN
>   27560/java
> {noformat}
> {noformat}
> $ nodetool -h ::1 status
> nodetool: Failed to connect to '::1:7199' - ConnectException: 'Connection 
> refused'.
> {noformat}
> Hardcoded value  of the property {{java.rmi.server.hostname}} 
> (https://github.com/apache/cassandra/blob/cassandra-2.1.4/src/java/org/apache/cassandra/service/CassandraDaemon.java#L91)
>  makes RMI returns the address {{127.0.0.1}} instead of {{::1}} that 
> jmxServer listens to.
> {noformat}
> 21:52:26.300192 IP6 (hlim 64, next-header TCP (6) payload length: 259) 
> ::1.7199 > ::1.58706: Flags [P.], cksum 0x010b (incorrect -> 0x6a57), seq 
> 23:250, ack 88, win 2048, options [nop,nop,TS val 1833457 ecr 1833456], 
> length 227
> `..@...R.4./...
> Qw..SZ.y...L.[sr..javax.management.remote.rmi.RMIServerImpl_Stub...pxr..java.rmi.server.RemoteStub..epxr..javSZ.y...L.[.xoteObject.a...a3pxpw4..UnicastRef2..
>  127.0.0.1...(.Ld
> 21:52:26.336400 IP6 (hlim 64, next-header TCP (6) payload length: 32) 
> ::1.58706 > ::1.7199: Flags [.], cksum 0x0028 (incorrect -> 0xfe1c), seq 88, 
> ack 250, win 2048, options [nop,nop,TS val 1833467 ecr 1833457], length 0
> ` .@.R./.4...(.
> 
> {noformat}
> jmxServer listens to the an ip address that was resolved from {{localhost}} 
> and it depends on value of the property {{java.net.preferIPv6Addresses}} or 
> lack of it (
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/RMIServerSocketFactoryImpl.java#L13).
> This is a simple patch that works correctly with 
> {{java.net.preferIPv6Addresses=(true|false)}} and 
> {{java.net.preferIPv4Stack=(true|false)}}:
> {code}
> diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
> b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> index 3e398bf..66e9cca 100644
> --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
> +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> @@ -88,7 +88,7 @@ public class CassandraDaemon
>  }
>  else
>  {
> -System.setProperty("java.rmi.server.hostname","127.0.0.1");
> +System.setProperty("java.rmi.server.hostname", 
> InetAddress.getLoopbackAddress().getHostAddress());
>  try
>  {
> {code}



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


[09/10] cassandra git commit: merge from 2.0

2015-04-14 Thread jbellis
merge from 2.0


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

Branch: refs/heads/trunk
Commit: f1115cfdf01a2eff8cd4af9e49ce2e79a29f97de
Parents: ee9bd54 a5bae1f
Author: Jonathan Ellis 
Authored: Tue Apr 14 14:30:54 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 14:30:54 2015 -0500

--
 CHANGES.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1115cfd/CHANGES.txt
--
diff --cc CHANGES.txt
index dfd5649,521668d..c3e6c6c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,81 -1,5 +1,81 @@@
 -2.0.15:
 +2.1.5
 + * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
 + * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
 + * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)
 + * cqlsh: quote column names when needed in COPY FROM inserts (CASSANDRA-9080)
 + * Add generate-idea-files target to build.xml (CASSANDRA-9123)
 + * Do not load read meter for offline operations (CASSANDRA-9082)
 + * cqlsh: Make CompositeType data readable (CASSANDRA-8919)
 + * cqlsh: Fix display of triggers (CASSANDRA-9081)
 + * Fix NullPointerException when deleting or setting an element by index on
 +   a null list collection (CASSANDRA-9077)
 + * Buffer bloom filter serialization (CASSANDRA-9066)
 + * Fix anti-compaction target bloom filter size (CASSANDRA-9060)
 + * Make FROZEN and TUPLE unreserved keywords in CQL (CASSANDRA-9047)
 + * Prevent AssertionError from SizeEstimatesRecorder (CASSANDRA-9034)
 + * Avoid overwriting index summaries for sstables with an older format that
 +   does not support downsampling; rebuild summaries on startup when this
 +   is detected (CASSANDRA-8993)
 + * Fix potential data loss in CompressedSequentialWriter (CASSANDRA-8949)
 + * Make PasswordAuthenticator number of hashing rounds configurable 
(CASSANDRA-8085)
 + * Fix AssertionError when binding nested collections in DELETE 
(CASSANDRA-8900)
 + * Check for overlap with non-early sstables in LCS (CASSANDRA-8739)
 + * Only calculate max purgable timestamp if we have to (CASSANDRA-8914)
 + * (cqlsh) Greatly improve performance of COPY FROM (CASSANDRA-8225)
 + * IndexSummary effectiveIndexInterval is now a guideline, not a rule 
(CASSANDRA-8993)
 + * Use correct bounds for page cache eviction of compressed files 
(CASSANDRA-8746)
 + * SSTableScanner enforces its bounds (CASSANDRA-8946)
 + * Cleanup cell equality (CASSANDRA-8947)
 + * Introduce intra-cluster message coalescing (CASSANDRA-8692)
 + * DatabaseDescriptor throws NPE when rpc_interface is used (CASSANDRA-8839)
 + * Don't check if an sstable is live for offline compactions (CASSANDRA-8841)
 + * Don't set clientMode in SSTableLoader (CASSANDRA-8238)
 + * Fix SSTableRewriter with disabled early open (CASSANDRA-8535)
 + * Allow invalidating permissions and cache time (CASSANDRA-8722)
 + * Log warning when queries that will require ALLOW FILTERING in Cassandra 3.0
 +   are executed (CASSANDRA-8418)
 + * Fix cassandra-stress so it respects the CL passed in user mode 
(CASSANDRA-8948)
 + * Fix rare NPE in ColumnDefinition#hasIndexOption() (CASSANDRA-8786)
 + * cassandra-stress reports per-operation statistics, plus misc 
(CASSANDRA-8769)
 + * Add SimpleDate (cql date) and Time (cql time) types (CASSANDRA-7523)
 + * Use long for key count in cfstats (CASSANDRA-8913)
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 
(CASSAND

[03/10] cassandra git commit: Fix running with java.net.preferIPv6Addresses=true patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137

2015-04-14 Thread jbellis
Fix running with java.net.preferIPv6Addresses=true
patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137


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

Branch: refs/heads/cassandra-2.0
Commit: a5bae1f5df764d7238cda7ab894d3c36d028f778
Parents: ac46747
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:39:39 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:43:30 2015 -0500

--
 CHANGES.txt| 1 +
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 36d4b47..521668d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix running with java.net.preferIPv6Addresses=true (CASSANDRA-9137)
  * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/src/java/org/apache/cassandra/service/CassandraDaemon.java
--
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 039760e..737f4bf 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -160,7 +160,7 @@ public class CassandraDaemon
 }
 else
 {
-System.setProperty("java.rmi.server.hostname","127.0.0.1");
+System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 
 try
 {



[02/10] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread jbellis
Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/trunk
Commit: ac46747f84e62f6c9cbad0fb2e67a0eb95f43b01
Parents: def4835
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:19:53 2015 -0500

--
 CHANGES.txt |  1 +
 .../cassandra/service/StorageService.java   | 43 +++-
 2 files changed, 24 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 772afd6..36d4b47 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index cfd8fe1..e906f03 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1366,27 +1366,30 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
quote(value.value));
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
-break;
-case RPC_ADDRESS:
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
value.value);
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", quote(value.value));
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
+break;
+case RPC_ADDRESS:
+SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
+break;
+case SCHEMA:
+SystemKeyspace.updatePeerInfo(endpoint, 
"schema_version", value.value);
+MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
+break;
+case HOST_ID:
+SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
+break;
+}
 }
 }
 }



[05/10] cassandra git commit: Fix running with java.net.preferIPv6Addresses=true patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137

2015-04-14 Thread jbellis
Fix running with java.net.preferIPv6Addresses=true
patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137


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

Branch: refs/heads/trunk
Commit: a5bae1f5df764d7238cda7ab894d3c36d028f778
Parents: ac46747
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:39:39 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:43:30 2015 -0500

--
 CHANGES.txt| 1 +
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 36d4b47..521668d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix running with java.net.preferIPv6Addresses=true (CASSANDRA-9137)
  * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/src/java/org/apache/cassandra/service/CassandraDaemon.java
--
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 039760e..737f4bf 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -160,7 +160,7 @@ public class CassandraDaemon
 }
 else
 {
-System.setProperty("java.rmi.server.hostname","127.0.0.1");
+System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 
 try
 {



[08/10] cassandra git commit: merge from 2.0

2015-04-14 Thread jbellis
merge from 2.0


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

Branch: refs/heads/cassandra-2.1
Commit: f1115cfdf01a2eff8cd4af9e49ce2e79a29f97de
Parents: ee9bd54 a5bae1f
Author: Jonathan Ellis 
Authored: Tue Apr 14 14:30:54 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 14:30:54 2015 -0500

--
 CHANGES.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1115cfd/CHANGES.txt
--
diff --cc CHANGES.txt
index dfd5649,521668d..c3e6c6c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,81 -1,5 +1,81 @@@
 -2.0.15:
 +2.1.5
 + * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
 + * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
 + * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)
 + * cqlsh: quote column names when needed in COPY FROM inserts (CASSANDRA-9080)
 + * Add generate-idea-files target to build.xml (CASSANDRA-9123)
 + * Do not load read meter for offline operations (CASSANDRA-9082)
 + * cqlsh: Make CompositeType data readable (CASSANDRA-8919)
 + * cqlsh: Fix display of triggers (CASSANDRA-9081)
 + * Fix NullPointerException when deleting or setting an element by index on
 +   a null list collection (CASSANDRA-9077)
 + * Buffer bloom filter serialization (CASSANDRA-9066)
 + * Fix anti-compaction target bloom filter size (CASSANDRA-9060)
 + * Make FROZEN and TUPLE unreserved keywords in CQL (CASSANDRA-9047)
 + * Prevent AssertionError from SizeEstimatesRecorder (CASSANDRA-9034)
 + * Avoid overwriting index summaries for sstables with an older format that
 +   does not support downsampling; rebuild summaries on startup when this
 +   is detected (CASSANDRA-8993)
 + * Fix potential data loss in CompressedSequentialWriter (CASSANDRA-8949)
 + * Make PasswordAuthenticator number of hashing rounds configurable 
(CASSANDRA-8085)
 + * Fix AssertionError when binding nested collections in DELETE 
(CASSANDRA-8900)
 + * Check for overlap with non-early sstables in LCS (CASSANDRA-8739)
 + * Only calculate max purgable timestamp if we have to (CASSANDRA-8914)
 + * (cqlsh) Greatly improve performance of COPY FROM (CASSANDRA-8225)
 + * IndexSummary effectiveIndexInterval is now a guideline, not a rule 
(CASSANDRA-8993)
 + * Use correct bounds for page cache eviction of compressed files 
(CASSANDRA-8746)
 + * SSTableScanner enforces its bounds (CASSANDRA-8946)
 + * Cleanup cell equality (CASSANDRA-8947)
 + * Introduce intra-cluster message coalescing (CASSANDRA-8692)
 + * DatabaseDescriptor throws NPE when rpc_interface is used (CASSANDRA-8839)
 + * Don't check if an sstable is live for offline compactions (CASSANDRA-8841)
 + * Don't set clientMode in SSTableLoader (CASSANDRA-8238)
 + * Fix SSTableRewriter with disabled early open (CASSANDRA-8535)
 + * Allow invalidating permissions and cache time (CASSANDRA-8722)
 + * Log warning when queries that will require ALLOW FILTERING in Cassandra 3.0
 +   are executed (CASSANDRA-8418)
 + * Fix cassandra-stress so it respects the CL passed in user mode 
(CASSANDRA-8948)
 + * Fix rare NPE in ColumnDefinition#hasIndexOption() (CASSANDRA-8786)
 + * cassandra-stress reports per-operation statistics, plus misc 
(CASSANDRA-8769)
 + * Add SimpleDate (cql date) and Time (cql time) types (CASSANDRA-7523)
 + * Use long for key count in cfstats (CASSANDRA-8913)
 + * Make SSTableRewriter.abort() more robust to failure (CASSANDRA-8832)
 + * Remove cold_reads_to_omit from STCS (CASSANDRA-8860)
 + * Make EstimatedHistogram#percentile() use ceil instead of floor 
(CASSANDRA-8883)
 + * Fix top partitions reporting wrong cardinality (CASSANDRA-8834)
 + * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
 + * Pick sstables for validation as late as possible inc repairs 
(CASSANDRA-8366)
 + * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
 + * Fix parallelism adjustment in range and secondary index queries
 +   when the first fetch does not satisfy the limit (CASSANDRA-8856)
 + * Check if the filtered sstables is non-empty in STCS (CASSANDRA-8843)
 + * Upgrade java-driver used for cassandra-stress (CASSANDRA-8842)
 + * Fix CommitLog.forceRecycleAllSegments() memory access error 
(CASSANDRA-8812)
 + * Improve assertions in Memory (CASSANDRA-8792)
 + * Fix SSTableRewriter cleanup (CASSANDRA-8802)
 + * Introduce SafeMemory for CompressionMetadata.Writer (CASSANDRA-8758)
 + * 'nodetool info' prints exception against older node (CASSANDRA-8796)
 + * Ensure SSTableReader.last corresponds exactly with the file end 

[06/10] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread jbellis
Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/cassandra-2.1
Commit: ee9bd549e83a157ae727f2e38c921694fffda52d
Parents: cba1b68
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:50:01 2015 -0500

--
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ee9bd549/src/java/org/apache/cassandra/service/CassandraDaemon.java
--
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index b527528..21d5249 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -88,7 +88,7 @@ public class CassandraDaemon
 }
 else
 {
-System.setProperty("java.rmi.server.hostname","127.0.0.1");
+System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 
 try
 {



[07/10] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread jbellis
Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/trunk
Commit: ee9bd549e83a157ae727f2e38c921694fffda52d
Parents: cba1b68
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:50:01 2015 -0500

--
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ee9bd549/src/java/org/apache/cassandra/service/CassandraDaemon.java
--
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index b527528..21d5249 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -88,7 +88,7 @@ public class CassandraDaemon
 }
 else
 {
-System.setProperty("java.rmi.server.hostname","127.0.0.1");
+System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 
 try
 {



[10/10] cassandra git commit: merge from 2.1

2015-04-14 Thread jbellis
merge from 2.1


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

Branch: refs/heads/trunk
Commit: 0df28d14a47de93a87b9546b21b04b32e93ef68c
Parents: cb5897f f1115cf
Author: Jonathan Ellis 
Authored: Tue Apr 14 14:31:27 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 14:31:27 2015 -0500

--
 CHANGES.txt| 1 +
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
--


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0df28d14/src/java/org/apache/cassandra/service/CassandraDaemon.java
--



[04/10] cassandra git commit: Fix running with java.net.preferIPv6Addresses=true patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137

2015-04-14 Thread jbellis
Fix running with java.net.preferIPv6Addresses=true
patch by Andrey Trubachev; reviewed by Ariel Weisberg for CASSANDRA-9137


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

Branch: refs/heads/cassandra-2.1
Commit: a5bae1f5df764d7238cda7ab894d3c36d028f778
Parents: ac46747
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:39:39 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:43:30 2015 -0500

--
 CHANGES.txt| 1 +
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 36d4b47..521668d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix running with java.net.preferIPv6Addresses=true (CASSANDRA-9137)
  * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a5bae1f5/src/java/org/apache/cassandra/service/CassandraDaemon.java
--
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 039760e..737f4bf 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -160,7 +160,7 @@ public class CassandraDaemon
 }
 else
 {
-System.setProperty("java.rmi.server.hostname","127.0.0.1");
+System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 
 try
 {



[01/10] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread jbellis
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 ac46747f8 -> a5bae1f5d
  refs/heads/cassandra-2.1 cba1b68db -> f1115cfdf
  refs/heads/trunk cb5897f3c -> 0df28d14a


Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/cassandra-2.1
Commit: ac46747f84e62f6c9cbad0fb2e67a0eb95f43b01
Parents: def4835
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:19:53 2015 -0500

--
 CHANGES.txt |  1 +
 .../cassandra/service/StorageService.java   | 43 +++-
 2 files changed, 24 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 772afd6..36d4b47 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index cfd8fe1..e906f03 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1366,27 +1366,30 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
quote(value.value));
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
-break;
-case RPC_ADDRESS:
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
value.value);
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", quote(value.value));
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
+break;
+case RPC_ADDRESS:
+SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
+break;
+case SCHEMA:
+SystemKeyspace.updatePeerInfo(endpoint, 
"schema_version", value.value);
+MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
+break;
+case HOST_ID:
+SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
+break;
+}
 }
 }
 }



[jira] [Updated] (CASSANDRA-7557) User permissions for UDFs

2015-04-14 Thread Tyler Hobbs (JIRA)

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

Tyler Hobbs updated CASSANDRA-7557:
---
Attachment: 7557-trunk.txt

> User permissions for UDFs
> -
>
> Key: CASSANDRA-7557
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7557
> Project: Cassandra
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Tyler Hobbs
>Assignee: Sam Tunnicliffe
>  Labels: client-impacting, cql, udf
> Fix For: 3.0
>
> Attachments: 7557-trunk.txt
>
>
> We probably want some new permissions for user defined functions.  Most 
> RDBMSes split function permissions roughly into {{EXECUTE}} and 
> {{CREATE}}/{{ALTER}}/{{DROP}} permissions.



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


[1/3] cassandra git commit: User/role permissions for UDFs

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk d6a4b4548 -> cb5897f3c


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb5897f3/test/unit/org/apache/cassandra/cql3/UFIdentificationTest.java
--
diff --git a/test/unit/org/apache/cassandra/cql3/UFIdentificationTest.java 
b/test/unit/org/apache/cassandra/cql3/UFIdentificationTest.java
new file mode 100644
index 000..cfa42b3
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/UFIdentificationTest.java
@@ -0,0 +1,375 @@
+/*
+ * 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;
+
+import java.util.*;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Iterables;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import org.apache.cassandra.cql3.functions.Function;
+import org.apache.cassandra.cql3.statements.BatchStatement;
+import org.apache.cassandra.cql3.statements.ModificationStatement;
+import org.apache.cassandra.service.ClientState;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Checks the collection of Function objects returned by 
CQLStatement.getFunction
+ * matches expectations. This is intended to verify the various subcomponents 
of
+ * the statement (Operations, Terms, Restrictions, RestrictionSet, Selection,
+ * Selector, SelectorFactories etc) properly report any constituent functions.
+ * Some purely terminal functions are resolved at preparation, so those are not
+ * included in the reported list. They still need to be surveyed, to verify the
+ * calling client has the necessary permissions. UFAuthTest includes tests 
which
+ * verify this more thoroughly than we can here.
+ */
+public class UFIdentificationTest extends CQLTester
+{
+private com.google.common.base.Function toFunctionNames 
= new com.google.common.base.Function()
+{
+public String apply(Function f)
+{
+return f.name().keyspace + "." + f.name().name;
+}
+};
+
+String tFunc;
+String iFunc;
+String lFunc;
+String sFunc;
+String mFunc;
+String uFunc;
+String udtFunc;
+
+String userType;
+
+@Before
+public void setup() throws Throwable
+{
+userType = KEYSPACE + "." + createType("CREATE TYPE %s (t text, i 
int)");
+
+createTable("CREATE TABLE %s (" +
+"   key int, " +
+"   t_sc text STATIC," +
+"   i_cc int, " +
+"   t_cc text, " +
+"   i_val int," +
+"   l_val list," +
+"   s_val set," +
+"   m_val map," +
+"   u_val timeuuid," +
+"   udt_val frozen<" + userType + ">," +
+"   PRIMARY KEY (key, i_cc, t_cc)" +
+")");
+
+tFunc = createEchoFunction("text");
+iFunc = createEchoFunction("int");
+lFunc = createEchoFunction("list");
+sFunc = createEchoFunction("set");
+mFunc = createEchoFunction("map");
+uFunc = createEchoFunction("timeuuid");
+udtFunc = createEchoFunction("frozen<" + userType + ">");
+}
+
+@Test
+public void testSimpleModificationStatement() throws Throwable
+{
+assertFunctions(cql("INSERT INTO %s (key, t_sc) VALUES (0, %s)", 
functionCall(tFunc, "'foo'")), tFunc);
+assertFunctions(cql("INSERT INTO %s (key, i_cc) VALUES (0, %s)", 
functionCall(iFunc, "1")), iFunc);
+assertFunctions(cql("INSERT INTO %s (key, t_cc) VALUES (0, %s)", 
functionCall(tFunc, "'foo'")), tFunc);
+assertFunctions(cql("INSERT INTO %s (key, i_val) VALUES (0, %s)", 
functionCall(iFunc, "1")), iFunc);
+assertFunctions(cql("INSERT INTO %s (key, l_val) VALUES (0, %s)", 
functionCall(lFunc, "[1]")), lFunc);
+assertFunctions(cql("INSERT INTO %s (key, s_val) VALUES (0, %s)", 
functionCall(sFunc, "{1}")), sFunc);
+assertFunctions(cql("INSERT INTO %s (key, m_val) VALUES (0, %s)", 
functionCall(mFunc, "{1:1}")), mFunc);
+assertFunctions(cql("INSERT INTO %s (key, udt_val) VALUES (0,%s)", 
functionCall(

[2/3] cassandra git commit: User/role permissions for UDFs

2015-04-14 Thread tylerhobbs
http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb5897f3/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java
--
diff --git 
a/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java
index df7e87e..021077e 100644
--- 
a/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java
+++ 
b/src/java/org/apache/cassandra/cql3/statements/CreateAggregateStatement.java
@@ -22,20 +22,16 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.cassandra.auth.Permission;
+import org.apache.cassandra.auth.*;
+import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.cql3.CQL3Type;
-import org.apache.cassandra.cql3.ColumnIdentifier;
-import org.apache.cassandra.cql3.ColumnSpecification;
-import org.apache.cassandra.cql3.QueryOptions;
-import org.apache.cassandra.cql3.Term;
+import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.cql3.functions.*;
 import org.apache.cassandra.db.marshal.AbstractType;
-import org.apache.cassandra.exceptions.InvalidRequestException;
-import org.apache.cassandra.exceptions.RequestValidationException;
-import org.apache.cassandra.exceptions.UnauthorizedException;
+import org.apache.cassandra.exceptions.*;
 import org.apache.cassandra.service.ClientState;
 import org.apache.cassandra.service.MigrationManager;
+import org.apache.cassandra.service.QueryState;
 import org.apache.cassandra.thrift.ThriftValidation;
 import org.apache.cassandra.transport.Event;
 
@@ -57,6 +53,12 @@ public final class CreateAggregateStatement extends 
SchemaAlteringStatement
 private UDAggregate udAggregate;
 private boolean replaced;
 
+private List> argTypes;
+private AbstractType returnType;
+private ScalarFunction stateFunction;
+private ScalarFunction finalFunction;
+private ByteBuffer initcond;
+
 public CreateAggregateStatement(FunctionName functionName,
 List argRawTypes,
 String stateFunc,
@@ -76,6 +78,44 @@ public final class CreateAggregateStatement extends 
SchemaAlteringStatement
 this.ifNotExists = ifNotExists;
 }
 
+public Prepared prepare()
+{
+argTypes = new ArrayList<>(argRawTypes.size());
+for (CQL3Type.Raw rawType : argRawTypes)
+argTypes.add(rawType.prepare(functionName.keyspace).getType());
+
+AbstractType stateType = 
stateTypeRaw.prepare(functionName.keyspace).getType();
+FunctionName stateFuncName = new FunctionName(functionName.keyspace, 
stateFunc);
+Function f = Functions.find(stateFuncName, stateArguments(stateType, 
argTypes));
+if (!(f instanceof ScalarFunction))
+throw new InvalidRequestException("State function " + 
stateFuncSig(stateFuncName, stateTypeRaw, argRawTypes) + " does not exist or is 
not a scalar function");
+stateFunction = (ScalarFunction)f;
+
+if (finalFunc != null)
+{
+FunctionName finalFuncName = new 
FunctionName(functionName.keyspace, finalFunc);
+f = Functions.find(finalFuncName, 
Collections.>singletonList(stateType));
+if (!(f instanceof ScalarFunction))
+throw new InvalidRequestException("Final function " + 
finalFuncName + "(" + stateTypeRaw + ") does not exist or is not a scalar 
function");
+finalFunction = (ScalarFunction) f;
+returnType = finalFunction.returnType();
+}
+else
+{
+returnType = stateFunction.returnType();
+if (!returnType.equals(stateType))
+throw new InvalidRequestException("State function " + 
stateFuncSig(stateFunction.name(), stateTypeRaw, argRawTypes) + " return type 
must be the same as the first argument type (if no final function is used)");
+}
+
+if (ival != null)
+{
+ColumnSpecification receiver = new 
ColumnSpecification(functionName.keyspace, "--dummy--", new 
ColumnIdentifier("(aggregate_initcond)", true), stateType);
+initcond = ival.prepare(functionName.keyspace, 
receiver).bindAndGet(QueryOptions.DEFAULT);
+}
+
+return super.prepare();
+}
+
 public void prepareKeyspace(ClientState state) throws 
InvalidRequestException
 {
 if (!functionName.hasKeyspace() && state.getRawKeyspace() != null)
@@ -87,11 +127,37 @@ public final class CreateAggregateStatement extends 
SchemaAlteringStatement
 ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace);
 }
 
+protected void grantPermissionsToCreator(QueryState state)
+{
+try
+{
+IResource resource = 
FunctionResource.function(functionName.keyspace, functionName.

[3/3] cassandra git commit: User/role permissions for UDFs

2015-04-14 Thread tylerhobbs
User/role permissions for UDFs

Patch by Sam Tunnicliffe; reviewed by Tyler Hobbs for CASSANDRA-7557


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

Branch: refs/heads/trunk
Commit: cb5897f3cb425334e693773fc88988de944fe247
Parents: d6a4b45
Author: Sam Tunnicliffe 
Authored: Tue Apr 14 12:45:52 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 12:46:40 2015 -0500

--
 CHANGES.txt |   1 +
 pylib/cqlshlib/cql3handling.py  |   8 +-
 .../cassandra/auth/AuthMigrationListener.java   |  10 +
 .../cassandra/auth/CassandraRoleManager.java|   8 +-
 .../apache/cassandra/auth/FunctionResource.java | 327 +++
 .../org/apache/cassandra/auth/Permission.java   |   7 +-
 .../org/apache/cassandra/auth/Resources.java|   2 +
 .../apache/cassandra/cql3/AbstractMarker.java   |   8 +
 .../org/apache/cassandra/cql3/Attributes.java   |  16 +
 .../org/apache/cassandra/cql3/CQLStatement.java |   7 +-
 .../apache/cassandra/cql3/ColumnCondition.java  |  23 +-
 src/java/org/apache/cassandra/cql3/Cql.g|  27 +-
 src/java/org/apache/cassandra/cql3/Json.java|  15 +-
 src/java/org/apache/cassandra/cql3/Lists.java   |  12 +-
 src/java/org/apache/cassandra/cql3/Maps.java|  11 +-
 .../org/apache/cassandra/cql3/Operation.java|   7 +
 src/java/org/apache/cassandra/cql3/Sets.java|   7 +-
 src/java/org/apache/cassandra/cql3/Term.java|  13 +
 src/java/org/apache/cassandra/cql3/Terms.java   |  45 +
 src/java/org/apache/cassandra/cql3/Tuples.java  |  10 +-
 .../org/apache/cassandra/cql3/UserTypes.java|   8 +-
 .../cql3/functions/AbstractFunction.java|   6 +
 .../cassandra/cql3/functions/Function.java  |   3 +-
 .../cassandra/cql3/functions/FunctionCall.java  |  15 +-
 .../cassandra/cql3/functions/UDAggregate.java   |   8 +-
 .../ForwardingPrimaryKeyRestrictions.java   |   7 +
 .../restrictions/MultiColumnRestriction.java|  33 +-
 .../restrictions/PrimaryKeyRestrictionSet.java  |   7 +
 .../cql3/restrictions/Restriction.java  |   3 +
 .../cql3/restrictions/RestrictionSet.java   |  20 +-
 .../cql3/restrictions/Restrictions.java |   5 +-
 .../restrictions/SingleColumnRestriction.java   |  46 +-
 .../restrictions/StatementRestrictions.java |  19 +-
 .../cassandra/cql3/restrictions/TermSlice.java  |  17 +
 .../cql3/restrictions/TokenRestriction.java |  13 +
 .../selection/AbstractFunctionSelector.java |   6 +
 .../cassandra/cql3/selection/Selection.java |  27 +-
 .../cassandra/cql3/selection/Selector.java  |   9 +-
 .../cql3/selection/SelectorFactories.java   |  20 +-
 .../cql3/statements/BatchStatement.java |  16 +-
 .../statements/CreateAggregateStatement.java| 130 ++-
 .../statements/CreateFunctionStatement.java |  59 +-
 .../statements/CreateKeyspaceStatement.java |  14 +-
 .../cql3/statements/DropFunctionStatement.java  | 121 ++-
 .../cql3/statements/ModificationStatement.java  |  68 +-
 .../cql3/statements/ParsedStatement.java|   6 +
 .../PermissionsManagementStatement.java |  13 +-
 .../cql3/statements/SelectStatement.java|  21 +-
 .../apache/cassandra/service/ClientState.java   |  31 +
 .../org/apache/cassandra/cql3/UFAuthTest.java   | 945 +++
 .../cassandra/cql3/UFIdentificationTest.java| 375 
 test/unit/org/apache/cassandra/cql3/UFTest.java |  45 +-
 52 files changed, 2443 insertions(+), 237 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb5897f3/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 4a1cd1c..973b1bd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0
+ * Add user/role permissions for user-defined functions (CASSANDRA-7557)
  * Allow cassandra config to be updated to restart daemon without unloading 
classes (CASSANDRA-9046)
  * Don't initialize compaction writer before checking if iter is empty 
(CASSANDRA-9117)
  * Remove line number generation from default logback.xml

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb5897f3/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index a728fed..bc638b6 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -1207,7 +1207,7 @@ syntax_rules += r'''
 '''
 
 syntax_rules += r'''
- ::= "GRANT"  "ON"   "TO" 
+ ::= "GRANT"  "ON"  "TO" 
;
 
  ::= "REVOKE"  "ON"  "FROM" 

@@ -1224,6 +1224,7 @@ syntax_rules += r''

[3/4] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread brandonwilliams
Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/cassandra-2.1
Commit: cba1b68dbececb2aba500d56059e99bdab058b10
Parents: f59df28
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:45:23 2015 -0500

--
 CHANGES.txt |  2 +
 .../cassandra/service/StorageService.java   | 57 ++--
 2 files changed, 32 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cba1b68d/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index d64ebc5..dfd5649 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -75,6 +75,8 @@
  * Use stdout for progress and stats in sstableloader (CASSANDRA-8982)
  * Correctly identify 2i datadir from older versions (CASSANDRA-9116)
 Merged from 2.0:
+2.0.15:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cba1b68d/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index a5fa563..c212d0d 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1479,34 +1479,37 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
value.value);
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
-break;
-case RPC_ADDRESS:
-try
-{
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
InetAddress.getByName(value.value));
-}
-catch (UnknownHostException e)
-{
-throw new RuntimeException(e);
-}
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
UUID.fromString(value.value));
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
UUID.fromString(value.value));
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", value.value);
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
+break;
+case RPC_ADDRESS:
+try
+{
+SystemKeyspace.updatePeerInfo(endpoint, 
"rpc_address", InetAddress.getByName(value.value));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+break;
+case SCHEMA:
+SystemKeyspace.updatePeerInfo(endpoint, 
"schema_version", UUID.fromString(value.value));
+MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
+break;
+case HOST_ID:
+SystemKeyspac

[1/4] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 f59df2893 -> cba1b68db
  refs/heads/trunk c74f22522 -> d6a4b4548


Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/trunk
Commit: dcde8cac0d6d96c342c6409a189edc372ddcb203
Parents: c74f225
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:44:13 2015 -0500

--
 CHANGES.txt |  5 +-
 .../cassandra/service/StorageService.java   | 63 ++--
 2 files changed, 34 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dcde8cac/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 063a39b..4a1cd1c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -94,12 +94,8 @@
  * Save repair data to system table (CASSANDRA-5839)
 
 2.1.5
-<<< HEAD
  * Add generate-idea-files target to build.xml (CASSANDRA-9123)
-||| merged common ancestors
-===
  * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
->>> cassandra-2.1
  * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
  * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)
  * cqlsh: quote column names when needed in COPY FROM inserts (CASSANDRA-9080)
@@ -171,6 +167,7 @@
  * Use stdout for progress and stats in sstableloader (CASSANDRA-8982)
  * Correctly identify 2i datadir from older versions (CASSANDRA-9116)
 Merged from 2.0:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dcde8cac/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index e0fb8b2..e07c0b1 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1612,37 +1612,40 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
value.value);
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
-break;
-case RPC_ADDRESS:
-try
-{
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
InetAddress.getByName(value.value));
-}
-catch (UnknownHostException e)
-{
-throw new RuntimeException(e);
-}
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
UUID.fromString(value.value));
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
UUID.fromString(value.value));
-break;
-case RPC_READY:
-notifyRpcChange(endpoint, epState.isRpcReady());
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", value.value);
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
+br

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

2015-04-14 Thread brandonwilliams
Merge branch 'cassandra-2.1' into trunk

Conflicts:
CHANGES.txt
src/java/org/apache/cassandra/service/StorageService.java


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

Branch: refs/heads/trunk
Commit: d6a4b4548f780b1f27177beda76a2c7a2b341412
Parents: dcde8ca cba1b68
Author: Brandon Williams 
Authored: Tue Apr 14 12:46:04 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:46:04 2015 -0500

--

--




[jira] [Updated] (CASSANDRA-9189) DROP ROLE shouldn't cache information about non-existent roles

2015-04-14 Thread Sam Tunnicliffe (JIRA)

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

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

Trival patch to prevent {{DropRoleStatement}} from caching anything about 
non-existent roles and added a dtest 
[here|https://github.com/riptano/cassandra-dtest/pull/233]

Related: after CASSANDRA-8967 is done, test code could programatically 
invalidate the cache between the {{DROP}} and {{CREATE}} statements, but I 
think this is worth doing anyway.


> DROP ROLE shouldn't cache information about non-existent roles
> --
>
> Key: CASSANDRA-9189
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9189
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sam Tunnicliffe
>Assignee: Sam Tunnicliffe
> Fix For: 3.0
>
> Attachments: 9189.txt
>
>
> {{DropRoleStatement#checkAccess}} involves a check of the target role's 
> superuser status in order to ensure that only superusers can drop another  
> with su privileges.
> When used in conjunction with {{IF EXISTS}}, this causes a cache entry for a 
> non-existent role to be inserted into the roles cache as 
> {{Roles#hasSuperuserStatus}} goes via the cache. {{RolesCache}} is a map from 
> a single role to the set of roles of which it has transitively been granted 
> (basically a map of {{RoleResource}} -> {{Set}}). So in this 
> case an empty set is cached for the role. 
> This can be problematic when the {{DROP ROLE IF EXISTS}} is followed by a 
> {{CREATE ROLE}} as until the cache entry expires any authorization request 
> for that role will use the cache to fetch the set of roles that need to be 
> included in the permission check. Finding an empty set, all authz checks will 
> result in failure. This pattern is particularly common in automated tests.



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


[2/4] cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread brandonwilliams
Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/trunk
Commit: cba1b68dbececb2aba500d56059e99bdab058b10
Parents: f59df28
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:45:23 2015 -0500

--
 CHANGES.txt |  2 +
 .../cassandra/service/StorageService.java   | 57 ++--
 2 files changed, 32 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cba1b68d/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index d64ebc5..dfd5649 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -75,6 +75,8 @@
  * Use stdout for progress and stats in sstableloader (CASSANDRA-8982)
  * Correctly identify 2i datadir from older versions (CASSANDRA-9116)
 Merged from 2.0:
+2.0.15:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cba1b68d/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index a5fa563..c212d0d 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1479,34 +1479,37 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
value.value);
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
-break;
-case RPC_ADDRESS:
-try
-{
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
InetAddress.getByName(value.value));
-}
-catch (UnknownHostException e)
-{
-throw new RuntimeException(e);
-}
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
UUID.fromString(value.value));
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
UUID.fromString(value.value));
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", value.value);
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
value.value);
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
value.value);
+break;
+case RPC_ADDRESS:
+try
+{
+SystemKeyspace.updatePeerInfo(endpoint, 
"rpc_address", InetAddress.getByName(value.value));
+}
+catch (UnknownHostException e)
+{
+throw new RuntimeException(e);
+}
+break;
+case SCHEMA:
+SystemKeyspace.updatePeerInfo(endpoint, 
"schema_version", UUID.fromString(value.value));
+MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
+break;
+case HOST_ID:
+SystemKeyspace.update

[jira] [Reopened] (CASSANDRA-8005) Server-side DESCRIBE

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis reopened CASSANDRA-8005:
---

> Server-side DESCRIBE
> 
>
> Key: CASSANDRA-8005
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8005
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Tyler Hobbs
>Priority: Minor
>  Labels: client-impacting, cql3
>
> The various {{DESCRIBE}} commands are currently implemented by cqlsh, and 
> nearly identical implementations exist in many drivers.  There are several 
> motivations for making {{DESCRIBE}} part of the CQL language:
> * Eliminate the (fairly complex) duplicate implementations across drivers and 
> cqlsh
> * Get closer to allowing drivers to not have to fetch the schema tables. 
> (Minor changes to prepared statements are also needed.)
> * Have instantaneous support for new schema features in cqlsh.  (You 
> currently have to update the bundled python driver.)
> * Support writing out schemas where it makes sense.  One good example of this 
> is backups.  You need to restore the schema before restoring data in the case 
> of total loss, so it makes sense to write out the schema alongside snapshots.



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


[jira] [Resolved] (CASSANDRA-8005) Server-side DESCRIBE

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis resolved CASSANDRA-8005.
---
   Resolution: Won't Fix
Fix Version/s: (was: 3.0)

> Server-side DESCRIBE
> 
>
> Key: CASSANDRA-8005
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8005
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Tyler Hobbs
>Priority: Minor
>  Labels: client-impacting, cql3
>
> The various {{DESCRIBE}} commands are currently implemented by cqlsh, and 
> nearly identical implementations exist in many drivers.  There are several 
> motivations for making {{DESCRIBE}} part of the CQL language:
> * Eliminate the (fairly complex) duplicate implementations across drivers and 
> cqlsh
> * Get closer to allowing drivers to not have to fetch the schema tables. 
> (Minor changes to prepared statements are also needed.)
> * Have instantaneous support for new schema features in cqlsh.  (You 
> currently have to update the bundled python driver.)
> * Support writing out schemas where it makes sense.  One good example of this 
> is backups.  You need to restore the schema before restoring data in the case 
> of total loss, so it makes sense to write out the schema alongside snapshots.



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


[jira] [Resolved] (CASSANDRA-8005) Server-side DESCRIBE

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis resolved CASSANDRA-8005.
---
Resolution: Fixed

Exposing schema metadata to the clients is a Good Thing, no argument there.  
But the right way to do that is CASSANDRA-6717.  If clients want to add a 
toString to that, they can (but IMO it's a misfeature).

> Server-side DESCRIBE
> 
>
> Key: CASSANDRA-8005
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8005
> Project: Cassandra
>  Issue Type: New Feature
>  Components: API
>Reporter: Tyler Hobbs
>Priority: Minor
>  Labels: client-impacting, cql3
> Fix For: 3.0
>
>
> The various {{DESCRIBE}} commands are currently implemented by cqlsh, and 
> nearly identical implementations exist in many drivers.  There are several 
> motivations for making {{DESCRIBE}} part of the CQL language:
> * Eliminate the (fairly complex) duplicate implementations across drivers and 
> cqlsh
> * Get closer to allowing drivers to not have to fetch the schema tables. 
> (Minor changes to prepared statements are also needed.)
> * Have instantaneous support for new schema features in cqlsh.  (You 
> currently have to update the bundled python driver.)
> * Support writing out schemas where it makes sense.  One good example of this 
> is backups.  You need to restore the schema before restoring data in the case 
> of total loss, so it makes sense to write out the schema alongside snapshots.



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Nick Bailey (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494458#comment-14494458
 ] 

Nick Bailey commented on CASSANDRA-9179:


I'm not necessarily advocating for minor vs. major, but I'll also point out 
that this issue also affects the "cloning" use case for backup/restore. It will 
be difficult to do a PIT clone of a table to a different cluster (although it 
is already fairly difficult since all commitlogs would need to be replayed on 
all nodes in the case of a different topology).

And just in general, it's fine to say that a perfect user will never actually 
need to this but the reality is that eventually someone will want to. At the 
time of a restore to fix some issue and get an application running again is not 
a great place to run into gotchas and complicated workarounds.

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Priority: Minor
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


cassandra git commit: Fix failed bootstrap/replace attempts being persisted in system.peers

2015-04-14 Thread brandonwilliams
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 def4835e6 -> ac46747f8


Fix failed bootstrap/replace attempts being persisted in system.peers

Patch by brandonwilliams, reviewed by slebresne for CASSANDRA-9180


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

Branch: refs/heads/cassandra-2.0
Commit: ac46747f84e62f6c9cbad0fb2e67a0eb95f43b01
Parents: def4835
Author: Brandon Williams 
Authored: Tue Apr 14 12:19:53 2015 -0500
Committer: Brandon Williams 
Committed: Tue Apr 14 12:19:53 2015 -0500

--
 CHANGES.txt |  1 +
 .../cassandra/service/StorageService.java   | 43 +++-
 2 files changed, 24 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 772afd6..36d4b47 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Fix failed bootstrap/replace attempts being persisted in system.peers 
(CASSANDRA-9180)
  * Flush system.IndexInfo after marking index built (CASSANDRA-9128)
  * Fix updates to min/max_compaction_threshold through cassandra-cli
(CASSANDRA-8102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ac46747f/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index cfd8fe1..e906f03 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1366,27 +1366,30 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 return;
 }
 
-switch (state)
+if (getTokenMetadata().isMember(endpoint))
 {
-case RELEASE_VERSION:
-SystemKeyspace.updatePeerInfo(endpoint, "release_version", 
quote(value.value));
-break;
-case DC:
-SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
-break;
-case RACK:
-SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
-break;
-case RPC_ADDRESS:
-SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
-break;
-case SCHEMA:
-SystemKeyspace.updatePeerInfo(endpoint, "schema_version", 
value.value);
-MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
-break;
-case HOST_ID:
-SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
-break;
+switch (state)
+{
+case RELEASE_VERSION:
+SystemKeyspace.updatePeerInfo(endpoint, 
"release_version", quote(value.value));
+break;
+case DC:
+SystemKeyspace.updatePeerInfo(endpoint, "data_center", 
quote(value.value));
+break;
+case RACK:
+SystemKeyspace.updatePeerInfo(endpoint, "rack", 
quote(value.value));
+break;
+case RPC_ADDRESS:
+SystemKeyspace.updatePeerInfo(endpoint, "rpc_address", 
quote(value.value));
+break;
+case SCHEMA:
+SystemKeyspace.updatePeerInfo(endpoint, 
"schema_version", value.value);
+MigrationManager.instance.scheduleSchemaPull(endpoint, 
epState);
+break;
+case HOST_ID:
+SystemKeyspace.updatePeerInfo(endpoint, "host_id", 
value.value);
+break;
+}
 }
 }
 }



[jira] [Created] (CASSANDRA-9189) DROP ROLE shouldn't cache information about non-existent roles

2015-04-14 Thread Sam Tunnicliffe (JIRA)
Sam Tunnicliffe created CASSANDRA-9189:
--

 Summary: DROP ROLE shouldn't cache information about non-existent 
roles
 Key: CASSANDRA-9189
 URL: https://issues.apache.org/jira/browse/CASSANDRA-9189
 Project: Cassandra
  Issue Type: Bug
Reporter: Sam Tunnicliffe
Assignee: Sam Tunnicliffe
 Fix For: 3.0


{{DropRoleStatement#checkAccess}} involves a check of the target role's 
superuser status in order to ensure that only superusers can drop another  with 
su privileges.

When used in conjunction with {{IF EXISTS}}, this causes a cache entry for a 
non-existent role to be inserted into the roles cache as 
{{Roles#hasSuperuserStatus}} goes via the cache. {{RolesCache}} is a map from a 
single role to the set of roles of which it has transitively been granted 
(basically a map of {{RoleResource}} -> {{Set}}). So in this case 
an empty set is cached for the role. 

This can be problematic when the {{DROP ROLE IF EXISTS}} is followed by a 
{{CREATE ROLE}} as until the cache entry expires any authorization request for 
that role will use the cache to fetch the set of roles that need to be included 
in the permission check. Finding an empty set, all authz checks will result in 
failure. This pattern is particularly common in automated tests.



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


[jira] [Updated] (CASSANDRA-8978) CQLSSTableWriter causes ArrayIndexOutOfBoundsException

2015-04-14 Thread Carl Yeksigian (JIRA)

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

Carl Yeksigian updated CASSANDRA-8978:
--
Attachment: 8978-2.0-v2.txt

Yeah, it will happen on 2.0 as well; attaching a patch for it.

> CQLSSTableWriter causes ArrayIndexOutOfBoundsException
> --
>
> Key: CASSANDRA-8978
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8978
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: 3.8.0-42-generic #62~precise1-Ubuntu SMP Wed Jun 4 
> 22:04:18 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> java version "1.8.0_20"
> Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
> Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
>Reporter: Thomas Borg Salling
>Assignee: Carl Yeksigian
> Fix For: 2.1.5
>
> Attachments: 8978-2.0-v2.txt, 8978-2.1-v2.txt, 8978-2.1.txt, 
> test-8978.txt
>
>
> On long-running jobs with CQLSSTableWriter preparing sstables for later bulk 
> load via sstableloader, occassionally I get the sporadic error shown below.
> I can run the exact same job again - and it will succeed or fail with the 
> same error at another location in the input stream. The error is appears to 
> occur "randomly" - with the same input it may occur never, early or late in 
> the run with no apparent logic or system.
> I use five instances of CQLSSTableWriter in the application (to write 
> redundantly to five different tables). But these instances do not exist at 
> the same time; and thus never used concurrently.
> {code}
> 09:26:33.582 [main] INFO  d.dma.ais.store.FileSSTableConverter - Finished 
> processing directory, 369582175 packets was converted from /nas1/
> Exception in thread "main" java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at dk.dma.commons.app.CliCommandList$1.execute(CliCommandList.java:50)
> at dk.dma.commons.app.CliCommandList.invoke(CliCommandList.java:80)
> at dk.dma.ais.store.Main.main(Main.java:34)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 297868
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.append(ArrayBackedSortedColumns.java:196)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.appendOrReconcile(ArrayBackedSortedColumns.java:191)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.sortCells(ArrayBackedSortedColumns.java:176)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.maybeSortCells(ArrayBackedSortedColumns.java:125)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.access$1100(ArrayBackedSortedColumns.java:44)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns$CellCollection.iterator(ArrayBackedSortedColumns.java:622)
> at 
> org.apache.cassandra.db.ColumnFamily.iterator(ColumnFamily.java:476)
> at 
> org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:129)
> at 
> org.apache.cassandra.io.sstable.SSTableWriter.rawAppend(SSTableWriter.java:233)
> at 
> org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:218)
> at 
> org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter$DiskWriter.run(SSTableSimpleUnsortedWriter.java:215){code}
> So far I overcome this problem by simply retrying with another run of the 
> application in attempt to generate the sstables. But this is a rather time 
> consuming and shaky approach - and I feel a bit uneasy relying on the 
> produced sstables, though their contents appear to be correct when I sample 
> them with cqlsh 'select' after load into Cassandra.



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


[jira] [Updated] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-9179:
--
Priority: Minor  (was: Major)
Assignee: (was: Branimir Lambov)

I (modestly) agree that it would be useful, but I'll set the priority to Minor 
now. :)

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Priority: Minor
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Mike Bulman (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494442#comment-14494442
 ] 

Mike Bulman commented on CASSANDRA-9179:


Given this only affects DROP, I'll concede that "explicit DROP means you don't 
need the data anymore" and "if you accidentally DROP a table, auto_snapshot is 
your friend".  I do think {{CREATE TABLE ... WITH ID}} would be helpful for 
those edge cases though for both commitlogs and plain old snapshot restores 
(being able to compare table ID for compatibility validation before hand)

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Updated] (CASSANDRA-8348) allow takeColumnFamilySnapshot to take a list of ColumnFamilies

2015-04-14 Thread Jonathan Ellis (JIRA)

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

Jonathan Ellis updated CASSANDRA-8348:
--
Assignee: Sachin Janani

> allow takeColumnFamilySnapshot to take a list of ColumnFamilies
> ---
>
> Key: CASSANDRA-8348
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8348
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Peter Halliday
>Assignee: Sachin Janani
>Priority: Minor
> Fix For: 2.1.5
>
> Attachments: 8348_21.patch, 8348_trunk.patch, 8348_v2.patch, 
> Patch-8348.patch
>
>
> Within StorageServiceMBean.java the function takeSnapshot allows for a list 
> of keyspaces to snapshot.  However, the function takeColumnFamilySnapshot 
> only allows for a single ColumnFamily to snapshot.  This should allow for 
> multiple ColumnFamilies within the same Keyspace.



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


[3/3] cassandra git commit: merge from 2.1

2015-04-14 Thread jbellis
merge from 2.1


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

Branch: refs/heads/trunk
Commit: c74f2252201be2e55e6fc68b7dbcc520472c2b63
Parents: 23e77f1 f59df28
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:27:34 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:27:34 2015 -0500

--
 CHANGES.txt |   5 +
 .../cassandra/service/StorageService.java   | 218 ---
 .../cassandra/service/StorageServiceMBean.java  |  10 +
 .../org/apache/cassandra/tools/NodeProbe.java   |  61 +-
 .../cassandra/tools/nodetool/Snapshot.java  |  43 +++-
 5 files changed, 288 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c74f2252/CHANGES.txt
--
diff --cc CHANGES.txt
index 9f89e3f,d64ebc5..063a39b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,100 -1,5 +1,105 @@@
 +3.0
 + * Allow cassandra config to be updated to restart daemon without unloading 
classes (CASSANDRA-9046)
 + * Don't initialize compaction writer before checking if iter is empty 
(CASSANDRA-9117)
 + * Remove line number generation from default logback.xml
 + * Don't execute any functions at prepare-time (CASSANDRA-9037)
 + * Share file handles between all instances of a SegmentedFile 
(CASSANDRA-8893)
 + * Make it possible to major compact LCS (CASSANDRA-7272)
 + * Make FunctionExecutionException extend RequestExecutionException
 +   (CASSANDRA-9055)
 + * Add support for SELECT JSON, INSERT JSON syntax and new toJson(), 
fromJson()
 +   functions (CASSANDRA-7970)
 + * Optimise max purgeable timestamp calculation in compaction (CASSANDRA-8920)
 + * Constrain internode message buffer sizes, and improve IO class hierarchy 
(CASSANDRA-8670) 
 + * New tool added to validate all sstables in a node (CASSANDRA-5791)
 + * Push notification when tracing completes for an operation (CASSANDRA-7807)
 + * Delay "node up" and "node added" notifications until native protocol 
server is started (CASSANDRA-8236)
 + * Compressed Commit Log (CASSANDRA-6809)
 + * Optimise IntervalTree (CASSANDRA-8988)
 + * Add a key-value payload for third party usage (CASSANDRA-8553)
 + * Bump metrics-reporter-config dependency for metrics 3.0 (CASSANDRA-8149)
 + * Partition intra-cluster message streams by size, not type (CASSANDRA-8789)
 + * Add WriteFailureException to native protocol, notify coordinator of
 +   write failures (CASSANDRA-8592)
 + * Convert SequentialWriter to nio (CASSANDRA-8709)
 + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760, 8849, 
8761, 8850)
 + * Record client ip address in tracing sessions (CASSANDRA-8162)
 + * Indicate partition key columns in response metadata for prepared
 +   statements (CASSANDRA-7660)
 + * Merge UUIDType and TimeUUIDType parse logic (CASSANDRA-8759)
 + * Avoid memory allocation when searching index summary (CASSANDRA-8793)
 + * Optimise (Time)?UUIDType Comparisons (CASSANDRA-8730)
 + * Make CRC32Ex into a separate maven dependency (CASSANDRA-8836)
 + * Use preloaded jemalloc w/ Unsafe (CASSANDRA-8714)
 + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
 + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
 + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order and ignore duplicate values in partition key IN 
restrictions (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229

[1/3] cassandra git commit: Allow takeColumnFamilySnapshot to take a list of tables patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348

2015-04-14 Thread jbellis
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 7323f51e8 -> f59df2893
  refs/heads/trunk 23e77f10a -> c74f22522


Allow takeColumnFamilySnapshot to take a list of tables
patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348


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

Branch: refs/heads/cassandra-2.1
Commit: f59df2893b66b3a8715b9792679e51815982a542
Parents: 7323f51
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:27:00 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:27:00 2015 -0500

--
 CHANGES.txt |   1 +
 .../cassandra/service/StorageService.java   | 183 ---
 .../cassandra/service/StorageServiceMBean.java  |  14 +-
 .../org/apache/cassandra/tools/NodeProbe.java   |  81 ++--
 .../org/apache/cassandra/tools/NodeTool.java| 119 +---
 5 files changed, 330 insertions(+), 68 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f59df289/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5427ce5..d64ebc5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.5
+ * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
  * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
  * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)
  * cqlsh: quote column names when needed in COPY FROM inserts (CASSANDRA-9080)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f59df289/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index dc2a777..a5fa563 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -17,6 +17,8 @@
  */
 package org.apache.cassandra.service;
 
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.File;
@@ -25,8 +27,29 @@ import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -38,21 +61,6 @@ import javax.management.ObjectName;
 import javax.management.openmbean.TabularData;
 import javax.management.openmbean.TabularDataSupport;
 
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.jmx.JMXConfiguratorMBean;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.Appender;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Predicate;
-import com.google.common.collect.*;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.Uninterruptibles;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.cassandra.auth.Auth;
 import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.concurrent.Stage;
@@ -61,20 +69,53 @@ import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
 import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.db.*;
+import org.apache.cassandra.db.BatchlogManager;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.CounterMutationVerbHandler;
+import org.apache.cassandr

[2/3] cassandra git commit: Allow takeColumnFamilySnapshot to take a list of tables patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348

2015-04-14 Thread jbellis
Allow takeColumnFamilySnapshot to take a list of tables
patch by Sachin Jarin; reviewed by Nick Bailey for CASSANDRA-8348


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

Branch: refs/heads/trunk
Commit: f59df2893b66b3a8715b9792679e51815982a542
Parents: 7323f51
Author: Jonathan Ellis 
Authored: Tue Apr 14 12:27:00 2015 -0500
Committer: Jonathan Ellis 
Committed: Tue Apr 14 12:27:00 2015 -0500

--
 CHANGES.txt |   1 +
 .../cassandra/service/StorageService.java   | 183 ---
 .../cassandra/service/StorageServiceMBean.java  |  14 +-
 .../org/apache/cassandra/tools/NodeProbe.java   |  81 ++--
 .../org/apache/cassandra/tools/NodeTool.java| 119 +---
 5 files changed, 330 insertions(+), 68 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f59df289/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 5427ce5..d64ebc5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.5
+ * Allow takeColumnFamilySnapshot to take a list of tables (CASSANDRA-8348)
  * Limit major sstable operations to their canonical representation 
(CASSANDRA-8669)
  * cqlsh: Add tests for INSERT and UPDATE tab completion (CASSANDRA-9125)
  * cqlsh: quote column names when needed in COPY FROM inserts (CASSANDRA-9080)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f59df289/src/java/org/apache/cassandra/service/StorageService.java
--
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index dc2a777..a5fa563 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -17,6 +17,8 @@
  */
 package org.apache.cassandra.service;
 
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
+
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.File;
@@ -25,8 +27,29 @@ import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -38,21 +61,6 @@ import javax.management.ObjectName;
 import javax.management.openmbean.TabularData;
 import javax.management.openmbean.TabularDataSupport;
 
-import ch.qos.logback.classic.LoggerContext;
-import ch.qos.logback.classic.jmx.JMXConfiguratorMBean;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.Appender;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Predicate;
-import com.google.common.collect.*;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.Uninterruptibles;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.cassandra.auth.Auth;
 import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.concurrent.Stage;
@@ -61,20 +69,53 @@ import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.KSMetaData;
 import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.db.*;
+import org.apache.cassandra.db.BatchlogManager;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.CounterMutationVerbHandler;
+import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.db.DefinitionsUpdateVerbHandler;
+import org.apache.cassandra.db.HintedHandOffManager;
+import

[jira] [Comment Edited] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Mike Bulman (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494255#comment-14494255
 ] 

Mike Bulman edited comment on CASSANDRA-9179 at 4/14/15 5:22 PM:
-

-Two- One thing to add:

* -This also applies to the case where a schema has been changed but then 
reverted, leaving you with an identical and compatible schema, but a separate 
table id and no ability to replay commitlogs-  Update: I've been informed 
changing schema does not impact table ID
* auto snapshot does not help if you want to restore to a point in time prior 
to the drop


was (Author: mbulman):
Two things to add:

* This also applies to the case where a schema has been changed but then 
reverted, leaving you with an identical and compatible schema, but a separate 
table id and no ability to replay commitlogs
* auto snapshot does not help if you want to restore to a point in time prior 
to the drop

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Commented] (CASSANDRA-9180) Failed bootstrap/replace attempts persist entries in system.peers

2015-04-14 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494420#comment-14494420
 ] 

Sylvain Lebresne commented on CASSANDRA-9180:
-

+1

> Failed bootstrap/replace attempts persist entries in system.peers
> -
>
> Key: CASSANDRA-9180
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9180
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Brandon Williams
>Assignee: Brandon Williams
> Fix For: 2.0.15, 2.1.5
>
> Attachments: 9081.txt
>
>
> In working on CASSANDRA-8336, I discovered vanilla C* has this problem.  Just 
> start a bootstrap or replace and kill it during the ring info gathering 
> phase. System.peers, the gift that keeps on giving.



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


[jira] [Commented] (CASSANDRA-9137) nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true

2015-04-14 Thread Ariel Weisberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494419#comment-14494419
 ] 

Ariel Weisberg commented on CASSANDRA-9137:
---

OK I am +1 for this change

> nodetool doesn't work when Cassandra run with the property 
> java.net.preferIPv6Addresses=true
> 
>
> Key: CASSANDRA-9137
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9137
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Andrey Trubachev
> Fix For: 2.0.15, 2.1.5
>
> Attachments: cassandra-2.0.14-9137.txt, cassandra-2.1.4-9137.txt
>
>
> nodetool doesn't work when Cassandra run with the property 
> {{java.net.preferIPv6Addresses=true}}.
> {noformat}
> $ sudo netstat -tlpn | grep $(cat /var/run/cassandra/cassandra.pid) | grep 
> 7199
> tcp6   0  0 ::1:7199:::*LISTEN
>   27560/java
> {noformat}
> {noformat}
> $ nodetool -h ::1 status
> nodetool: Failed to connect to '::1:7199' - ConnectException: 'Connection 
> refused'.
> {noformat}
> Hardcoded value  of the property {{java.rmi.server.hostname}} 
> (https://github.com/apache/cassandra/blob/cassandra-2.1.4/src/java/org/apache/cassandra/service/CassandraDaemon.java#L91)
>  makes RMI returns the address {{127.0.0.1}} instead of {{::1}} that 
> jmxServer listens to.
> {noformat}
> 21:52:26.300192 IP6 (hlim 64, next-header TCP (6) payload length: 259) 
> ::1.7199 > ::1.58706: Flags [P.], cksum 0x010b (incorrect -> 0x6a57), seq 
> 23:250, ack 88, win 2048, options [nop,nop,TS val 1833457 ecr 1833456], 
> length 227
> `..@...R.4./...
> Qw..SZ.y...L.[sr..javax.management.remote.rmi.RMIServerImpl_Stub...pxr..java.rmi.server.RemoteStub..epxr..javSZ.y...L.[.xoteObject.a...a3pxpw4..UnicastRef2..
>  127.0.0.1...(.Ld
> 21:52:26.336400 IP6 (hlim 64, next-header TCP (6) payload length: 32) 
> ::1.58706 > ::1.7199: Flags [.], cksum 0x0028 (incorrect -> 0xfe1c), seq 88, 
> ack 250, win 2048, options [nop,nop,TS val 1833467 ecr 1833457], length 0
> ` .@.R./.4...(.
> 
> {noformat}
> jmxServer listens to the an ip address that was resolved from {{localhost}} 
> and it depends on value of the property {{java.net.preferIPv6Addresses}} or 
> lack of it (
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/RMIServerSocketFactoryImpl.java#L13).
> This is a simple patch that works correctly with 
> {{java.net.preferIPv6Addresses=(true|false)}} and 
> {{java.net.preferIPv4Stack=(true|false)}}:
> {code}
> diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
> b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> index 3e398bf..66e9cca 100644
> --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
> +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
> @@ -88,7 +88,7 @@ public class CassandraDaemon
>  }
>  else
>  {
> -System.setProperty("java.rmi.server.hostname","127.0.0.1");
> +System.setProperty("java.rmi.server.hostname", 
> InetAddress.getLoopbackAddress().getHostAddress());
>  try
>  {
> {code}



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


[jira] [Commented] (CASSANDRA-8978) CQLSSTableWriter causes ArrayIndexOutOfBoundsException

2015-04-14 Thread Benjamin Lerer (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494407#comment-14494407
 ] 

Benjamin Lerer commented on CASSANDRA-8978:
---

The patch look good to me but are you sure we do not need also a patch for 2.0?

> CQLSSTableWriter causes ArrayIndexOutOfBoundsException
> --
>
> Key: CASSANDRA-8978
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8978
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: 3.8.0-42-generic #62~precise1-Ubuntu SMP Wed Jun 4 
> 22:04:18 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> java version "1.8.0_20"
> Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
> Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
>Reporter: Thomas Borg Salling
>Assignee: Carl Yeksigian
> Fix For: 2.1.5
>
> Attachments: 8978-2.1-v2.txt, 8978-2.1.txt, test-8978.txt
>
>
> On long-running jobs with CQLSSTableWriter preparing sstables for later bulk 
> load via sstableloader, occassionally I get the sporadic error shown below.
> I can run the exact same job again - and it will succeed or fail with the 
> same error at another location in the input stream. The error is appears to 
> occur "randomly" - with the same input it may occur never, early or late in 
> the run with no apparent logic or system.
> I use five instances of CQLSSTableWriter in the application (to write 
> redundantly to five different tables). But these instances do not exist at 
> the same time; and thus never used concurrently.
> {code}
> 09:26:33.582 [main] INFO  d.dma.ais.store.FileSSTableConverter - Finished 
> processing directory, 369582175 packets was converted from /nas1/
> Exception in thread "main" java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at dk.dma.commons.app.CliCommandList$1.execute(CliCommandList.java:50)
> at dk.dma.commons.app.CliCommandList.invoke(CliCommandList.java:80)
> at dk.dma.ais.store.Main.main(Main.java:34)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 297868
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.append(ArrayBackedSortedColumns.java:196)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.appendOrReconcile(ArrayBackedSortedColumns.java:191)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.sortCells(ArrayBackedSortedColumns.java:176)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.maybeSortCells(ArrayBackedSortedColumns.java:125)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns.access$1100(ArrayBackedSortedColumns.java:44)
> at 
> org.apache.cassandra.db.ArrayBackedSortedColumns$CellCollection.iterator(ArrayBackedSortedColumns.java:622)
> at 
> org.apache.cassandra.db.ColumnFamily.iterator(ColumnFamily.java:476)
> at 
> org.apache.cassandra.db.ColumnIndex$Builder.build(ColumnIndex.java:129)
> at 
> org.apache.cassandra.io.sstable.SSTableWriter.rawAppend(SSTableWriter.java:233)
> at 
> org.apache.cassandra.io.sstable.SSTableWriter.append(SSTableWriter.java:218)
> at 
> org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter$DiskWriter.run(SSTableSimpleUnsortedWriter.java:215){code}
> So far I overcome this problem by simply retrying with another run of the 
> application in attempt to generate the sstables. But this is a rather time 
> consuming and shaky approach - and I feel a bit uneasy relying on the 
> produced sstables, though their contents appear to be correct when I sample 
> them with cqlsh 'select' after load into Cassandra.



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494387#comment-14494387
 ] 

Brandon Williams commented on CASSANDRA-9179:
-

+1, that's a good idea.

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494380#comment-14494380
 ] 

Jonathan Ellis commented on CASSANDRA-9179:
---

IMO the least hackish solution for you would be to allow {{CREATE TABLE ... 
WITH ID}} for when you want to force a table to be recognized as the same as a 
previous incarnation.

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Updated] (CASSANDRA-9173) cqlsh: fix failing tests

2015-04-14 Thread Tyler Hobbs (JIRA)

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

Tyler Hobbs updated CASSANDRA-9173:
---
Attachment: 9173-trunk.txt

> cqlsh: fix failing tests
> 
>
> Key: CASSANDRA-9173
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9173
> Project: Cassandra
>  Issue Type: Test
>Reporter: Jim Witschey
>Assignee: Jim Witschey
>Priority: Minor
>  Labels: cqlsh
> Attachments: 9173-trunk.txt
>
>
> Makes cqlsh tests pass by updating
> - tests that started failing because of changes to the keyspace init script
> - a test that would fail in some timezones and not others.
> This involves a change to the init script -- a timestamp at the beginning of 
> 1900 is interpreted as being in 1899 in some timezones, and that breaks 
> formatting. Changing the date to 1950 removes that edge case. If we want to 
> test that edge case later, we can add it back.
> Passes on CassCI (Ignore the fact that it says it's testing trunk; I edited 
> the script to use my branch):
> http://cassci.datastax.com/job/trunk_cqlshlib/11/
> Changes for review here:
> https://github.com/apache/cassandra/compare/trunk...mambocab:fix-trunk-tests
> Branch with fixes here:
> https://github.com/mambocab/cassandra/tree/fix-trunk-tests



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494370#comment-14494370
 ] 

Jonathan Ellis commented on CASSANDRA-9179:
---

bq. This also applies to the case where a schema has been changed but then 
reverted

As soon as you say DROP TABLE you're telling Cassandra "I don't want this data 
anymore."  Recreating it with the same schema is simply not the same as not 
having dropped it in the first place.

bq. Is it possible to manually change the ID of an existing table as a 
workaround, or will that cause all sorts of Bad Things?

Maybe.  Restarting C* might be necessary.  It definitely assumes that IDs don't 
change right now.

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


cassandra git commit: Update cqlsh tests for latest trunk

2015-04-14 Thread tylerhobbs
Repository: cassandra
Updated Branches:
  refs/heads/trunk 4a3ca5c70 -> 23e77f10a


Update cqlsh tests for latest trunk

Patch by Jim Witschey; reviewed by Tyler Hobbs for CASSANDRA-9173


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

Branch: refs/heads/trunk
Commit: 23e77f10a49775997c98250af4a7147525f2d936
Parents: 4a3ca5c
Author: Jim Witschey 
Authored: Tue Apr 14 11:39:33 2015 -0500
Committer: Tyler Hobbs 
Committed: Tue Apr 14 11:39:33 2015 -0500

--
 bin/cqlsh|  4 +---
 pylib/cqlshlib/cql3handling.py   |  2 +-
 pylib/cqlshlib/test/test_cqlsh_completion.py |  6 --
 pylib/cqlshlib/test/test_cqlsh_output.py | 22 ++
 pylib/cqlshlib/test/test_keyspace_init.cql   |  2 +-
 5 files changed, 17 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/23e77f10/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 79b2a9e..2078107 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -209,8 +209,6 @@ CQL_ERRORS = (
 
 debug_completion = bool(os.environ.get('CQLSH_DEBUG_COMPLETION', '') == 'YES')
 
-SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
-
 # we want the cql parser to understand our cqlsh-specific commands too
 my_commands_ending_with_newline = (
 'help',
@@ -1288,7 +1286,7 @@ class Shell(cmd.Cmd):
 def describe_schema(self, include_system=False):
 print
 for k in self.get_keyspaces():
-if include_system or not k.name in SYSTEM_KEYSPACES:
+if include_system or not k.name in cql3handling.SYSTEM_KEYSPACES:
 self.print_recreate_keyspace(k, sys.stdout)
 print
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/23e77f10/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index ef18c2a..a728fed 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -33,7 +33,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
-SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
+SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth', 
'system_distributed')
 NONALTERBALE_KEYSPACES = ('system')
 
 class Cql3ParsingRuleSet(CqlParsingRuleSet):

http://git-wip-us.apache.org/repos/asf/cassandra/blob/23e77f10/pylib/cqlshlib/test/test_cqlsh_completion.py
--
diff --git a/pylib/cqlshlib/test/test_cqlsh_completion.py 
b/pylib/cqlshlib/test/test_cqlsh_completion.py
index 7c2f0cd..371bddb 100644
--- a/pylib/cqlshlib/test/test_cqlsh_completion.py
+++ b/pylib/cqlshlib/test/test_cqlsh_completion.py
@@ -389,7 +389,8 @@ class TestCqlshCompletion(CqlshCompletionCase):
  'twenty_rows_composite_table',
  'utf8_with_special_chars',
  'system_traces.', 'songs',
- '"' + self.cqlsh.keyspace + '".'])
+ '"' + self.cqlsh.keyspace + '".'],
+other_choices_ok=True)
 
 self.trycompletions('DELETE FROM ',
 choices=['twenty_rows_table',
@@ -401,7 +402,8 @@ class TestCqlshCompletion(CqlshCompletionCase):
  'twenty_rows_composite_table',
  'utf8_with_special_chars',
  'system_traces.', 'songs',
- '"' + self.cqlsh.keyspace + '".'])
+ '"' + self.cqlsh.keyspace + '".'],
+other_choices_ok=True)
 self.trycompletions('DELETE FROM twenty_rows_composite_table ',
 choices=['USING', 'WHERE'])
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/23e77f10/pylib/cqlshlib/test/test_cqlsh_output.py
--
diff --git a/pylib/cqlshlib/test/test_cqlsh_output.py 
b/pylib/cqlshlib/test/test_cqlsh_output.py
index 7a7ed89..40c7efc 100644
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@ -110,14 +110,14 @@ class TestCqlshOutput(BaseTestCase):
 for line in output:
 self.assertNoHasColors(line)

[jira] [Resolved] (CASSANDRA-9086) CAS precondition mismatch - row is still inserted

2015-04-14 Thread Carl Yeksigian (JIRA)

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

Carl Yeksigian resolved CASSANDRA-9086.
---
Resolution: Not A Problem

The issue is that when a connection is disconnected, the CAS transaction is in 
progress, but hasn't completed and the response sent back to the client. The 
retry policy only applies to if there was an exception passed from the server 
to indicate that there was a failure. When we start a new connection and retry 
the transaction, it first completes the in-progress transaction, which causes 
the new connection's transaction to fail due to the row already being present.

In this case, the query should have been failed, because there was no way to 
indicate that this was executed by the same process. This would need to be 
handled within the client.

> CAS precondition mismatch - row is still inserted
> -
>
> Key: CASSANDRA-9086
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9086
> Project: Cassandra
>  Issue Type: Bug
> Environment: Cassandra version 2.0.11
> 24 nodes in 4 datacenters (6 nodes per dc)
>Reporter: Roger Schildmeijer
>Assignee: Carl Yeksigian
>Priority: Critical
> Fix For: 2.0.15
>
> Attachments: conditional_insert_failure_cleaned.txt
>
>
> Cassandra claims CAS precondition didn't match current values[1], but the row 
> is still inserted.
> We are having a quite simple cf schema:
> {code:xml}
> create table index (
>   u text PRIMARY KEY,
>   abc set,
> ) WITH
>   compaction={'class': 'LeveledCompactionStrategy'};
> {code}
> CQL statement:
> {code:xml}
> INSERT INTO index(u, abc) VALUES(?, ?) IF NOT EXISTS
> {code}
> Sometimes, especially during some write load, Cassandra claims the 
> conditional insert wasn't satisfied ([applied] false), but the row is still 
> inserted.
> The response from the conditional insert contains [applied]=false + the data 
> we tried to insert.
> A full CQL trace is attached.
> [1] CAS precondition  CAS precondition 
> org.apache.cassandra.cql3.statements.CQL3CasConditions@1b2576ce does not 
> match current values ColumnFamily(username_index 
> -{deletedAt=-9223372036854775808, localDeletion=2147483647, 
> ranges=[abc-abc:!, deletedAt=1427889576525999, localDeletion=1427889564]}- 
> [:false:0@1427889576526000,abc:39f1a470ee694761a8197c0d0ada8e8f:false:0@1427889576526000,])
>  | 11:59:37.060 | /10.0.0.1 | 533702



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494319#comment-14494319
 ] 

Brandon Williams commented on CASSANDRA-9179:
-

I think that would work, but you'd have to know the old table's ID, and 
probably somehow modify the schema to know about it again.

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Comment Edited] (CASSANDRA-9134) Fix leak detected errors in unit tests

2015-04-14 Thread Stefania (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494305#comment-14494305
 ] 

Stefania edited comment on CASSANDRA-9134 at 4/14/15 4:00 PM:
--

Hi [~thobbs]], would you mind reviewing?


was (Author: stefania):
Hi Tyler, would you mind reviewing?

> Fix leak detected errors in unit tests
> --
>
> Key: CASSANDRA-9134
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9134
> Project: Cassandra
>  Issue Type: Bug
> Environment: Linux
>Reporter: Stefania
>Assignee: Stefania
>Priority: Minor
> Fix For: 3.0
>
>
> There are several of these errors when running unit tests on trunk:
> {code}
> [junit] ERROR 01:09:36 LEAK DETECTED: a reference 
> (org.apache.cassandra.utils.concurrent.Ref$State@317c884a) to class 
> org.apache.cassandra.io.util.SafeMemory$MemoryTidy@943674927:Memory@[7f1bcc0078e0..7f1bcc007908)
>  was not released before the reference was garbage collected
> [junit] ERROR 01:09:36 LEAK DETECTED: a reference 
> (org.apache.cassandra.utils.concurrent.Ref$State@317c884a) to class 
> org.apache.cassandra.io.util.SafeMemory$MemoryTidy@943674927:Memory@[7f1bcc0078e0..7f1bcc007908)
>  was not released before the reference was garbage collected
> [junit] ERROR 01:09:36 Allocate trace 
> org.apache.cassandra.utils.concurrent.Ref$State@317c884a:
> [junit] Thread[CompactionExecutor:1,1,main]
> [junit]   at java.lang.Thread.getStackTrace(Thread.java:1589)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$Debug.(Ref.java:200)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$State.(Ref.java:133)
> [junit]   at org.apache.cassandra.utils.concurrent.Ref.(Ref.java:60)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemory.(SafeMemory.java:33)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemoryWriter.(SafeMemoryWriter.java:31)
> [junit]   at 
> org.apache.cassandra.io.sstable.IndexSummaryBuilder.(IndexSummaryBuilder.java:112)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.(BigTableWriter.java:491)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.(BigTableWriter.java:83)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(BigFormat.java:107)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.SSTableWriter.create(SSTableWriter.java:89)
> [junit]   at 
> org.apache.cassandra.db.compaction.writers.DefaultCompactionWriter.(DefaultCompactionWriter.java:53)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.getCompactionAwareWriter(CompactionTask.java:253)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:153)
> [junit]   at 
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:73)
> [junit]   at 
> org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:58)
> [junit]   at 
> org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionTask.run(CompactionManager.java:239)
> [junit]   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> [junit]   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> [junit]   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [junit]   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [junit]   at java.lang.Thread.run(Thread.java:745)
> [junit] 
> [junit] ERROR 01:09:36 Allocate trace 
> org.apache.cassandra.utils.concurrent.Ref$State@317c884a:
> [junit] Thread[CompactionExecutor:1,1,main]
> [junit]   at java.lang.Thread.getStackTrace(Thread.java:1589)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$Debug.(Ref.java:200)
> [junit]   at 
> org.apache.cassandra.utils.concurrent.Ref$State.(Ref.java:133)
> [junit]   at org.apache.cassandra.utils.concurrent.Ref.(Ref.java:60)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemory.(SafeMemory.java:33)
> [junit]   at 
> org.apache.cassandra.io.util.SafeMemoryWriter.(SafeMemoryWriter.java:31)
> [junit]   at 
> org.apache.cassandra.io.sstable.IndexSummaryBuilder.(IndexSummaryBuilder.java:112)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.(BigTableWriter.java:491)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigTableWriter.(BigTableWriter.java:83)
> [junit]   at 
> org.apache.cassandra.io.sstable.format.big.BigFormat$WriterFactory.open(B

[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Mike Bulman (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494283#comment-14494283
 ] 

Mike Bulman commented on CASSANDRA-9179:


Is it possible to manually change the ID of an existing table as a workaround, 
or will that cause all sorts of Bad Things?

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Commented] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Mike Bulman (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494255#comment-14494255
 ] 

Mike Bulman commented on CASSANDRA-9179:


Two things to add:

* This also applies to the case where a schema has been changed but then 
reverted, leaving you with an identical and compatible schema, but a separate 
table id and no ability to replay commitlogs
* auto snapshot does not help if you want to restore to a point in time prior 
to the drop

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Commented] (CASSANDRA-7557) User permissions for UDFs

2015-04-14 Thread Sam Tunnicliffe (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494249#comment-14494249
 ] 

Sam Tunnicliffe commented on CASSANDRA-7557:


Thanks, none of the things you mention were covered so:

bq. Granting both root/ks-level permissions and individual function 
permissions, ensuring that revoking one does not affect revoking the other

added {{function_resource_hierarchy_permissions_test}}

bq. Similar to drop_function_and_keyspace_cleans_up_udf_permissions_test, test 
that dropping a keyspace drops function-level permissions for functions in that 
keyspace

added {{drop_keyspace_cleans_up_function_level_permissions_test}}

bq. Ensure granting permissions on a builtin function (e.g. system.now) errors 
nicely. Same for REVOKE on builtins and granting EXECUTE on non-function 
objects.

added {{disallow_grant_execute_on_non_function_resources_test}} and 
{{disallow_grant_revoke_on_builtin_functions_test}} (plus a minor change in 
{{PermissionsManagementStatement}} for the latter)

bq. Double granting/revoking is well-behaved (I'm not sure if it's supposed to 
error or succeed)

as grant and revoke are idempotent, the current behaviour (for all resources, 
not just functions) is to silently succeed when both attemtping to grant an 
existing permission or revoke a non-existent one.  I've added 
{{grant_revoke_are_idempotent_test}} to verify (right now it's only concerned 
with function resources, but I'll generalise it when I refactor auth_test & 
auth_roles_test).

bq. Also, in the inheritance_of_udf_permissions_test, shouldn't the GRANT 
EXECUTE statement be executed by the function_user role instead of cassandra?

Actually, the intent was to verify that the EXECUTE permission of function_user 
was inherited when that role was granted, so that final DCL statement should be 
granting function_user to mike. Fixed now, thanks.

I also noticed I'd left a todo in the test for granting/revoking/dropping with 
overloaded functions, so I've added {{udf_with_overloads_permissions_test}}.

> User permissions for UDFs
> -
>
> Key: CASSANDRA-7557
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7557
> Project: Cassandra
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Tyler Hobbs
>Assignee: Sam Tunnicliffe
>  Labels: client-impacting, cql, udf
> Fix For: 3.0
>
>
> We probably want some new permissions for user defined functions.  Most 
> RDBMSes split function permissions roughly into {{EXECUTE}} and 
> {{CREATE}}/{{ALTER}}/{{DROP}} permissions.



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


[jira] [Commented] (CASSANDRA-8348) allow takeColumnFamilySnapshot to take a list of ColumnFamilies

2015-04-14 Thread Nick Bailey (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494200#comment-14494200
 ] 

Nick Bailey commented on CASSANDRA-8348:


+1 from me. Tested the patches out on 3.0 and 2.1

> allow takeColumnFamilySnapshot to take a list of ColumnFamilies
> ---
>
> Key: CASSANDRA-8348
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8348
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Peter Halliday
>Priority: Minor
> Fix For: 2.1.5
>
> Attachments: 8348_21.patch, 8348_trunk.patch, 8348_v2.patch, 
> Patch-8348.patch
>
>
> Within StorageServiceMBean.java the function takeSnapshot allows for a list 
> of keyspaces to snapshot.  However, the function takeColumnFamilySnapshot 
> only allows for a single ColumnFamily to snapshot.  This should allow for 
> multiple ColumnFamilies within the same Keyspace.



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


[jira] [Updated] (CASSANDRA-9187) When altering a UDT only the UDT keyspace should be searched

2015-04-14 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-9187:
--
 Reviewer: Tyler Hobbs
Fix Version/s: 2.1.5

> When altering a UDT only the UDT keyspace should be searched
> 
>
> Key: CASSANDRA-9187
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9187
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Benjamin Lerer
>Assignee: Benjamin Lerer
>Priority: Minor
> Fix For: 2.1.5
>
> Attachments: 9187.txt
>
>
> In {{AlterTypeStatement}} when a {{UDT}} is modified the code checks all the 
> existing Keyspaces for tables using this {{UDT}}. As a {{UDT}} can only be 
> used in the Keyspace in which it has been created we can limit the search to 
> the {{UDT}} keyspace. 



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


[jira] [Updated] (CASSANDRA-9187) When altering a UDT only the UDT keyspace should be searched

2015-04-14 Thread Benjamin Lerer (JIRA)

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

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

The patch limit the search to the UDT keyspace and add some unit tests to 
verify the correct behavior.

> When altering a UDT only the UDT keyspace should be searched
> 
>
> Key: CASSANDRA-9187
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9187
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Benjamin Lerer
>Assignee: Benjamin Lerer
>Priority: Minor
> Attachments: 9187.txt
>
>
> In {{AlterTypeStatement}} when a {{UDT}} is modified the code checks all the 
> existing Keyspaces for tables using this {{UDT}}. As a {{UDT}} can only be 
> used in the Keyspace in which it has been created we can limit the search to 
> the {{UDT}} keyspace. 



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


[jira] [Commented] (CASSANDRA-9062) Investigate failing collection indexing dtests

2015-04-14 Thread Sam Tunnicliffe (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-9062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494107#comment-14494107
 ] 

Sam Tunnicliffe commented on CASSANDRA-9062:


Thanks [~benedict], would you mind committing please?

> Investigate failing collection indexing dtests
> --
>
> Key: CASSANDRA-9062
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9062
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tests
>Reporter: Tyler Hobbs
>Assignee: Sam Tunnicliffe
> Fix For: 3.0
>
> Attachments: 9062.txt
>
>
> There are frequent failures with the dtests related to indexing collections 
> ({{secondary_indexes_test.py:TestSecondaryIndexesOnCollections}}).
> I tried to look into the reason for failure.  The test does seem to be 
> correct, because it can occasionally pass.  It seems like the failures are 
> due to indexing lagging behind the inserts, resulting in a partial set of 
> results when the index is queried shortly afterwards (getting ~20k matching 
> rows instead of the expected 50k).



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


[jira] [Commented] (CASSANDRA-7556) Update cqlsh for UDFs

2015-04-14 Thread Adam Holmberg (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14494141#comment-14494141
 ] 

Adam Holmberg commented on CASSANDRA-7556:
--

It would also be useful to include HELP CREATE_[AGGREGATE|FUNCTION] in the 
online help.

> Update cqlsh for UDFs
> -
>
> Key: CASSANDRA-7556
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7556
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Tools
>Reporter: Tyler Hobbs
>Assignee: Robert Stupp
>  Labels: udf
> Fix For: 3.0
>
> Attachments: 7556.txt
>
>
> Once CASSANDRA-7395 and CASSANDRA-7526 are complete, we'll want to add cqlsh 
> support for user defined functions.
> This will include:
> * Completion for {{CREATE FUNCTION}} and {{DROP FUNCTION}}
> * Tolerating (almost) arbitrary text inside function bodies
> * {{DESCRIBE TYPE}} support
> * Including types in {{DESCRIBE KEYSPACE}} output
> * Possibly {{GRANT}} completion for any new privileges



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


[jira] [Updated] (CASSANDRA-9174) sstablesplit does not splits Secondary Index CFs

2015-04-14 Thread Philip Thompson (JIRA)

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

Philip Thompson updated CASSANDRA-9174:
---
Fix Version/s: 2.1.5
   2.0.15

> sstablesplit does not splits Secondary Index CFs
> 
>
> Key: CASSANDRA-9174
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9174
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
> Environment: Cassandra 2.0.3
>Reporter: Anuj
>Priority: Minor
> Fix For: 2.0.15, 2.1.5
>
>
> When you run sstablesplit on a CF. Secondary Index CFs are not split. If you 
> run sstablesplit on a Secondary Index CF's Data.db file separately, it fails 
> with the message "Unknown keyspace/cf pair"



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


[jira] [Updated] (CASSANDRA-9179) Unable to "point in time" restore if table/cf has been recreated

2015-04-14 Thread Philip Thompson (JIRA)

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

Philip Thompson updated CASSANDRA-9179:
---
Assignee: Branimir Lambov

> Unable to "point in time" restore if table/cf has been recreated
> 
>
> Key: CASSANDRA-9179
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9179
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jon Moses
>Assignee: Branimir Lambov
>
> With Cassandra 2.1, and the addition of the CF UUID, the ability to do a 
> "point in time" restore by restoring a snapshot and replaying commitlogs is 
> lost if the table has been dropped and recreated.
> When the table is recreated, the cf_id changes, and the commitlog replay 
> mechanism skips the desired mutations as the cf_id no longer matches what's 
> present in the schema.
> There should exist a way to inform the replay that you want the mutations 
> replayed even if the cf_id doesn't match.



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


[jira] [Updated] (CASSANDRA-9186) AbstractType vs. CQL3Type loses frozen keyword

2015-04-14 Thread Philip Thompson (JIRA)

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

Philip Thompson updated CASSANDRA-9186:
---
Assignee: Robert Stupp

> AbstractType vs. CQL3Type loses frozen keyword
> --
>
> Key: CASSANDRA-9186
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9186
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 3.0
>
>
> {code}
> create keyspace functionmetadatatest with replication = 
> {'class':'SimpleStrategy', 'replication_factor':1};
> use functionmetadatatest ;
> CREATE TYPE udtx (x int);
> CREATE FUNCTION u_frozen(u frozen)RETURNS int LANGUAGE java AS 'return 
> new Integer(0);';
> SELECT function_name, signature, argument_types FROM system.schema_functions 
> WHERE keyspace_name='functionmetadatatest';
>  function_name | signature| argument_types
> ---+--+--
>   u_frozen | ['udtx'] | 
> ['org.apache.cassandra.db.marshal.UserType(functionmetadatatest,75647478,78:org.apache.cassandra.db.marshal.Int32Type)']
> {code}
> Problem is that {{UserType}} and {{TupleType}} do not have a _frozen_ (or 
> _isMultiCell_) attribute. A conversion from type to cql3type therefore loses 
> the _frozen_ status.
> EDIT: The issue has been discovered by [~aholmber]



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


[jira] [Updated] (CASSANDRA-9188) cqlsh does not display properly the modified UDTs

2015-04-14 Thread Philip Thompson (JIRA)

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

Philip Thompson updated CASSANDRA-9188:
---
Fix Version/s: 2.1.5
 Assignee: Benjamin Lerer
   Labels: cqlsh  (was: )

> cqlsh does not display properly the modified UDTs
> -
>
> Key: CASSANDRA-9188
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9188
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Benjamin Lerer
>Assignee: Benjamin Lerer
>Priority: Minor
>  Labels: cqlsh
> Fix For: 2.1.5
>
>
> The problem can be reproduced as follow:
> {code}
> cqlsh:test2> create type myType (a int);
> cqlsh:test2> create table myTable (a int primary key, b frozen);
> cqlsh:test2> insert into myTable (a, b) values (1, {a: 1});
> cqlsh:test2> select * from myTable;
>  a | b
> ---+
>  1 | {a: 1}
> (1 rows)
> cqlsh:test2> alter type myType add b int;
> cqlsh:test2> insert into myTable (a, b) values (2, {a: 2, b :2});
> cqlsh:test2> select * from myTable;
>  a | b
> ---+
>  1 | {a: 1}
>  2 | {a: 2}
> (2 rows)
> {code}
> If {{cqlsh}} is then restarted it will display the data properly.
> {code}
> cqlsh:test2> select * from mytable;
>  a | b
> ---+-
>  1 | {a: 1, b: null}
>  2 |{a: 2, b: 2}
> (2 rows)
> {code} 



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


[jira] [Resolved] (CASSANDRA-9184) sstable.CorruptSSTableException

2015-04-14 Thread Brandon Williams (JIRA)

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

Brandon Williams resolved CASSANDRA-9184.
-
Resolution: Invalid

> sstable.CorruptSSTableException
> ---
>
> Key: CASSANDRA-9184
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9184
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
> Environment: Apache Cassandra 1.2.16 on RHEL 6.5
>Reporter: Relish Chackochan
>
> We have 8 node Cassandra cluster with 1.2.16 version (  RHEL 6.5 64-bit ) on 
> Vmware ESXi server and having SSTable Corrupt Error facing frequently on 
> multiple columfamily. Using "nodetol scrub" i am able to resolve the issue. i 
> would like to know why this is happening frequently. is this related to any 
> configuration parameters or VMware related issue.
> Can someone help on this.
> org.apache.cassandra.io.sstable.CorruptSSTableException: java.io.IOException: 
> dataSize of 3691036590893839668 starting at 362204813 would be larger than 
> file /opt/lib
> /cassandra/data/X/XX/-X-ic-1144-Data.db length 486205378



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


  1   2   >