[4/6] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/trunk
Commit: dfd8dcf721c5a7e62afccb3e5a4fc2ededd1f2e0
Parents: c5c7f82 858cb25
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:42 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:42 2017 +0100

--

--




[5/6] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/cassandra-3.X
Commit: dfd8dcf721c5a7e62afccb3e5a4fc2ededd1f2e0
Parents: c5c7f82 858cb25
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:42 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:42 2017 +0100

--

--




[3/6] cassandra git commit: fix merge left-over

2017-01-06 Thread snazy
fix merge left-over


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

Branch: refs/heads/trunk
Commit: 858cb25a007accf007f76f81a3a20e1e4af5d0f9
Parents: 0e9e0a4
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:18 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:18 2017 +0100

--
 .../cql3/validation/entities/UFTest.java| 228 ---
 1 file changed, 228 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/858cb25a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java 
b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
index 6faaf8a..af9ec1a 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.cql3.validation.entities;
 
-import java.security.AccessControlException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -28,8 +27,6 @@ import org.junit.Test;
 
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.exceptions.InvalidQueryException;
-import org.apache.cassandra.config.Config;
-import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.QueryProcessor;
@@ -37,13 +34,10 @@ import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.cql3.functions.FunctionName;
 import org.apache.cassandra.cql3.functions.JavaBasedUDFunction;
 import org.apache.cassandra.cql3.functions.UDFunction;
-import org.apache.cassandra.cql3.functions.UDHelper;
 import org.apache.cassandra.db.marshal.CollectionType;
-import org.apache.cassandra.exceptions.FunctionExecutionException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.schema.KeyspaceMetadata;
 import org.apache.cassandra.service.ClientState;
-import org.apache.cassandra.service.ClientWarn;
 import org.apache.cassandra.transport.*;
 import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.transport.messages.ResultMessage;
@@ -878,228 +872,6 @@ public class UFTest extends CQLTester
 }
 
 @Test
-public void testSecurityPermissions() throws Throwable
-{
-createTable("CREATE TABLE %s (key int primary key, dval double)");
-execute("INSERT INTO %s (key, dval) VALUES (?, ?)", 1, 1d);
-
-// Java UDFs
-
-try
-{
-String fName = createFunction(KEYSPACE_PER_TEST, "double",
-  "CREATE OR REPLACE FUNCTION %s(val 
double) " +
-  "RETURNS NULL ON NULL INPUT " +
-  "RETURNS double " +
-  "LANGUAGE JAVA\n" +
-  "AS 
'System.getProperty(\"foo.bar.baz\"); return 0d;';");
-execute("SELECT " + fName + "(dval) FROM %s WHERE key=1");
-Assert.fail();
-}
-catch (FunctionExecutionException e)
-{
-assertAccessControlException("System.getProperty(\"foo.bar.baz\"); 
return 0d;", e);
-}
-
-String[][] typesAndSources =
-{
-{"","try { Class.forName(\"" + 
UDHelper.class.getName() + "\"); } catch (Exception e) { throw new 
RuntimeException(e); } return 0d;"},
-{"sun.misc.Unsafe", "sun.misc.Unsafe.getUnsafe(); return 0d;"},
-{"","try { Class.forName(\"sun.misc.Unsafe\"); 
} catch (Exception e) { throw new RuntimeException(e); } return 0d;"},
-{"java.nio.file.FileSystems", "try {" +
-" 
java.nio.file.FileSystems.getDefault(); return 0d;" +
-"} catch (Exception t) {" +
-" throw new RuntimeException(t);" +
-'}'},
-{"java.nio.channels.FileChannel", "try {" +
-" 
java.nio.channels.FileChannel.open(java.nio.file.FileSystems.getDefault().getPath(\"/etc/passwd\")).close();
 return 0d;" +
-"} catch (Exception t) {" +
-" throw new RuntimeException(t);" +
- 

[2/6] cassandra git commit: fix merge left-over

2017-01-06 Thread snazy
fix merge left-over


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

Branch: refs/heads/cassandra-3.X
Commit: 858cb25a007accf007f76f81a3a20e1e4af5d0f9
Parents: 0e9e0a4
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:18 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:18 2017 +0100

--
 .../cql3/validation/entities/UFTest.java| 228 ---
 1 file changed, 228 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/858cb25a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java 
b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
index 6faaf8a..af9ec1a 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.cql3.validation.entities;
 
-import java.security.AccessControlException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -28,8 +27,6 @@ import org.junit.Test;
 
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.exceptions.InvalidQueryException;
-import org.apache.cassandra.config.Config;
-import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.QueryProcessor;
@@ -37,13 +34,10 @@ import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.cql3.functions.FunctionName;
 import org.apache.cassandra.cql3.functions.JavaBasedUDFunction;
 import org.apache.cassandra.cql3.functions.UDFunction;
-import org.apache.cassandra.cql3.functions.UDHelper;
 import org.apache.cassandra.db.marshal.CollectionType;
-import org.apache.cassandra.exceptions.FunctionExecutionException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.schema.KeyspaceMetadata;
 import org.apache.cassandra.service.ClientState;
-import org.apache.cassandra.service.ClientWarn;
 import org.apache.cassandra.transport.*;
 import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.transport.messages.ResultMessage;
@@ -878,228 +872,6 @@ public class UFTest extends CQLTester
 }
 
 @Test
-public void testSecurityPermissions() throws Throwable
-{
-createTable("CREATE TABLE %s (key int primary key, dval double)");
-execute("INSERT INTO %s (key, dval) VALUES (?, ?)", 1, 1d);
-
-// Java UDFs
-
-try
-{
-String fName = createFunction(KEYSPACE_PER_TEST, "double",
-  "CREATE OR REPLACE FUNCTION %s(val 
double) " +
-  "RETURNS NULL ON NULL INPUT " +
-  "RETURNS double " +
-  "LANGUAGE JAVA\n" +
-  "AS 
'System.getProperty(\"foo.bar.baz\"); return 0d;';");
-execute("SELECT " + fName + "(dval) FROM %s WHERE key=1");
-Assert.fail();
-}
-catch (FunctionExecutionException e)
-{
-assertAccessControlException("System.getProperty(\"foo.bar.baz\"); 
return 0d;", e);
-}
-
-String[][] typesAndSources =
-{
-{"","try { Class.forName(\"" + 
UDHelper.class.getName() + "\"); } catch (Exception e) { throw new 
RuntimeException(e); } return 0d;"},
-{"sun.misc.Unsafe", "sun.misc.Unsafe.getUnsafe(); return 0d;"},
-{"","try { Class.forName(\"sun.misc.Unsafe\"); 
} catch (Exception e) { throw new RuntimeException(e); } return 0d;"},
-{"java.nio.file.FileSystems", "try {" +
-" 
java.nio.file.FileSystems.getDefault(); return 0d;" +
-"} catch (Exception t) {" +
-" throw new RuntimeException(t);" +
-'}'},
-{"java.nio.channels.FileChannel", "try {" +
-" 
java.nio.channels.FileChannel.open(java.nio.file.FileSystems.getDefault().getPath(\"/etc/passwd\")).close();
 return 0d;" +
-"} catch (Exception t) {" +
-" throw new RuntimeException(t);" +
- 

[1/6] cassandra git commit: fix merge left-over

2017-01-06 Thread snazy
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 0e9e0a4a8 -> 858cb25a0
  refs/heads/cassandra-3.X c5c7f82db -> dfd8dcf72
  refs/heads/trunk 5ce08a728 -> 18f28c517


fix merge left-over


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

Branch: refs/heads/cassandra-3.11
Commit: 858cb25a007accf007f76f81a3a20e1e4af5d0f9
Parents: 0e9e0a4
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:18 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:18 2017 +0100

--
 .../cql3/validation/entities/UFTest.java| 228 ---
 1 file changed, 228 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/858cb25a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
--
diff --git 
a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java 
b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
index 6faaf8a..af9ec1a 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.cassandra.cql3.validation.entities;
 
-import java.security.AccessControlException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -28,8 +27,6 @@ import org.junit.Test;
 
 import com.datastax.driver.core.*;
 import com.datastax.driver.core.exceptions.InvalidQueryException;
-import org.apache.cassandra.config.Config;
-import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.QueryProcessor;
@@ -37,13 +34,10 @@ import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.cql3.functions.FunctionName;
 import org.apache.cassandra.cql3.functions.JavaBasedUDFunction;
 import org.apache.cassandra.cql3.functions.UDFunction;
-import org.apache.cassandra.cql3.functions.UDHelper;
 import org.apache.cassandra.db.marshal.CollectionType;
-import org.apache.cassandra.exceptions.FunctionExecutionException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.schema.KeyspaceMetadata;
 import org.apache.cassandra.service.ClientState;
-import org.apache.cassandra.service.ClientWarn;
 import org.apache.cassandra.transport.*;
 import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.transport.messages.ResultMessage;
@@ -878,228 +872,6 @@ public class UFTest extends CQLTester
 }
 
 @Test
-public void testSecurityPermissions() throws Throwable
-{
-createTable("CREATE TABLE %s (key int primary key, dval double)");
-execute("INSERT INTO %s (key, dval) VALUES (?, ?)", 1, 1d);
-
-// Java UDFs
-
-try
-{
-String fName = createFunction(KEYSPACE_PER_TEST, "double",
-  "CREATE OR REPLACE FUNCTION %s(val 
double) " +
-  "RETURNS NULL ON NULL INPUT " +
-  "RETURNS double " +
-  "LANGUAGE JAVA\n" +
-  "AS 
'System.getProperty(\"foo.bar.baz\"); return 0d;';");
-execute("SELECT " + fName + "(dval) FROM %s WHERE key=1");
-Assert.fail();
-}
-catch (FunctionExecutionException e)
-{
-assertAccessControlException("System.getProperty(\"foo.bar.baz\"); 
return 0d;", e);
-}
-
-String[][] typesAndSources =
-{
-{"","try { Class.forName(\"" + 
UDHelper.class.getName() + "\"); } catch (Exception e) { throw new 
RuntimeException(e); } return 0d;"},
-{"sun.misc.Unsafe", "sun.misc.Unsafe.getUnsafe(); return 0d;"},
-{"","try { Class.forName(\"sun.misc.Unsafe\"); 
} catch (Exception e) { throw new RuntimeException(e); } return 0d;"},
-{"java.nio.file.FileSystems", "try {" +
-" 
java.nio.file.FileSystems.getDefault(); return 0d;" +
-"} catch (Exception t) {" +
-" throw new RuntimeException(t);" +
-'}'},
-{"java.nio.channels.FileChannel", "try {" +
-" 

[6/6] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread snazy
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 18f28c517324d5055bf0a3e16187055d62c11828
Parents: 5ce08a7 dfd8dcf
Author: Robert Stupp 
Authored: Sat Jan 7 01:17:46 2017 +0100
Committer: Robert Stupp 
Committed: Sat Jan 7 01:17:46 2017 +0100

--

--




[jira] [Updated] (CASSANDRA-13095) Timeouts between nodes

2017-01-06 Thread Danil Smirnov (JIRA)

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

Danil Smirnov updated CASSANDRA-13095:
--
Attachment: 13095-2.1.patch

> Timeouts between nodes
> --
>
> Key: CASSANDRA-13095
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13095
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Danil Smirnov
>Priority: Minor
> Attachments: 13095-2.1.patch
>
>
> Recently I've run into a problem with heavily loaded cluster when sometimes 
> messages between certain nodes become blocked with no reason.
> It looks like the same situation that described here 
> https://issues.apache.org/jira/browse/CASSANDRA-12676?focusedCommentId=15736166=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15736166
> Thread dump showed infinite loop here: 
> https://github.com/apache/cassandra/blob/a8a43dd32eb92406d7d8b105e08c68b3d5c7df49/src/java/org/apache/cassandra/utils/CoalescingStrategies.java#L109
> Apparently the problem is in the initial value of epoch filed in 
> TimeHorizonMovingAverageCoalescingStrategy class. When it's value is not 
> evenly divisible by BUCKET_INTERVAL, ix(epoch-1) does not point to the 
> correct bucket. As a result, sum gradually increases and, upon reaching 
> MEASURED_INTERVAL, averageGap becomes 0 and thread blocks.
> It's hard to reproduce because it takes a long time for sum to grow and when 
> no messages are send for some time, sum becomes 0 
> https://github.com/apache/cassandra/blob/a8a43dd32eb92406d7d8b105e08c68b3d5c7df49/src/java/org/apache/cassandra/utils/CoalescingStrategies.java#L301
>  and bug is no longer reproducible (until connection between nodes is 
> re-created).
> I've added a patch which should fix the problem. Don't know if it would be of 
> any help since CASSANDRA-12676 will apparently disable this behaviour. One 
> note about performance regressions though. There is a small chance it being 
> result of the bug described here, so it might be worth testing performance 
> after fixes and/or tuning the algorithm.



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


[jira] [Updated] (CASSANDRA-13095) Timeouts between nodes

2017-01-06 Thread Danil Smirnov (JIRA)

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

Danil Smirnov updated CASSANDRA-13095:
--
Attachment: (was: 13095-2.1.patch)

> Timeouts between nodes
> --
>
> Key: CASSANDRA-13095
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13095
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Danil Smirnov
>Priority: Minor
> Attachments: 13095-2.1.patch
>
>
> Recently I've run into a problem with heavily loaded cluster when sometimes 
> messages between certain nodes become blocked with no reason.
> It looks like the same situation that described here 
> https://issues.apache.org/jira/browse/CASSANDRA-12676?focusedCommentId=15736166=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15736166
> Thread dump showed infinite loop here: 
> https://github.com/apache/cassandra/blob/a8a43dd32eb92406d7d8b105e08c68b3d5c7df49/src/java/org/apache/cassandra/utils/CoalescingStrategies.java#L109
> Apparently the problem is in the initial value of epoch filed in 
> TimeHorizonMovingAverageCoalescingStrategy class. When it's value is not 
> evenly divisible by BUCKET_INTERVAL, ix(epoch-1) does not point to the 
> correct bucket. As a result, sum gradually increases and, upon reaching 
> MEASURED_INTERVAL, averageGap becomes 0 and thread blocks.
> It's hard to reproduce because it takes a long time for sum to grow and when 
> no messages are send for some time, sum becomes 0 
> https://github.com/apache/cassandra/blob/a8a43dd32eb92406d7d8b105e08c68b3d5c7df49/src/java/org/apache/cassandra/utils/CoalescingStrategies.java#L301
>  and bug is no longer reproducible (until connection between nodes is 
> re-created).
> I've added a patch which should fix the problem. Don't know if it would be of 
> any help since CASSANDRA-12676 will apparently disable this behaviour. One 
> note about performance regressions though. There is a small chance it being 
> result of the bug described here, so it might be worth testing performance 
> after fixes and/or tuning the algorithm.



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


[jira] [Commented] (CASSANDRA-13095) Timeouts between nodes

2017-01-06 Thread Danil Smirnov (JIRA)

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

Danil Smirnov commented on CASSANDRA-13095:
---

Updated the patch with additional check for sleep value. Checking at that line 
would allow to monitor incorrect average gap value through coalescing_debug 
option.

And just in case, a rough method to reproduce the problem:
1. Setup 2-nodes cluster with version 2.2.8 with 
-Dcassandra.coalescing_debug=true
2. Create test table:
{code}
CREATE KEYSPACE temp WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': '2'};
CREATE TABLE temp.temp (
id int PRIMARY KEY,
value text
) WITH dclocal_read_repair_chance = 1.0;
{code}
3. Populate it with data:
{code}
import random
import string

from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel

cluster = Cluster()
session = cluster.connect()

test_stmt = session.prepare("INSERT INTO temp.temp (id, value) VALUES (?, ?)")
test_stmt.consistency_level = ConsistencyLevel.ALL

for id in xrange(5):
value = "".join( [random.choice(string.letters) for i in xrange(100)] )
session.execute(test_stmt, [id, value])
{code}
4. Add additional logging and replace apache-cassandra-2.2.8.jar with new one:
{code}
>From 607c4194036d0f33e64c7380724fca94cf47d284 Mon Sep 17 00:00:00 2001
From: Smirnov Danil 
Date: Wed, 4 Jan 2017 12:07:42 +0300
Subject: [PATCH] logging

---
 src/java/org/apache/cassandra/utils/CoalescingStrategies.java | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java 
b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
index 7dba97b..7598eef 100644
--- a/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
+++ b/src/java/org/apache/cassandra/utils/CoalescingStrategies.java
@@ -290,6 +290,7 @@ public class CoalescingStrategies
 {
 if (delta > 2 * INTERVAL)
 {
+logger.info("{} rollepoch", this);
 // this sample is more than twice our interval ahead, so just 
clear our counters completely
 epoch = epoch(nanos);
 sum = 0;
@@ -336,6 +337,10 @@ public class CoalescingStrategies
 logSample(qm.timestampNanos());
 
 long averageGap = averageGap();
+if (DEBUG_COALESCING && shouldLogAverage)
+{
+logger.info("{} sum expected {}, was {}", this, 
Arrays.stream(samples).sum() - samples[ix(epoch - 1)], sum);
+}
 debugGap(averageGap);
 
 int count = out.size();
-- 
2.7.4

{code}
5. Restart nodes, add  and run script to infinitely fetch data:
{code}
import random

from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel

cluster = Cluster()
session = cluster.connect()

test_stmt = session.prepare("SELECT * FROM temp.temp WHERE id in ?")
test_stmt.consistency_level = ConsistencyLevel.ONE
test_stmt.fetch_size = None

while (True):
ids = [(random.randrange(5)) for i in xrange(100)]
session.execute(test_stmt, [ids])
{code}
6. At this point everything supposed to be normal (see system.log for sum 
variable value). Since between starting nodes and starting script some time had 
passed. Maybe sum will differ for gossipMessages (probably) coalescing, but 
it's value is very low.
7. Restart one of the nodes. Now you will be able to see sum growing very fast 
for smallMessages tcp connection, exceeding reasonable values. After hours or 
days it will result in thread block.

> Timeouts between nodes
> --
>
> Key: CASSANDRA-13095
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13095
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Danil Smirnov
>Priority: Minor
> Attachments: 13095-2.1.patch
>
>
> Recently I've run into a problem with heavily loaded cluster when sometimes 
> messages between certain nodes become blocked with no reason.
> It looks like the same situation that described here 
> https://issues.apache.org/jira/browse/CASSANDRA-12676?focusedCommentId=15736166=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15736166
> Thread dump showed infinite loop here: 
> https://github.com/apache/cassandra/blob/a8a43dd32eb92406d7d8b105e08c68b3d5c7df49/src/java/org/apache/cassandra/utils/CoalescingStrategies.java#L109
> Apparently the problem is in the initial value of epoch filed in 
> TimeHorizonMovingAverageCoalescingStrategy class. When it's value is not 
> evenly divisible by BUCKET_INTERVAL, ix(epoch-1) does not point to the 
> correct bucket. As a result, sum gradually increases and, upon reaching 
> MEASURED_INTERVAL, averageGap becomes 0 and thread blocks.
> It's hard to reproduce because it takes a long time for sum to 

[jira] [Comment Edited] (CASSANDRA-13015) improved compactions metrics

2017-01-06 Thread Jon Haddad (JIRA)

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

Jon Haddad edited comment on CASSANDRA-13015 at 1/6/17 11:11 PM:
-

Once CASSANDRA-12979 is merged I'll knock this out.


was (Author: rustyrazorblade):
Once CASSANDRA-12979 is merged I knock this out.

> improved compactions metrics
> 
>
> Key: CASSANDRA-13015
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13015
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Jon Haddad
>Assignee: Jon Haddad
> Fix For: 4.0
>
>
> Compaction stats is missing some useful metrics.
> * Number of sstables dropped out of compaction due to disk space
> * Number of compactions that had to drop sstables
> * Compactions aborted (due to reduced scope failure)
> There will be more, I'll edit the description with the list as I figure it 
> out.



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


[jira] [Commented] (CASSANDRA-13015) improved compactions metrics

2017-01-06 Thread Jon Haddad (JIRA)

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

Jon Haddad commented on CASSANDRA-13015:


Once CASSANDRA-12979 is merged I knock this out.

> improved compactions metrics
> 
>
> Key: CASSANDRA-13015
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13015
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Jon Haddad
>Assignee: Jon Haddad
> Fix For: 4.0
>
>
> Compaction stats is missing some useful metrics.
> * Number of sstables dropped out of compaction due to disk space
> * Number of compactions that had to drop sstables
> * Compactions aborted (due to reduced scope failure)
> There will be more, I'll edit the description with the list as I figure it 
> out.



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


[jira] [Commented] (CASSANDRA-11431) java: error: unmappable character for encoding ASCII

2017-01-06 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-11431:


[~Stefania] could you please review the patch?

> java: error: unmappable character for encoding ASCII
> 
>
> Key: CASSANDRA-11431
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11431
> Project: Cassandra
>  Issue Type: Bug
> Environment: java version "1.7.0_95"
> OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.15.10.1)
> OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
> Linux 22be6fbead2c 4.2.0-34-generic #39-Ubuntu SMP Thu Mar 10 22:11:28 UTC 
> 2016 ppc64le ppc64le ppc64le GNU/Linux
>Reporter: Lorena Pesantez
>Assignee: Jay Zhuang
>  Labels: lhf
> Fix For: 3.0.x
>
> Attachments: 11431-3.0-update.txt, 11431-3.0.txt
>
>
> I saw this closed issue with the exact same signature as the one I 
> encountered, so cloning...  I fixed the errors below by adding the line 
> "" after lines 727 and 1089 of the 
> cassandra/build.xml file.  I am working PerfKitBenchmarker, so the workload 
> must build on my platform (ppc64) without any changes after cloning it from 
> github.  Thanks!
> {code}
> build-project:
>  [echo] apache-cassandra: /tmp/pkb/cassandra/build.xml
> [javac] Compiling 997 source files to 
> /tmp/pkb/cassandra/build/classes/main
> [javac] 
> /tmp/pkb/cassandra/src/java/org/apache/cassandra/net/OutboundTcpConnection.java:106:
>  error: unmappable character for encoding ASCII
> [javac] logger.info("OutboundTcpConnection coalescing window 
> set to " + coalescingWindow + "??s");
> [javac]   
>   ^
> [javac] 
> /tmp/pkb/cassandra/src/java/org/apache/cassandra/net/OutboundTcpConnection.java:106:
>  error: unmappable character for encoding ASCII
> [javac] logger.info("OutboundTcpConnection coalescing window 
> set to " + coalescingWindow + "??s");
> [javac]   
>^
> [javac] 
> /tmp/pkb/cassandra/src/java/org/apache/cassandra/utils/CoalescingStrategies.java:172:
>  error: unmappable character for encoding ASCII
> [javac] logger.info(toString() + " gap " + 
> TimeUnit.NANOSECONDS.toMicros(averageGap) + "??s");
> [javac]   
>   ^
> [javac] 
> /tmp/pkb/cassandra/src/java/org/apache/cassandra/utils/CoalescingStrategies.java:172:
>  error: unmappable character for encoding ASCII
> [javac] logger.info(toString() + " gap " + 
> TimeUnit.NANOSECONDS.toMicros(averageGap) + "??s");
> [javac]   
>^
> [javac] 4 errors
> BUILD FAILED
> /tmp/pkb/cassandra/build.xml:723: Compile failed; see the compiler error 
> output for details.
> build-test:
> [javac] Compiling 263 source files to 
> /tmp/pkb/cassandra/build/test/classes
> [javac] 
> /tmp/pkb/cassandra/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java:38:
>  error: unmappable character for encoding ASCII
> [javac] execute("INSERT INTO %s (k, c, v, s) VALUES ('??', '??', 
> '??', {'??'})");
> [javac]   ^
> [javac] 
> /tmp/pkb/cassandra/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java:38:
>  error: unmappable character for encoding ASCII
> [javac] execute("INSERT INTO %s (k, c, v, s) VALUES ('??', '??', 
> '??', {'??'})");
> [javac]^
> [javac] 
> /tmp/pkb/cassandra/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java:38:
>  error: unmappable character for encoding ASCII
> [javac] execute("INSERT INTO %s (k, c, v, s) VALUES ('??', '??', 
> '??', {'??'})");
> [javac] ^
> [javac] 
> /tmp/pkb/cassandra/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java:38:
>  error: unmappable character for encoding ASCII
> [javac] execute("INSERT INTO %s (k, c, v, s) VALUES ('??', '??', 
> '??', {'??'})");
> [javac]  ^
> [javac] 
> /tmp/pkb/cassandra/test/unit/org/apache/cassandra/cql3/validation/operations/UpdateTest.java:38:
>  error: unmappable character for encoding ASCII
> [javac] execute("INSERT INTO %s (k, c, v, s) VALUES ('??', '??', 
> '??', 

[jira] [Commented] (CASSANDRA-13105) Multi-index query incorrectly returns 0 rows

2017-01-06 Thread Voytek Jarnot (JIRA)

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

Voytek Jarnot commented on CASSANDRA-13105:
---

Even stranger, I can add a 5th query that does work:

{code}
(5) select * from test1 where val1 < '~~' AND val2 < '1val3' allow filtering;
{code}

Changing the val2 evaluation from '=' to '<' makes the query work.

I am now even further at a loss: query 5 works, query 4 does not.

> Multi-index query incorrectly returns 0 rows
> 
>
> Key: CASSANDRA-13105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13105
> Project: Cassandra
>  Issue Type: Bug
>  Components: sasi
> Environment: 3.9.0 on linux & osx
>Reporter: Voytek Jarnot
>
> Setup:
> {code}
> create table test1(id1 text PRIMARY KEY, val1 text, val2 text);
> create custom index test1_idx_val1 on test1(val1) using 
> 'org.apache.cassandra.index.sasi.SASIIndex';
> create custom index test1_idx_val2 on test1(val2) using 
> 'org.apache.cassandra.index.sasi.SASIIndex';
> insert into test1(id1, val1, val2) values ('1', '1val1', '1val2');
> insert into test1(id1, val1, val2) values ('2', '~~', '2val2');
> {code}
> Queries:
> {code}
> (1) select * from test1 where val1 = '~~';
> (2) select * from test1 where val1 < '~~' allow filtering;
> (3) select * from test1 where val2 = '1val2';
> (4) select * from test1 where val1 < '~~' and val2 = '1val2' allow filtering;
> {code}
> 1, 2, and 3 all work correctly.  4 does not work.
> 2, 3, and 4 should return the same row (id1='1'); 2 and 3 do, 4 returns 0 
> rows.



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


[jira] [Updated] (CASSANDRA-13109) Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0

2017-01-06 Thread Samuel Klock (JIRA)

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

Samuel Klock updated CASSANDRA-13109:
-
Attachment: 13109-3.0.txt

Attaching the patch.

> Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0
> ---
>
> Key: CASSANDRA-13109
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13109
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Samuel Klock
> Attachments: 13109-3.0.txt
>
>
> We've observed this upgrading from 2.1.15 to 3.0.8 and from 2.1.16 to 3.0.10: 
> some lightweight transactions executed on upgraded nodes fail with a read 
> failure.  The following conditions seem relevant to this occurring:
> * The transaction must be conditioned on the current value of at least one 
> column, e.g., {{IF NOT EXISTS}} transactions don't seem to be affected.
> * There should be a collection column (in our case, a map) defined on the 
> table on which the transaction is executed.
> * The transaction should be executed before sstables on the node are 
> upgraded.  The failure does not occur after the sstables have been upgraded 
> (whether via {{nodetool upgradesstables}} or effectively via compaction).
> * Upgraded nodes seem to be able to participate in lightweight transactions 
> as long as they're not the coordinator.
> * The values in the row being manipulated by the transaction must have been 
> consistently manipulated by lightweight transactions (perhaps the existence 
> of Paxos state for the partition is somehow relevant?).
> * In 3.0.10, it _seems_ to be necessary to have the partition split across 
> multiple legacy sstables.  This was not necessary to reproduce the bug in 
> 3.0.8 or .9.
> For applications affected by this bug, a possible workaround is to prevent 
> nodes being upgraded from coordinating requests until sstables have been 
> upgraded.
> We're able to reproduce this when upgrading from 2.1.16 to 3.0.10 with the 
> following steps on a single-node cluster using a mostly pristine 
> {{cassandra.yaml}} from the source distribution.
> # Start Cassandra-2.1.16 on the node.
> # Create a table with a collection column and insert some data into it.
> {code:sql}
> CREATE KEYSPACE test WITH REPLICATION = {'class': 'SimpleStrategy', 
> 'replication_factor': 1};
> CREATE TABLE test.test (key TEXT PRIMARY KEY, cas_target TEXT, 
> some_collection MAP);
> INSERT INTO test.test (key, cas_target, some_collection) VALUES ('key', 
> 'value', {}) IF NOT EXISTS;
> {code}
> # Flush the row to an sstable: {{nodetool flush}}.
> # Update the row:
> {code:sql}
> UPDATE test.test SET cas_target = 'newvalue', some_collection = {} WHERE key 
> = 'key' IF cas_target = 'value';
> {code}
> # Drain the node: {{nodetool drain}}
> # Stop the node, upgrade to 3.0.10, and start the node.
> # Attempt to update the row again:
> {code:sql}
> UPDATE test.test SET cas_target = 'lastvalue' WHERE key = 'key' IF cas_target 
> = 'newvalue';
> {code}
> Using {{cqlsh}}, if the error is reproduced, the following output will be 
> returned:
> {code:sql}
> $ ./cqlsh <<< "UPDATE test.test SET cas_target = 'newvalue', some_collection 
> = {} WHERE key = 'key' IF cas_target = 'value';"
> (start: 2016-12-22 10:14:27 EST)
> :2:ReadFailure: Error from server: code=1300 [Replica(s) failed to 
> execute read] message="Operation failed - received 0 responses and 1 
> failures" info={'failures': 1, 'received_responses': 0, 'required_responses': 
> 1, 'consistency': 'QUORUM'}
> {code}
> and the following stack trace will be present in the system log:
> {noformat}
> WARN  15:14:28 Uncaught exception on thread 
> Thread[SharedPool-Worker-10,10,main]: {}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2476)
>  ~[main/:na]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[main/:na]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [main/:na]
>   at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [main/:na]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:617)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:569)
>  ~[main/:na]
>   at 
> org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:220)

[jira] [Updated] (CASSANDRA-13109) Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0

2017-01-06 Thread Samuel Klock (JIRA)

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

Samuel Klock updated CASSANDRA-13109:
-
Reproduced In: 3.0.10, 3.0.9, 3.0.8  (was: 3.0.8, 3.0.9, 3.0.10)
   Status: Patch Available  (was: Open)

> Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0
> ---
>
> Key: CASSANDRA-13109
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13109
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Samuel Klock
> Attachments: 13109-3.0.txt
>
>
> We've observed this upgrading from 2.1.15 to 3.0.8 and from 2.1.16 to 3.0.10: 
> some lightweight transactions executed on upgraded nodes fail with a read 
> failure.  The following conditions seem relevant to this occurring:
> * The transaction must be conditioned on the current value of at least one 
> column, e.g., {{IF NOT EXISTS}} transactions don't seem to be affected.
> * There should be a collection column (in our case, a map) defined on the 
> table on which the transaction is executed.
> * The transaction should be executed before sstables on the node are 
> upgraded.  The failure does not occur after the sstables have been upgraded 
> (whether via {{nodetool upgradesstables}} or effectively via compaction).
> * Upgraded nodes seem to be able to participate in lightweight transactions 
> as long as they're not the coordinator.
> * The values in the row being manipulated by the transaction must have been 
> consistently manipulated by lightweight transactions (perhaps the existence 
> of Paxos state for the partition is somehow relevant?).
> * In 3.0.10, it _seems_ to be necessary to have the partition split across 
> multiple legacy sstables.  This was not necessary to reproduce the bug in 
> 3.0.8 or .9.
> For applications affected by this bug, a possible workaround is to prevent 
> nodes being upgraded from coordinating requests until sstables have been 
> upgraded.
> We're able to reproduce this when upgrading from 2.1.16 to 3.0.10 with the 
> following steps on a single-node cluster using a mostly pristine 
> {{cassandra.yaml}} from the source distribution.
> # Start Cassandra-2.1.16 on the node.
> # Create a table with a collection column and insert some data into it.
> {code:sql}
> CREATE KEYSPACE test WITH REPLICATION = {'class': 'SimpleStrategy', 
> 'replication_factor': 1};
> CREATE TABLE test.test (key TEXT PRIMARY KEY, cas_target TEXT, 
> some_collection MAP);
> INSERT INTO test.test (key, cas_target, some_collection) VALUES ('key', 
> 'value', {}) IF NOT EXISTS;
> {code}
> # Flush the row to an sstable: {{nodetool flush}}.
> # Update the row:
> {code:sql}
> UPDATE test.test SET cas_target = 'newvalue', some_collection = {} WHERE key 
> = 'key' IF cas_target = 'value';
> {code}
> # Drain the node: {{nodetool drain}}
> # Stop the node, upgrade to 3.0.10, and start the node.
> # Attempt to update the row again:
> {code:sql}
> UPDATE test.test SET cas_target = 'lastvalue' WHERE key = 'key' IF cas_target 
> = 'newvalue';
> {code}
> Using {{cqlsh}}, if the error is reproduced, the following output will be 
> returned:
> {code:sql}
> $ ./cqlsh <<< "UPDATE test.test SET cas_target = 'newvalue', some_collection 
> = {} WHERE key = 'key' IF cas_target = 'value';"
> (start: 2016-12-22 10:14:27 EST)
> :2:ReadFailure: Error from server: code=1300 [Replica(s) failed to 
> execute read] message="Operation failed - received 0 responses and 1 
> failures" info={'failures': 1, 'received_responses': 0, 'required_responses': 
> 1, 'consistency': 'QUORUM'}
> {code}
> and the following stack trace will be present in the system log:
> {noformat}
> WARN  15:14:28 Uncaught exception on thread 
> Thread[SharedPool-Worker-10,10,main]: {}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2476)
>  ~[main/:na]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[main/:na]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [main/:na]
>   at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [main/:na]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:617)
>  ~[main/:na]
>   at 
> org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:569)
>  ~[main/:na]
>   at 
> 

[jira] [Created] (CASSANDRA-13109) Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0

2017-01-06 Thread Samuel Klock (JIRA)
Samuel Klock created CASSANDRA-13109:


 Summary: Lightweight transactions temporarily fail after upgrade 
from 2.1 to 3.0
 Key: CASSANDRA-13109
 URL: https://issues.apache.org/jira/browse/CASSANDRA-13109
 Project: Cassandra
  Issue Type: Bug
Reporter: Samuel Klock


We've observed this upgrading from 2.1.15 to 3.0.8 and from 2.1.16 to 3.0.10: 
some lightweight transactions executed on upgraded nodes fail with a read 
failure.  The following conditions seem relevant to this occurring:

* The transaction must be conditioned on the current value of at least one 
column, e.g., {{IF NOT EXISTS}} transactions don't seem to be affected.
* There should be a collection column (in our case, a map) defined on the table 
on which the transaction is executed.
* The transaction should be executed before sstables on the node are upgraded.  
The failure does not occur after the sstables have been upgraded (whether via 
{{nodetool upgradesstables}} or effectively via compaction).
* Upgraded nodes seem to be able to participate in lightweight transactions as 
long as they're not the coordinator.
* The values in the row being manipulated by the transaction must have been 
consistently manipulated by lightweight transactions (perhaps the existence of 
Paxos state for the partition is somehow relevant?).
* In 3.0.10, it _seems_ to be necessary to have the partition split across 
multiple legacy sstables.  This was not necessary to reproduce the bug in 3.0.8 
or .9.

For applications affected by this bug, a possible workaround is to prevent 
nodes being upgraded from coordinating requests until sstables have been 
upgraded.

We're able to reproduce this when upgrading from 2.1.16 to 3.0.10 with the 
following steps on a single-node cluster using a mostly pristine 
{{cassandra.yaml}} from the source distribution.

# Start Cassandra-2.1.16 on the node.
# Create a table with a collection column and insert some data into it.
{code:sql}
CREATE KEYSPACE test WITH REPLICATION = {'class': 'SimpleStrategy', 
'replication_factor': 1};
CREATE TABLE test.test (key TEXT PRIMARY KEY, cas_target TEXT, some_collection 
MAP);
INSERT INTO test.test (key, cas_target, some_collection) VALUES ('key', 
'value', {}) IF NOT EXISTS;
{code}
# Flush the row to an sstable: {{nodetool flush}}.
# Update the row:
{code:sql}
UPDATE test.test SET cas_target = 'newvalue', some_collection = {} WHERE key = 
'key' IF cas_target = 'value';
{code}
# Drain the node: {{nodetool drain}}
# Stop the node, upgrade to 3.0.10, and start the node.
# Attempt to update the row again:
{code:sql}
UPDATE test.test SET cas_target = 'lastvalue' WHERE key = 'key' IF cas_target = 
'newvalue';
{code}
Using {{cqlsh}}, if the error is reproduced, the following output will be 
returned:
{code:sql}
$ ./cqlsh <<< "UPDATE test.test SET cas_target = 'newvalue', some_collection = 
{} WHERE key = 'key' IF cas_target = 'value';"
(start: 2016-12-22 10:14:27 EST)
:2:ReadFailure: Error from server: code=1300 [Replica(s) failed to 
execute read] message="Operation failed - received 0 responses and 1 failures" 
info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
'consistency': 'QUORUM'}
{code}
and the following stack trace will be present in the system log:
{noformat}
WARN  15:14:28 Uncaught exception on thread 
Thread[SharedPool-Worker-10,10,main]: {}
java.lang.RuntimeException: java.lang.NullPointerException
at 
org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2476)
 ~[main/:na]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_101]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
 ~[main/:na]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
 [main/:na]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
[main/:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.NullPointerException: null
at 
org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:617)
 ~[main/:na]
at 
org.apache.cassandra.db.rows.Row$Merger$ColumnDataReducer.getReduced(Row.java:569)
 ~[main/:na]
at 
org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:220)
 ~[main/:na]
at 
org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext(MergeIterator.java:159)
 ~[main/:na]
at 
org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) 
~[main/:na]
at org.apache.cassandra.db.rows.Row$Merger.merge(Row.java:546) 
~[main/:na]
at 

[jira] [Updated] (CASSANDRA-10145) Change protocol to allow sending key space independent of query string

2017-01-06 Thread Tyler Hobbs (JIRA)

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

Tyler Hobbs updated CASSANDRA-10145:

Fix Version/s: (was: 3.x)
   4.0

> Change protocol to allow sending key space independent of query string
> --
>
> Key: CASSANDRA-10145
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10145
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Vishy Kasar
>Assignee: Sandeep Tamhankar
> Fix For: 4.0
>
> Attachments: 10145-trunk.txt
>
>
> Currently keyspace is either embedded in the query string or set through "use 
> keyspace" on a connection by client driver. 
> There are practical use cases where client user has query and keyspace 
> independently. In order for that scenario to work, they will have to create 
> one client session per keyspace or have to resort to some string replace 
> hackery.
> It will be nice if protocol allowed sending keyspace separately from the 
> query. 



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


[jira] [Commented] (CASSANDRA-12563) Stress daemon help is incorrect

2017-01-06 Thread Blake Eggleston (JIRA)

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

Blake Eggleston commented on CASSANDRA-12563:
-

thanks, lgtm

> Stress daemon help is incorrect
> ---
>
> Key: CASSANDRA-12563
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12563
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Trivial
>  Labels: stress
> Fix For: 3.x
>
>
> It says provide the option -sendToDaemon where as only -send-to and -sendto 
> work
> Fix here:
> https://github.com/chbatey/cassandra-1/tree/stress-daemon



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


[jira] [Updated] (CASSANDRA-12563) Stress daemon help is incorrect

2017-01-06 Thread Blake Eggleston (JIRA)

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

Blake Eggleston updated CASSANDRA-12563:

Status: Ready to Commit  (was: Patch Available)

> Stress daemon help is incorrect
> ---
>
> Key: CASSANDRA-12563
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12563
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Trivial
>  Labels: stress
> Fix For: 3.x
>
>
> It says provide the option -sendToDaemon where as only -send-to and -sendto 
> work
> Fix here:
> https://github.com/chbatey/cassandra-1/tree/stress-daemon



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


[jira] [Commented] (CASSANDRA-13107) Remove -XX:ThreadPriorityPolicy=42 jvm flag

2017-01-06 Thread Wei Deng (JIRA)

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

Wei Deng commented on CASSANDRA-13107:
--

Do we need to create a related JIRA to track the need to find another 
workaround/solution so that non-root C* process can still lower priority of 
some threads?

> Remove -XX:ThreadPriorityPolicy=42 jvm flag
> ---
>
> Key: CASSANDRA-13107
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13107
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Paulo Motta
>Priority: Minor
>
> CASSANDRA-1181 added {{-XX:ThreadPriorityPolicy=42}} jvm flag to support 
> setting native thread priority without root (based on the workaround 
> described on 
> http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html).
> On Java9 this wokaround will not longer be possible due to [JEP 
> 245|https://bugs.openjdk.java.net/browse/JDK-8059557] so this flag should be 
> removed.



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


[jira] [Commented] (CASSANDRA-13090) Coalescing strategy sleep too much

2017-01-06 Thread Ariel Weisberg (JIRA)

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

Ariel Weisberg commented on CASSANDRA-13090:


* I don't think {{otc_coalescing_max_coalesced_messages}} is useful although 
I'm interested in hearing the argument for it. When is pulling more than 128 
items out of the LBQ going to improve performance?
* I think rather for the growing backlog scenario we should skip coalescing 
entirely and rely on back pressure from the socket to block the thread. So 
right now if coalescing says "write stuff" we should skip coalescing until the 
backlog has been drained into the socket. The strategy will need to know about 
the messages so it can log the arrival rate.
* Granted since the batch size is 128 it will still only add the undesired 
coalescing every 128 messages and only if the backlog is < 
{{otc_coaslescing_enough_coalesced_messages}}
* {{otc_coaslescing_enough_coalesced_messages}} in the yaml has a typo
* {{otc_coalescing_window_us}} has a typo in the comment
* Is there an extra drain to in {{coalesceInternal}}? One in the condition and 
another immediately after before checking for enough?

> Coalescing strategy sleep too much
> --
>
> Key: CASSANDRA-13090
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13090
> Project: Cassandra
>  Issue Type: Bug
>  Components: Streaming and Messaging
>Reporter: Corentin Chary
> Fix For: 3.x
>
> Attachments: 0001-Fix-wait-time-coalescing-CASSANDRA-13090.patch
>
>
> With the current code maybeSleep is called even if we managed to take 
> maxItems out of the backlog. In this case we should really avoid sleeping 
> because it means that backlog is building up.
> I'll send a patch shortly.



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


[jira] [Commented] (CASSANDRA-13031) Speed-up start-up sequence by avoiding un-needed flushes

2017-01-06 Thread Ariel Weisberg (JIRA)

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

Ariel Weisberg commented on CASSANDRA-13031:


OK, rebase and running the tests again now.

||code|tests|dtests||
|[3.x|https://github.com/apache/cassandra/compare/cassandra-3.X...aweisberg:cassandra-13031-3.x?expand=1]|[utests|https://cassci.datastax.com/view/Dev/view/aweisberg/job/aweisberg-cassandra-13031-3.x-testall/2/]|[dtests|https://cassci.datastax.com/view/Dev/view/aweisberg/job/aweisberg-cassandra-13031-3.x-dtest/2/]|
|[trunk|https://github.com/apache/cassandra/compare/trunk...aweisberg:cassandra-13031-trunk?expand=1]|[utests|https://cassci.datastax.com/view/Dev/view/aweisberg/job/aweisberg-cassandra-13031-trunk-testall/]|[dtests|https://cassci.datastax.com/view/Dev/view/aweisberg/job/aweisberg-cassandra-13031-trunk-dtest/1/]|



> Speed-up start-up sequence by avoiding un-needed flushes
> 
>
> Key: CASSANDRA-13031
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13031
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Corentin Chary
>Assignee: Corentin Chary
>Priority: Minor
> Fix For: 3.x
>
> Attachments: 0001-Avoid-un-needed-system-flushes-on-startup.patch, 
> debug-fast.log, debug.log, debug_130131.diff, debug_130131_2.diff
>
>
> Similar to CASSANDRA-12969, do a conditional update for all functions
> with a forced blocking flush to avoid slowed-down boot sequences. The
> small performance hit of doing a read is always smaller than the one
> associated with a fsync().



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


[jira] [Commented] (CASSANDRA-10825) OverloadedException is untested

2017-01-06 Thread Edward Capriolo (JIRA)

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

Edward Capriolo commented on CASSANDRA-10825:
-

I agree.Let me know if you need me to rebase.

> OverloadedException is untested
> ---
>
> Key: CASSANDRA-10825
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10825
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local Write-Read Paths
>Reporter: Ariel Weisberg
>Assignee: Edward Capriolo
> Attachments: jmx-hint.png
>
>
> If you grep test/src and cassandra-dtest you will find that the string 
> OverloadedException doesn't appear anywhere.
> In CASSANDRA-10477 it was found that there were cases where Paxos should 
> back-pressure and throw OverloadedException but didn't.
> If OverloadedException is used for functional purposes then we should test 
> that it is thrown under expected conditions. If there are behaviors driven by 
> catching or tracking OverloadedException we should test those as well.



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


[jira] [Commented] (CASSANDRA-12365) Document cassandra stress

2017-01-06 Thread Christopher Batey (JIRA)

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

Christopher Batey commented on CASSANDRA-12365:
---

Thanks [~spo...@gmail.com] I've updated the branch based on your comments

> Document cassandra stress
> -
>
> Key: CASSANDRA-12365
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12365
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Documentation and Website
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Minor
>  Labels: stress
> Fix For: 3.x
>
>
> I've started on this so creating a ticket to avoid duplicate work.



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


[jira] [Commented] (CASSANDRA-12883) Remove support for non-JavaScript UDFs

2017-01-06 Thread Robert Stupp (JIRA)

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

Robert Stupp commented on CASSANDRA-12883:
--

Committed as 0e9e0a4a8319b1b165c21d58a8fe9d9be43fe5a4 to 3.11, too

> Remove support for non-JavaScript UDFs
> --
>
> Key: CASSANDRA-12883
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12883
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 2.2.9, 3.0.11, 3.12
>
>
> As recently reported in the user mailing list, JSR-223 languages other than 
> JavaScript no longer work since version 3.0.
> The reason is that the sandbox implemented in CASSANDRA-9402 restricts the 
> use of "evil" packages, classes and functions. Unfortunately, even "non-evil" 
> packages from JSR-223 providers are blocked.
> In order to get a JSR-223 provider working fine, we need to allow JSR-223 
> provider specific packages and also allow specific runtime permissions.
> The fact that "arbitrary" JSR-223 providers no longer work since 3.0 has just 
> been reported recently, means that this functionality (i.e. non-JavaSCript 
> JSR-223 UDFs) is obviously not used.
> Therefore I propose to remove support for UDFs that do not use Java or 
> JavaScript in 4.0. This will also allow to specialize scripted UDFs on 
> Nashorn and allow to use its security features, although these are limited, 
> more extensively. (Clarification: this ticket is just about to remove that 
> support)
> Also want to point out that we never "officially" supported UDFs that are not 
> Java or JavaScript.
> Sample error message:
> {code}
> Traceback (most recent call last):
>   File "/usr/bin/cqlsh.py", line 1264, in perform_simple_statement
> result = future.result()
>   File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.5.0.post0-d8d0456.zip/cassandra-driver-3.5.0.post0-d8d0456/cassandra/cluster.py",
>  line 3650, in result
> raise self._final_exception
> FunctionFailure: Error from server: code=1400 [User Defined Function failure] 
> message="execution of 'e.test123[bigint]' failed: 
> java.security.AccessControlException: access denied: 
> ("java.lang.RuntimePermission" 
> "accessClassInPackage.org.python.jline.console")
> {code}



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


[2/6] cassandra git commit: Restrict script UDFs to Nashorn

2017-01-06 Thread snazy
Restrict script UDFs to Nashorn


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

Branch: refs/heads/cassandra-3.X
Commit: 0e9e0a4a8319b1b165c21d58a8fe9d9be43fe5a4
Parents: ad8c236
Author: Robert Stupp 
Authored: Fri Dec 9 20:10:16 2016 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:53:46 2017 +0100

--
 CHANGES.txt |   1 +
 NEWS.txt|   3 +
 doc/cql3/CQL.textile|   2 +-
 lib/jsr223/clojure/README.txt   |   8 -
 lib/jsr223/groovy/README.txt|  35 ---
 lib/jsr223/jaskell/README.txt   |   5 -
 lib/jsr223/jruby/README.txt |  54 
 lib/jsr223/jython/README.txt|  33 ---
 lib/jsr223/scala/README.txt |  37 ---
 .../cql3/functions/ScriptBasedUDFunction.java   |  35 +--
 .../cql3/validation/entities/UFScriptTest.java  |   3 +-
 .../validation/entities/UFSecurityTest.java | 268 +++
 12 files changed, 287 insertions(+), 197 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 94bdb4a..1b74dc7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -176,6 +176,7 @@ Merged from 3.0:
  * Correct log message for statistics of offheap memtable flush 
(CASSANDRA-12776)
  * Explicitly set locale for string validation 
(CASSANDRA-12541,CASSANDRA-12542,CASSANDRA-12543,CASSANDRA-12545)
 Merged from 2.2:
+ * Remove support for non-JavaScript UDFs (CASSANDRA-12883)
  * Fix DynamicEndpointSnitch noop in multi-datacenter situations 
(CASSANDRA-13074)
  * cqlsh copy-from: encode column names to avoid primary key parsing errors 
(CASSANDRA-12909)
  * Temporarily fix bug that creates commit log when running offline tools 
(CASSANDRA-8616)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/NEWS.txt
--
diff --git a/NEWS.txt b/NEWS.txt
index e6c8c10..9f376ff 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -21,6 +21,9 @@ Upgrading
- Specifying the default_time_to_live option when creating or altering a
  materialized view was erroneously accepted (and ignored). It is now
  properly rejected.
+   - Only Java and JavaScript are now supported UDF languages.
+ The sandbox in 3.0 already prevented the use of script languages except 
Java
+ and JavaScript.
 
 3.10
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 7d887db..78882a5 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -2078,7 +2078,7 @@ SELECT AVG(players) FROM plays;
 
 h2(#udfs). User-Defined Functions
 
-User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) can be added by adding a JAR to the classpath.
+User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) has been removed in 3.0.11.
 
 UDFs are part of the Cassandra schema.  As such, they are automatically 
propagated to all nodes in the cluster.
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/lib/jsr223/clojure/README.txt
--
diff --git a/lib/jsr223/clojure/README.txt b/lib/jsr223/clojure/README.txt
deleted file mode 100644
index 7ed7551..000
--- a/lib/jsr223/clojure/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cassandra User-Defined-Functions JSR 223 scripting
-=
-
-Unfortunately the JSR-223 support provided by the project 
https://github.com/ato/clojure-jsr223
-and the related ones do not provide compileable script support.
-
-The JSR-223 javax.script.Compilable implementation takes source file names or 
readers but not script sources
-as all other JSR-223 implementations do.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/lib/jsr223/groovy/README.txt
--
diff --git 

[5/6] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/cassandra-3.X
Commit: c5c7f82dbd8cce8e3c04f30b05e1830884a7deed
Parents: 2e675b5 0e9e0a4
Author: Robert Stupp 
Authored: Fri Jan 6 15:54:08 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:54:08 2017 +0100

--

--




[6/6] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread snazy
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 5ce08a728545e57d299b004c67df3fa4cd3fd8ba
Parents: a1f0dcd c5c7f82
Author: Robert Stupp 
Authored: Fri Jan 6 15:54:15 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:54:15 2017 +0100

--

--




[4/6] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/trunk
Commit: c5c7f82dbd8cce8e3c04f30b05e1830884a7deed
Parents: 2e675b5 0e9e0a4
Author: Robert Stupp 
Authored: Fri Jan 6 15:54:08 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:54:08 2017 +0100

--

--




[3/6] cassandra git commit: Restrict script UDFs to Nashorn

2017-01-06 Thread snazy
Restrict script UDFs to Nashorn


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

Branch: refs/heads/trunk
Commit: 0e9e0a4a8319b1b165c21d58a8fe9d9be43fe5a4
Parents: ad8c236
Author: Robert Stupp 
Authored: Fri Dec 9 20:10:16 2016 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:53:46 2017 +0100

--
 CHANGES.txt |   1 +
 NEWS.txt|   3 +
 doc/cql3/CQL.textile|   2 +-
 lib/jsr223/clojure/README.txt   |   8 -
 lib/jsr223/groovy/README.txt|  35 ---
 lib/jsr223/jaskell/README.txt   |   5 -
 lib/jsr223/jruby/README.txt |  54 
 lib/jsr223/jython/README.txt|  33 ---
 lib/jsr223/scala/README.txt |  37 ---
 .../cql3/functions/ScriptBasedUDFunction.java   |  35 +--
 .../cql3/validation/entities/UFScriptTest.java  |   3 +-
 .../validation/entities/UFSecurityTest.java | 268 +++
 12 files changed, 287 insertions(+), 197 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 94bdb4a..1b74dc7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -176,6 +176,7 @@ Merged from 3.0:
  * Correct log message for statistics of offheap memtable flush 
(CASSANDRA-12776)
  * Explicitly set locale for string validation 
(CASSANDRA-12541,CASSANDRA-12542,CASSANDRA-12543,CASSANDRA-12545)
 Merged from 2.2:
+ * Remove support for non-JavaScript UDFs (CASSANDRA-12883)
  * Fix DynamicEndpointSnitch noop in multi-datacenter situations 
(CASSANDRA-13074)
  * cqlsh copy-from: encode column names to avoid primary key parsing errors 
(CASSANDRA-12909)
  * Temporarily fix bug that creates commit log when running offline tools 
(CASSANDRA-8616)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/NEWS.txt
--
diff --git a/NEWS.txt b/NEWS.txt
index e6c8c10..9f376ff 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -21,6 +21,9 @@ Upgrading
- Specifying the default_time_to_live option when creating or altering a
  materialized view was erroneously accepted (and ignored). It is now
  properly rejected.
+   - Only Java and JavaScript are now supported UDF languages.
+ The sandbox in 3.0 already prevented the use of script languages except 
Java
+ and JavaScript.
 
 3.10
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 7d887db..78882a5 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -2078,7 +2078,7 @@ SELECT AVG(players) FROM plays;
 
 h2(#udfs). User-Defined Functions
 
-User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) can be added by adding a JAR to the classpath.
+User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) has been removed in 3.0.11.
 
 UDFs are part of the Cassandra schema.  As such, they are automatically 
propagated to all nodes in the cluster.
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/lib/jsr223/clojure/README.txt
--
diff --git a/lib/jsr223/clojure/README.txt b/lib/jsr223/clojure/README.txt
deleted file mode 100644
index 7ed7551..000
--- a/lib/jsr223/clojure/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cassandra User-Defined-Functions JSR 223 scripting
-=
-
-Unfortunately the JSR-223 support provided by the project 
https://github.com/ato/clojure-jsr223
-and the related ones do not provide compileable script support.
-
-The JSR-223 javax.script.Compilable implementation takes source file names or 
readers but not script sources
-as all other JSR-223 implementations do.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/lib/jsr223/groovy/README.txt
--
diff --git 

[1/6] cassandra git commit: Restrict script UDFs to Nashorn

2017-01-06 Thread snazy
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 ad8c23691 -> 0e9e0a4a8
  refs/heads/cassandra-3.X 2e675b5ca -> c5c7f82db
  refs/heads/trunk a1f0dcdcb -> 5ce08a728


Restrict script UDFs to Nashorn


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

Branch: refs/heads/cassandra-3.11
Commit: 0e9e0a4a8319b1b165c21d58a8fe9d9be43fe5a4
Parents: ad8c236
Author: Robert Stupp 
Authored: Fri Dec 9 20:10:16 2016 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 15:53:46 2017 +0100

--
 CHANGES.txt |   1 +
 NEWS.txt|   3 +
 doc/cql3/CQL.textile|   2 +-
 lib/jsr223/clojure/README.txt   |   8 -
 lib/jsr223/groovy/README.txt|  35 ---
 lib/jsr223/jaskell/README.txt   |   5 -
 lib/jsr223/jruby/README.txt |  54 
 lib/jsr223/jython/README.txt|  33 ---
 lib/jsr223/scala/README.txt |  37 ---
 .../cql3/functions/ScriptBasedUDFunction.java   |  35 +--
 .../cql3/validation/entities/UFScriptTest.java  |   3 +-
 .../validation/entities/UFSecurityTest.java | 268 +++
 12 files changed, 287 insertions(+), 197 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 94bdb4a..1b74dc7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -176,6 +176,7 @@ Merged from 3.0:
  * Correct log message for statistics of offheap memtable flush 
(CASSANDRA-12776)
  * Explicitly set locale for string validation 
(CASSANDRA-12541,CASSANDRA-12542,CASSANDRA-12543,CASSANDRA-12545)
 Merged from 2.2:
+ * Remove support for non-JavaScript UDFs (CASSANDRA-12883)
  * Fix DynamicEndpointSnitch noop in multi-datacenter situations 
(CASSANDRA-13074)
  * cqlsh copy-from: encode column names to avoid primary key parsing errors 
(CASSANDRA-12909)
  * Temporarily fix bug that creates commit log when running offline tools 
(CASSANDRA-8616)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/NEWS.txt
--
diff --git a/NEWS.txt b/NEWS.txt
index e6c8c10..9f376ff 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -21,6 +21,9 @@ Upgrading
- Specifying the default_time_to_live option when creating or altering a
  materialized view was erroneously accepted (and ignored). It is now
  properly rejected.
+   - Only Java and JavaScript are now supported UDF languages.
+ The sandbox in 3.0 already prevented the use of script languages except 
Java
+ and JavaScript.
 
 3.10
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/doc/cql3/CQL.textile
--
diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile
index 7d887db..78882a5 100644
--- a/doc/cql3/CQL.textile
+++ b/doc/cql3/CQL.textile
@@ -2078,7 +2078,7 @@ SELECT AVG(players) FROM plays;
 
 h2(#udfs). User-Defined Functions
 
-User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) can be added by adding a JAR to the classpath.
+User-defined functions allow execution of user-provided code in Cassandra. By 
default, Cassandra supports defining functions in _Java_ and _JavaScript_. 
Support for other JSR 223 compliant scripting languages (such as Python, Ruby, 
and Scala) has been removed in 3.0.11.
 
 UDFs are part of the Cassandra schema.  As such, they are automatically 
propagated to all nodes in the cluster.
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0e9e0a4a/lib/jsr223/clojure/README.txt
--
diff --git a/lib/jsr223/clojure/README.txt b/lib/jsr223/clojure/README.txt
deleted file mode 100644
index 7ed7551..000
--- a/lib/jsr223/clojure/README.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cassandra User-Defined-Functions JSR 223 scripting
-=
-
-Unfortunately the JSR-223 support provided by the project 
https://github.com/ato/clojure-jsr223
-and the related ones do not provide compileable script support.
-
-The JSR-223 javax.script.Compilable implementation takes source file names or 
readers but not script sources
-as all other JSR-223 implementations 

[jira] [Commented] (CASSANDRA-12883) Remove support for non-JavaScript UDFs

2017-01-06 Thread Robert Stupp (JIRA)

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

Robert Stupp commented on CASSANDRA-12883:
--

Huh? I thought 3.11 is closed?

> Remove support for non-JavaScript UDFs
> --
>
> Key: CASSANDRA-12883
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12883
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 2.2.9, 3.0.11, 3.12
>
>
> As recently reported in the user mailing list, JSR-223 languages other than 
> JavaScript no longer work since version 3.0.
> The reason is that the sandbox implemented in CASSANDRA-9402 restricts the 
> use of "evil" packages, classes and functions. Unfortunately, even "non-evil" 
> packages from JSR-223 providers are blocked.
> In order to get a JSR-223 provider working fine, we need to allow JSR-223 
> provider specific packages and also allow specific runtime permissions.
> The fact that "arbitrary" JSR-223 providers no longer work since 3.0 has just 
> been reported recently, means that this functionality (i.e. non-JavaSCript 
> JSR-223 UDFs) is obviously not used.
> Therefore I propose to remove support for UDFs that do not use Java or 
> JavaScript in 4.0. This will also allow to specialize scripted UDFs on 
> Nashorn and allow to use its security features, although these are limited, 
> more extensively. (Clarification: this ticket is just about to remove that 
> support)
> Also want to point out that we never "officially" supported UDFs that are not 
> Java or JavaScript.
> Sample error message:
> {code}
> Traceback (most recent call last):
>   File "/usr/bin/cqlsh.py", line 1264, in perform_simple_statement
> result = future.result()
>   File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.5.0.post0-d8d0456.zip/cassandra-driver-3.5.0.post0-d8d0456/cassandra/cluster.py",
>  line 3650, in result
> raise self._final_exception
> FunctionFailure: Error from server: code=1400 [User Defined Function failure] 
> message="execution of 'e.test123[bigint]' failed: 
> java.security.AccessControlException: access denied: 
> ("java.lang.RuntimePermission" 
> "accessClassInPackage.org.python.jline.console")
> {code}



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


[jira] [Commented] (CASSANDRA-12563) Stress daemon help is incorrect

2017-01-06 Thread Christopher Batey (JIRA)

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

Christopher Batey commented on CASSANDRA-12563:
---

Thanks [~bdeggleston] updated patch here: 
https://github.com/chbatey/cassandra-1/commit/99c82862381c6d6f1c8b2b731411bb60b6921147.patch

> Stress daemon help is incorrect
> ---
>
> Key: CASSANDRA-12563
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12563
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Trivial
>  Labels: stress
> Fix For: 3.x
>
>
> It says provide the option -sendToDaemon where as only -send-to and -sendto 
> work
> Fix here:
> https://github.com/chbatey/cassandra-1/tree/stress-daemon



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


[jira] [Updated] (CASSANDRA-12997) dtest failure in org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName

2017-01-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko updated CASSANDRA-12997:
--
Status: Ready to Commit  (was: Patch Available)

> dtest failure in 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName
> -
>
> Key: CASSANDRA-12997
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12997
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sean McCarthy
>Assignee: Sylvain Lebresne
>  Labels: test-failure, testall
>
> example failure:
> http://cassci.datastax.com/job/trunk_testall/1298/testReport/org.apache.cassandra.cql3.validation.operations/AlterTest/testDropListAndAddListWithSameName
> {code}
> Error Message
> Invalid value for row 0 column 2 (mycollection of type list), expected 
>  but got <[first element]>
> {code}{code}Stacktrace
> junit.framework.AssertionFailedError: Invalid value for row 0 column 2 
> (mycollection of type list), expected  but got <[first element]>
>   at org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:908)
>   at 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName(AlterTest.java:87)
> {code}



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


[jira] [Commented] (CASSANDRA-12997) dtest failure in org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName

2017-01-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-12997:
---

Sorry. Heavy-handed was an unnecessary exaggeration.

But this way in a multiple-node cluster the outcome would still depend on which 
node gets the schema statement, and that node's {{lastTimestampMicros}} value, 
making it generally non-deterministic. So this change doesn't fundamentally fix 
the problem, just feels a bit more right.

That said, who really cares? Go ahead with either option. +1 to the original 
patch.

> dtest failure in 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName
> -
>
> Key: CASSANDRA-12997
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12997
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sean McCarthy
>Assignee: Sylvain Lebresne
>  Labels: test-failure, testall
>
> example failure:
> http://cassci.datastax.com/job/trunk_testall/1298/testReport/org.apache.cassandra.cql3.validation.operations/AlterTest/testDropListAndAddListWithSameName
> {code}
> Error Message
> Invalid value for row 0 column 2 (mycollection of type list), expected 
>  but got <[first element]>
> {code}{code}Stacktrace
> junit.framework.AssertionFailedError: Invalid value for row 0 column 2 
> (mycollection of type list), expected  but got <[first element]>
>   at org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:908)
>   at 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName(AlterTest.java:87)
> {code}



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


[jira] [Commented] (CASSANDRA-11634) Add write timestamp to trace

2017-01-06 Thread Christopher Batey (JIRA)

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

Christopher Batey commented on CASSANDRA-11634:
---

Agreed, this was pretty hacky :)

> Add write timestamp to trace
> 
>
> Key: CASSANDRA-11634
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11634
> Project: Cassandra
>  Issue Type: Improvement
>  Components: Observability
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Minor
> Fix For: 3.x
>
> Attachments: 0001-Add-trace-message-for-write-timestamp.patch
>
>
> Diagnosing issues with clock drift would be easier if trace had the mutation 
> timestamp. I'll add a patch for this soon.
> Patch attached or at: 
> https://github.com/chbatey/cassandra-1/tree/trace-write-timestamp



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


[jira] [Commented] (CASSANDRA-12883) Remove support for non-JavaScript UDFs

2017-01-06 Thread Jeremiah Jordan (JIRA)

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

Jeremiah Jordan commented on CASSANDRA-12883:
-

[~snazy] why did you skip 3.11? If it's a change that went into 3.0 and earlier 
it should go into 3.11 as well no?

> Remove support for non-JavaScript UDFs
> --
>
> Key: CASSANDRA-12883
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12883
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 2.2.9, 3.0.11, 3.12
>
>
> As recently reported in the user mailing list, JSR-223 languages other than 
> JavaScript no longer work since version 3.0.
> The reason is that the sandbox implemented in CASSANDRA-9402 restricts the 
> use of "evil" packages, classes and functions. Unfortunately, even "non-evil" 
> packages from JSR-223 providers are blocked.
> In order to get a JSR-223 provider working fine, we need to allow JSR-223 
> provider specific packages and also allow specific runtime permissions.
> The fact that "arbitrary" JSR-223 providers no longer work since 3.0 has just 
> been reported recently, means that this functionality (i.e. non-JavaSCript 
> JSR-223 UDFs) is obviously not used.
> Therefore I propose to remove support for UDFs that do not use Java or 
> JavaScript in 4.0. This will also allow to specialize scripted UDFs on 
> Nashorn and allow to use its security features, although these are limited, 
> more extensively. (Clarification: this ticket is just about to remove that 
> support)
> Also want to point out that we never "officially" supported UDFs that are not 
> Java or JavaScript.
> Sample error message:
> {code}
> Traceback (most recent call last):
>   File "/usr/bin/cqlsh.py", line 1264, in perform_simple_statement
> result = future.result()
>   File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.5.0.post0-d8d0456.zip/cassandra-driver-3.5.0.post0-d8d0456/cassandra/cluster.py",
>  line 3650, in result
> raise self._final_exception
> FunctionFailure: Error from server: code=1400 [User Defined Function failure] 
> message="execution of 'e.test123[bigint]' failed: 
> java.security.AccessControlException: access denied: 
> ("java.lang.RuntimePermission" 
> "accessClassInPackage.org.python.jline.console")
> {code}



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


[jira] [Updated] (CASSANDRA-13108) Uncaught exeption stack traces not logged

2017-01-06 Thread Christopher Batey (JIRA)

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

Christopher Batey updated CASSANDRA-13108:
--
Status: Patch Available  (was: Open)

Trivial patch here: 
https://github.com/chbatey/cassandra-1/commit/fc81ff82fc96288336836d066d249b35edf44994.patch

> Uncaught exeption stack traces not logged
> -
>
> Key: CASSANDRA-13108
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13108
> Project: Cassandra
>  Issue Type: Bug
>  Components: Core
>Reporter: Christopher Batey
>Assignee: Christopher Batey
>Priority: Trivial
>
> In a refactoring to parameterized logging we lost the stack traces of 
> uncaught exceptions. This means, apart from the thread, I have no idea where 
> they come from e.g.
> {code}
> ERROR [OptionalTasks:1] 2017-01-06 12:53:14,204 CassandraDaemon.java:231 - 
> Exception in thread Thread[OptionalTasks:1,5,main]
> java.lang.NullPointerException: null
> {code}



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


[jira] [Created] (CASSANDRA-13108) Uncaught exeption stack traces not logged

2017-01-06 Thread Christopher Batey (JIRA)
Christopher Batey created CASSANDRA-13108:
-

 Summary: Uncaught exeption stack traces not logged
 Key: CASSANDRA-13108
 URL: https://issues.apache.org/jira/browse/CASSANDRA-13108
 Project: Cassandra
  Issue Type: Bug
  Components: Core
Reporter: Christopher Batey
Assignee: Christopher Batey
Priority: Trivial


In a refactoring to parameterized logging we lost the stack traces of uncaught 
exceptions. This means, apart from the thread, I have no idea where they come 
from e.g.

{code}
ERROR [OptionalTasks:1] 2017-01-06 12:53:14,204 CassandraDaemon.java:231 - 
Exception in thread Thread[OptionalTasks:1,5,main]
java.lang.NullPointerException: null
{code}



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


[jira] [Commented] (CASSANDRA-12997) dtest failure in org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName

2017-01-06 Thread Sylvain Lebresne (JIRA)

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

Sylvain Lebresne commented on CASSANDRA-12997:
--

I think it's unfair to call it heavy-handed. The bulk of the patch is just 
passing {{QueryState}} to {{announceMigration}}, which honestly we could well 
need for any other reason in the future anyway. The only real change here is to 
use {{QueryState.getTimestamp()}} for the drop timestamp, which is pretty 
trivial and is, I claim, TheRightThingToDoâ„¢, as the drop timestamp whole point 
is to be compared to cell timestamps and thus by using the same generator for 
both is just good hygiene. That's the important point here: I don't care about 
the test in practice, but I think drop should have reused our usual way to 
generate timestamps for queries in the first place, and it's high time we do 
this properly. Don't get me wrong, none of this is terribly important, but I 
just don't want to focus on a crappy test when we can actually ever so slightly 
improve the code.

> dtest failure in 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName
> -
>
> Key: CASSANDRA-12997
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12997
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sean McCarthy
>Assignee: Sylvain Lebresne
>  Labels: test-failure, testall
>
> example failure:
> http://cassci.datastax.com/job/trunk_testall/1298/testReport/org.apache.cassandra.cql3.validation.operations/AlterTest/testDropListAndAddListWithSameName
> {code}
> Error Message
> Invalid value for row 0 column 2 (mycollection of type list), expected 
>  but got <[first element]>
> {code}{code}Stacktrace
> junit.framework.AssertionFailedError: Invalid value for row 0 column 2 
> (mycollection of type list), expected  but got <[first element]>
>   at org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:908)
>   at 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName(AlterTest.java:87)
> {code}



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


[jira] [Commented] (CASSANDRA-12997) dtest failure in org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName

2017-01-06 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-12997:
---

TBH this feels just a tiny bit heavy-handed and not really fixing the issue 
(for cases with multiple nodes).

Nor do I think that this is a big issue to be fixed, in general. So the only 
real thing we should address here is the flakiness of the test.

For that I see two slightly simpler options:

1. (Uglier) Just use {{System.currentTimeMillis() + 1}} in 
{{AlterTableStatement}}
2. (Prettier) Now that we have CASSANDRA-7190, in the test itself pass explicit 
timestamp to {{ALTER TABLE DROP}} via {{USING TIMESTAMP}}, and do the same for 
inserts. This would make the test fully deterministic.

> dtest failure in 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName
> -
>
> Key: CASSANDRA-12997
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12997
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sean McCarthy
>Assignee: Sylvain Lebresne
>  Labels: test-failure, testall
>
> example failure:
> http://cassci.datastax.com/job/trunk_testall/1298/testReport/org.apache.cassandra.cql3.validation.operations/AlterTest/testDropListAndAddListWithSameName
> {code}
> Error Message
> Invalid value for row 0 column 2 (mycollection of type list), expected 
>  but got <[first element]>
> {code}{code}Stacktrace
> junit.framework.AssertionFailedError: Invalid value for row 0 column 2 
> (mycollection of type list), expected  but got <[first element]>
>   at org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:908)
>   at 
> org.apache.cassandra.cql3.validation.operations.AlterTest.testDropListAndAddListWithSameName(AlterTest.java:87)
> {code}



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


[1/5] cassandra git commit: ninja: fix thread priorities workaround url on jvm.options

2017-01-06 Thread paulo
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.X 44d2b8009 -> 2e675b5ca
  refs/heads/trunk 29a855e1b -> a1f0dcdcb


ninja: fix thread priorities workaround url on jvm.options


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

Branch: refs/heads/trunk
Commit: 44d2b800981d8e0a2304882b2a33b5f0fffde5d8
Parents: 4fefdee
Author: Paulo Motta 
Authored: Fri Jan 6 09:52:22 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 09:54:37 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/44d2b800/conf/jvm.options
--
diff --git a/conf/jvm.options b/conf/jvm.options
index f91466a..06e9414 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -98,7 +98,7 @@
 
 # allows lowering thread priority without being root on linux - probably
 # not necessary on Windows but doesn't harm anything.
-# see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workar
+# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workararound.html
 -XX:ThreadPriorityPolicy=42
 
 # Enable heap-dump if there's an OOM



[5/5] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread paulo
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: a1f0dcdcb757065ff7c98890e6f7bfd669cd3148
Parents: 640795d 2e675b5
Author: Paulo Motta 
Authored: Fri Jan 6 11:00:12 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 11:00:12 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a1f0dcdc/conf/jvm.options
--



[3/5] cassandra git commit: ninja2: fix thread priorities workaround url on jvm.options

2017-01-06 Thread paulo
ninja2: fix thread priorities workaround url on jvm.options


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

Branch: refs/heads/trunk
Commit: 2e675b5ca3a86e38431e09b46784d8427b106bef
Parents: 44d2b80
Author: Paulo Motta 
Authored: Fri Jan 6 10:59:53 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 10:59:53 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e675b5c/conf/jvm.options
--
diff --git a/conf/jvm.options b/conf/jvm.options
index 06e9414..f5401d2 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -98,7 +98,7 @@
 
 # allows lowering thread priority without being root on linux - probably
 # not necessary on Windows but doesn't harm anything.
-# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workararound.html
+# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html
 -XX:ThreadPriorityPolicy=42
 
 # Enable heap-dump if there's an OOM



[4/5] cassandra git commit: ninja2: fix thread priorities workaround url on jvm.options

2017-01-06 Thread paulo
ninja2: fix thread priorities workaround url on jvm.options


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

Branch: refs/heads/cassandra-3.X
Commit: 2e675b5ca3a86e38431e09b46784d8427b106bef
Parents: 44d2b80
Author: Paulo Motta 
Authored: Fri Jan 6 10:59:53 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 10:59:53 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e675b5c/conf/jvm.options
--
diff --git a/conf/jvm.options b/conf/jvm.options
index 06e9414..f5401d2 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -98,7 +98,7 @@
 
 # allows lowering thread priority without being root on linux - probably
 # not necessary on Windows but doesn't harm anything.
-# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workararound.html
+# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html
 -XX:ThreadPriorityPolicy=42
 
 # Enable heap-dump if there's an OOM



[2/5] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread paulo
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 640795de050f8277f255632188712cb44c6a6dd5
Parents: 29a855e 44d2b80
Author: Paulo Motta 
Authored: Fri Jan 6 10:56:28 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 10:56:28 2017 -0200

--

--




[jira] [Commented] (CASSANDRA-13038) 33% of compaction time spent in StreamingHistogram.update()

2017-01-06 Thread Corentin Chary (JIRA)

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

Corentin Chary commented on CASSANDRA-13038:


For anybody working on this: simple changes to have microbenchmarks for this: 
https://github.com/iksaif/cassandra/commit/9f9886b767de39d9357033aa421197b9bb81bfbd
Note that the compaction microbenchmark should probably add explicit ttls 
because the 50k items are probably added in less than one second.



> 33% of compaction time spent in StreamingHistogram.update()
> ---
>
> Key: CASSANDRA-13038
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13038
> Project: Cassandra
>  Issue Type: Bug
>  Components: Compaction
>Reporter: Corentin Chary
>Assignee: Corentin Chary
> Attachments: compaction-speedup.patch, 
> compaction-streaminghistrogram.png, profiler-snapshot.nps
>
>
> With the following table, that contains a *lot* of cells: 
> {code}
> CREATE TABLE biggraphite.datapoints_11520p_60s (
> metric uuid,
> time_start_ms bigint,
> offset smallint,
> count int,
> value double,
> PRIMARY KEY ((metric, time_start_ms), offset)
> ) WITH CLUSTERING ORDER BY (offset DESC);
> AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 
> 'compaction_window_size': '6', 'compaction_window_unit': 'HOURS', 
> 'max_threshold': '32', 'min_threshold': '6'}
> Keyspace : biggraphite
> Read Count: 1822
> Read Latency: 1.8870054884742042 ms.
> Write Count: 2212271647
> Write Latency: 0.027705127678653473 ms.
> Pending Flushes: 0
> Table: datapoints_11520p_60s
> SSTable count: 47
> Space used (live): 300417555945
> Space used (total): 303147395017
> Space used by snapshots (total): 0
> Off heap memory used (total): 207453042
> SSTable Compression Ratio: 0.4955200053039823
> Number of keys (estimate): 16343723
> Memtable cell count: 220576
> Memtable data size: 17115128
> Memtable off heap memory used: 0
> Memtable switch count: 2872
> Local read count: 0
> Local read latency: NaN ms
> Local write count: 1103167888
> Local write latency: 0.025 ms
> Pending flushes: 0
> Percent repaired: 0.0
> Bloom filter false positives: 0
> Bloom filter false ratio: 0.0
> Bloom filter space used: 105118296
> Bloom filter off heap memory used: 106547192
> Index summary off heap memory used: 27730962
> Compression metadata off heap memory used: 73174888
> Compacted partition minimum bytes: 61
> Compacted partition maximum bytes: 51012
> Compacted partition mean bytes: 7899
> Average live cells per slice (last five minutes): NaN
> Maximum live cells per slice (last five minutes): 0
> Average tombstones per slice (last five minutes): NaN
> Maximum tombstones per slice (last five minutes): 0
> Dropped Mutations: 0
> {code}
> It looks like a good chunk of the compaction time is lost in 
> StreamingHistogram.update() (which is used to store the estimated tombstone 
> drop times).
> This could be caused by a huge number of different deletion times which would 
> makes the bin huge but it this histogram should be capped to 100 keys. It's 
> more likely caused by the huge number of cells.
> A simple solutions could be to only take into accounts part of the cells, the 
> fact the this table has a TWCS also gives us an additional hint that sampling 
> deletion times would be fine.



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


[jira] [Created] (CASSANDRA-13107) Remove -XX:ThreadPriorityPolicy=42 jvm flag

2017-01-06 Thread Paulo Motta (JIRA)
Paulo Motta created CASSANDRA-13107:
---

 Summary: Remove -XX:ThreadPriorityPolicy=42 jvm flag
 Key: CASSANDRA-13107
 URL: https://issues.apache.org/jira/browse/CASSANDRA-13107
 Project: Cassandra
  Issue Type: Sub-task
Reporter: Paulo Motta
Priority: Minor


CASSANDRA-1181 added {{-XX:ThreadPriorityPolicy=42}} jvm flag to support 
setting native thread priority without root (based on the workaround described 
on 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html).

On Java9 this wokaround will not longer be possible due to [JEP 
245|https://bugs.openjdk.java.net/browse/JDK-8059557] so this flag should be 
removed.



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


cassandra git commit: ninja: fix thread priorities workaround url on jvm.options

2017-01-06 Thread paulo
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.X 4fefdee59 -> 44d2b8009


ninja: fix thread priorities workaround url on jvm.options


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

Branch: refs/heads/cassandra-3.X
Commit: 44d2b800981d8e0a2304882b2a33b5f0fffde5d8
Parents: 4fefdee
Author: Paulo Motta 
Authored: Fri Jan 6 09:52:22 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 09:54:37 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/44d2b800/conf/jvm.options
--
diff --git a/conf/jvm.options b/conf/jvm.options
index f91466a..06e9414 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -98,7 +98,7 @@
 
 # allows lowering thread priority without being root on linux - probably
 # not necessary on Windows but doesn't harm anything.
-# see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workar
+# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workararound.html
 -XX:ThreadPriorityPolicy=42
 
 # Enable heap-dump if there's an OOM



[1/2] cassandra git commit: ninja: fix thread priorities workaround url on jvm.options

2017-01-06 Thread paulo
Repository: cassandra
Updated Branches:
  refs/heads/trunk 84b9b9a49 -> 29a855e1b


ninja: fix thread priorities workaround url on jvm.options


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

Branch: refs/heads/trunk
Commit: 5c0aacbacd99bda8ac2b3c00764625939f6a3c52
Parents: 04ee4cc
Author: Paulo Motta 
Authored: Fri Jan 6 09:52:22 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 09:52:22 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c0aacba/conf/jvm.options
--
diff --git a/conf/jvm.options b/conf/jvm.options
index f91466a..06e9414 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -98,7 +98,7 @@
 
 # allows lowering thread priority without being root on linux - probably
 # not necessary on Windows but doesn't harm anything.
-# see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workar
+# see 
http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workararound.html
 -XX:ThreadPriorityPolicy=42
 
 # Enable heap-dump if there's an OOM



[2/2] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread paulo
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 29a855e1bab113b9f748edc050cd615429669253
Parents: 84b9b9a 5c0aacb
Author: Paulo Motta 
Authored: Fri Jan 6 09:53:09 2017 -0200
Committer: Paulo Motta 
Committed: Fri Jan 6 09:53:09 2017 -0200

--
 conf/jvm.options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/29a855e1/conf/jvm.options
--



[jira] [Commented] (CASSANDRA-13038) 33% of compaction time spent in StreamingHistogram.update()

2017-01-06 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-13038:
--

So, to clarify, I was suggesting using a primitive sorted array for the 
histogram, and another primitive array buffer of some size >= the histogram 
(perhaps many multiples of).  When the buffer overflows (or the end is 
reached), sort the buffer, perform a linear merge with the existing histogram 
to select the "largest" N buckets (or just most evenly distributed ones, which 
is slightly different in approach, but probably better), then linear merge 
again to re-populate the histogram.  

There's also the possibility of simply maintaining a priority queue of pairs of 
delta and their histogram bucket value (sorted on the delta only).  If we 
calculate the delta for each item inserted (with its neighbours) and it is 
smaller than the minimum delta in the queue, we perform an O(1) merge instead 
of an insertion; otherwise we remove the head of the queue, and remove its 
matching item in the histogram.  This is algorithmically less efficient, and 
maybe has worse constant factors (hard to say, as fewer rounds, but worse 
memory behaviour), but is a much simpler change.

> 33% of compaction time spent in StreamingHistogram.update()
> ---
>
> Key: CASSANDRA-13038
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13038
> Project: Cassandra
>  Issue Type: Bug
>  Components: Compaction
>Reporter: Corentin Chary
>Assignee: Corentin Chary
> Attachments: compaction-speedup.patch, 
> compaction-streaminghistrogram.png, profiler-snapshot.nps
>
>
> With the following table, that contains a *lot* of cells: 
> {code}
> CREATE TABLE biggraphite.datapoints_11520p_60s (
> metric uuid,
> time_start_ms bigint,
> offset smallint,
> count int,
> value double,
> PRIMARY KEY ((metric, time_start_ms), offset)
> ) WITH CLUSTERING ORDER BY (offset DESC);
> AND compaction = {'class': 
> 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 
> 'compaction_window_size': '6', 'compaction_window_unit': 'HOURS', 
> 'max_threshold': '32', 'min_threshold': '6'}
> Keyspace : biggraphite
> Read Count: 1822
> Read Latency: 1.8870054884742042 ms.
> Write Count: 2212271647
> Write Latency: 0.027705127678653473 ms.
> Pending Flushes: 0
> Table: datapoints_11520p_60s
> SSTable count: 47
> Space used (live): 300417555945
> Space used (total): 303147395017
> Space used by snapshots (total): 0
> Off heap memory used (total): 207453042
> SSTable Compression Ratio: 0.4955200053039823
> Number of keys (estimate): 16343723
> Memtable cell count: 220576
> Memtable data size: 17115128
> Memtable off heap memory used: 0
> Memtable switch count: 2872
> Local read count: 0
> Local read latency: NaN ms
> Local write count: 1103167888
> Local write latency: 0.025 ms
> Pending flushes: 0
> Percent repaired: 0.0
> Bloom filter false positives: 0
> Bloom filter false ratio: 0.0
> Bloom filter space used: 105118296
> Bloom filter off heap memory used: 106547192
> Index summary off heap memory used: 27730962
> Compression metadata off heap memory used: 73174888
> Compacted partition minimum bytes: 61
> Compacted partition maximum bytes: 51012
> Compacted partition mean bytes: 7899
> Average live cells per slice (last five minutes): NaN
> Maximum live cells per slice (last five minutes): 0
> Average tombstones per slice (last five minutes): NaN
> Maximum tombstones per slice (last five minutes): 0
> Dropped Mutations: 0
> {code}
> It looks like a good chunk of the compaction time is lost in 
> StreamingHistogram.update() (which is used to store the estimated tombstone 
> drop times).
> This could be caused by a huge number of different deletion times which would 
> makes the bin huge but it this histogram should be capped to 100 keys. It's 
> more likely caused by the huge number of cells.
> A simple solutions could be to only take into accounts part of the cells, the 
> fact the this table has a TWCS also gives us an additional hint that sampling 
> deletion times would be fine.



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


[jira] [Updated] (CASSANDRA-13106) Unnecessary assertion

2017-01-06 Thread Benedict (JIRA)

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

Benedict updated CASSANDRA-13106:
-
Reviewer:   (was: Benedict)

> Unnecessary assertion
> -
>
> Key: CASSANDRA-13106
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13106
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Simon Zhou
>Assignee: Simon Zhou
>Priority: Minor
> Attachments: CASSANDRA-13106.patch
>
>
> We had over 70 thousand sstables and it's slow to bootstrap new node, even 
> though the CPU utilization for main thread of Cassandra was nearly 100%. So 
> we took a few stack traces and found that the main thread were busy running 
> this line in Tracker.java:
> {code}
> assert Iterables.all(removed, remove);
> {code}
> Not exactly sure whether this line causes CPU utilization/bootstrapping 
> issue, but this line is redundant because the Predict we pass in is 
> Predicates.alwaysTrue(), which means the assertion always 
> returns true. So I propose to remove that line.



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


[jira] [Commented] (CASSANDRA-13106) Unnecessary assertion

2017-01-06 Thread Benedict (JIRA)

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

Benedict commented on CASSANDRA-13106:
--

Hi Simon,

The predicate passed in is not always true - I suggest running "find usages" in 
your IDE before submitting a patch

That's not to say this assertion is still always necessary, but this area of 
code used to be very thorny, so it is assert heavy - after my major refactor I 
don't know of any serious misuses of the code, but that's not to say it isn't 
still possible to misuse it.  It most certainly is, and these asserts protect 
from really serious misbehaviour of the system if that were to happen in 
future.  It is also vanishingly unlikely this assert consumes significant CPU.  
However, while it may seem a single line patch is a shoe-in, I don't really 
have the time to engage in the philosophical debate that might necessarily 
ensue from this consideration.

For the record, etiquette on the project does not generally permit you to 
unilaterally assign somebody a role on a ticket.  Typically you should either 
contact them directly, or at least JIRA mention them in a request that they 
assign themselves a role (or, of course, if you employ them feel free to do 
what you like).  I don't actively participate in the project at present 
(although I do occasionally lurk), so it is a little jarring to suddenly be 
spammed by a half-dozen JIRA emails late at night.


> Unnecessary assertion
> -
>
> Key: CASSANDRA-13106
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13106
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Simon Zhou
>Assignee: Simon Zhou
>Priority: Minor
> Attachments: CASSANDRA-13106.patch
>
>
> We had over 70 thousand sstables and it's slow to bootstrap new node, even 
> though the CPU utilization for main thread of Cassandra was nearly 100%. So 
> we took a few stack traces and found that the main thread were busy running 
> this line in Tracker.java:
> {code}
> assert Iterables.all(removed, remove);
> {code}
> Not exactly sure whether this line causes CPU utilization/bootstrapping 
> issue, but this line is redundant because the Predict we pass in is 
> Predicates.alwaysTrue(), which means the assertion always 
> returns true. So I propose to remove that line.



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


[jira] [Commented] (CASSANDRA-5025) Schema push/pull race

2017-01-06 Thread Daniel van 't Oever (JIRA)

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

Daniel van 't Oever commented on CASSANDRA-5025:


I experience similar problems in a one node cluster. When I start 3 
applications at the same time, they all try to migrate the cassandra schema 
(but will wait for each other using a locking table). However, they will check 
for this lock table using a CREATE TABLE IF NOT EXISTS

Cassandra driver 2.1.10.1

{noformat}
2017-01-03 09:57:22,372 · WARN · cluster2-nio-worker-1 · 
com.datastax.driver.core.RequestHandler · /127.0.0.1:9042 replied with server 
error (java.lang.RuntimeException: java.util.concurrent.ExecutionException: 
org.apache.cassandra.exceptions.ConfigurationException: Column family ID 
mismatch (found a1c87c40-d192-11e6-a126-1d2c09c16740; expected 
a1c56f00-d192-11e6-a126-1d2c09c16740)), defuncting connection. ·  ·  ·  ·
2017-01-03 09:57:22,394 · ERROR · main · 
com.contrastsecurity.cassandra.migration.action.Migrate · Migration of keyspace 
ces2 to version 0.1.0.1 failed! Please restore backups and roll back database 
and code! ·  ·  ·  ·
2017-01-03 09:57:24,652 · ERROR · main · nl.mypackage.CassandraMigrationService 
· Error during migration ·  ·  ·  ·
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried 
for query failed (tried: /127.0.0.1:9042 
(com.datastax.driver.core.exceptions.DriverException: Timeout while trying to 
acquire available connection (you may want to increase the driver number of 
per-host connections)))
at 
com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84)
at 
com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at 
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:217)
   at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:54)
at 
com.contrastsecurity.cassandra.migration.dao.SchemaVersionDAO.tablesExist(SchemaVersionDAO.java:88)
{noformat}

What is the recommended way to perform schema migrations in a Cassandra cluster?

> Schema push/pull race
> -
>
> Key: CASSANDRA-5025
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5025
> Project: Cassandra
>  Issue Type: Bug
>Affects Versions: 1.1.0
>Reporter: Jonathan Ellis
>Assignee: Jonathan Ellis
>Priority: Minor
> Fix For: 1.1.8
>
> Attachments: 5025-v2.txt, 5025-v3.txt, 5025-v4.txt, 5025-v5.txt, 
> 5025.txt
>
>
> When a schema change is made, the coordinator pushes the delta to the other 
> nodes in the cluster.  This is more efficient than sending the entire schema. 
>  But the coordinator also announces the new schema version, so the other 
> nodes' reception of the new version races with processing the delta, and 
> usually seeing the new schema wins.  So the other nodes also issue a pull to 
> the coordinator for the entire schema.
> Thus, schema changes tend to become O(n) in the number of KS and CF present.



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


[jira] [Updated] (CASSANDRA-12794) COPY FROM with NULL='' fails when inserting empty row in primary key

2017-01-06 Thread Stefania (JIRA)

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

Stefania updated CASSANDRA-12794:
-
   Resolution: Fixed
Fix Version/s: (was: 3.0.x)
   (was: 3.x)
   3.10
   3.0.11
Reproduced In: 2.1.15, 2.1.14  (was: 2.1.14, 2.1.15)
   Status: Resolved  (was: Ready to Commit)

Thanks for the review. Committed to 3.0 as 
65bd45523584302572782c45b352bbd2bbd3c558 and merged upwards.

> COPY FROM with NULL='' fails when inserting empty row in primary key 
> -
>
> Key: CASSANDRA-12794
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12794
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
> Environment: Tested using C* 2.1.15
>Reporter: Sucwinder Bassi
>Assignee: Stefania
> Fix For: 3.0.11, 3.10
>
>
> Using this table:
> {noformat}
> CREATE TABLE testtab (  a_id text,  b_id text,  c_id text,  d_id text,  
> order_id uuid,  acc_id bigint,  bucket bigint,  r_id text,  ts bigint,  
> PRIMARY KEY ((a_id, b_id, c_id, d_id), order_id));
> {noformat}
> insert one row:
> {noformat}
> INSERT INTO testtab (a_id, b_id , c_id , d_id , order_id, r_id ) VALUES ( '', 
> '', '', 'a1', 645e7d3c-aef7-4e3c-b834-24b792cf2e55, 'r1');
> {noformat}
> Use COPY to dump the row to temp.csv:
> {noformat}
> copy testtab TO 'temp.csv';
> {noformat}
> Which creates this file:
> {noformat}
> $ cat temp.csv 
> ,,,a1,645e7d3c-aef7-4e3c-b834-24b792cf2e55,,,r1,
> {noformat}
> Truncate the testtab table and then use copy from with NULL='' to insert the 
> row:
> {noformat}
> cqlsh:sbkeyspace> COPY testtab FROM 'temp.csv' with NULL='';
> Using 1 child processes
> Starting copy of sbkeyspace.testtab with columns ['a_id', 'b_id', 'c_id', 
> 'd_id', 'order_id', 'acc_id', 'bucket', 'r_id', 'ts'].
> Failed to import 1 rows: ParseError - Cannot insert null value for primary 
> key column 'a_id'. If you want to insert empty strings, consider using the 
> WITH NULL= option for COPY.,  given up without retries
> Failed to process 1 rows; failed rows written to import_sbkeyspace_testtab.err
> Processed: 1 rows; Rate:   2 rows/s; Avg. rate:   3 rows/s
> 1 rows imported from 1 files in 0.398 seconds (0 skipped).
> {noformat}
> It shows 1 rows inserted, but the table is empty:
> {noformat}
> select * from testtab ;
>  a_id | b_id | c_id | d_id | order_id | acc_id | bucket | r_id | ts
> --+--+--+--+--+++--+
> (0 rows)
> {noformat}
> The same error is returned even without the with NULL=''. Is it actually 
> possible for copy from to insert an empty row into the primary key? The 
> insert command shown above inserts the empty row for the primary key without 
> any problems.
> Is this related to https://issues.apache.org/jira/browse/CASSANDRA-7792?



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


[09/10] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread stefania
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/trunk
Commit: 4fefdee591b21b375735c9dc26e9f1ed916204de
Parents: a90b3fe ad8c236
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:05:00 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:05:00 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


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



[07/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread stefania
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: ad8c23691a81bbdda20eb6dce0b1bce11474fd0c
Parents: e6ee718 65bd455
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:04:29 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:04:29 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad8c2369/CHANGES.txt
--
diff --cc CHANGES.txt
index 64314dc,11b0482..94bdb4a
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,115 -1,6 +1,116 @@@
 -3.0.11
 +3.10
 + * Fixed query monitoring for range queries (CASSANDRA-13050)
 + * Remove outboundBindAny configuration property (CASSANDRA-12673)
 + * Use correct bounds for all-data range when filtering (CASSANDRA-12666)
 + * Remove timing window in test case (CASSANDRA-12875)
 + * Resolve unit testing without JCE security libraries installed 
(CASSANDRA-12945)
 + * Fix inconsistencies in cassandra-stress load balancing policy 
(CASSANDRA-12919)
 + * Fix validation of non-frozen UDT cells (CASSANDRA-12916)
 + * Don't shut down socket input/output on StreamSession (CASSANDRA-12903)
 + * Fix Murmur3PartitionerTest (CASSANDRA-12858)
 + * Move cqlsh syntax rules into separate module and allow easier 
customization (CASSANDRA-12897)
 + * Fix CommitLogSegmentManagerTest (CASSANDRA-12283)
 + * Fix cassandra-stress truncate option (CASSANDRA-12695)
 + * Fix crossNode value when receiving messages (CASSANDRA-12791)
 + * Don't load MX4J beans twice (CASSANDRA-12869)
 + * Extend native protocol request flags, add versions to SUPPORTED, and 
introduce ProtocolVersion enum (CASSANDRA-12838)
 + * Set JOINING mode when running pre-join tasks (CASSANDRA-12836)
 + * remove net.mintern.primitive library due to license issue (CASSANDRA-12845)
 + * Properly format IPv6 addresses when logging JMX service URL 
(CASSANDRA-12454)
 + * Optimize the vnode allocation for single replica per DC (CASSANDRA-12777)
 + * Use non-token restrictions for bounds when token restrictions are 
overridden (CASSANDRA-12419)
 + * Fix CQLSH auto completion for PER PARTITION LIMIT (CASSANDRA-12803)
 + * Use different build directories for Eclipse and Ant (CASSANDRA-12466)
 + * Avoid potential AttributeError in cqlsh due to no table metadata 
(CASSANDRA-12815)
 + * Fix RandomReplicationAwareTokenAllocatorTest.testExistingCluster 
(CASSANDRA-12812)
 + * Upgrade commons-codec to 1.9 (CASSANDRA-12790)
 + * Make the fanout size for LeveledCompactionStrategy to be configurable 
(CASSANDRA-11550)
 + * Add duration data type (CASSANDRA-11873)
 + * Fix timeout in ReplicationAwareTokenAllocatorTest (CASSANDRA-12784)
 + * Improve sum aggregate functions (CASSANDRA-12417)
 + * Make cassandra.yaml docs for batch_size_*_threshold_in_kb reflect changes 
in CASSANDRA-10876 (CASSANDRA-12761)
 + * cqlsh fails to format collections when using aliases (CASSANDRA-11534)
 + * Check for hash conflicts in prepared statements (CASSANDRA-12733)
 + * Exit query parsing upon first error (CASSANDRA-12598)
 + * Fix cassandra-stress to use single seed in UUID generation 
(CASSANDRA-12729)
 + * CQLSSTableWriter does not allow Update statement (CASSANDRA-12450)
 + * Config class uses boxed types but DD exposes primitive types 
(CASSANDRA-12199)
 + * Add pre- and post-shutdown hooks to Storage Service (CASSANDRA-12461)
 + * Add hint delivery metrics (CASSANDRA-12693)
 + * Remove IndexInfo cache from FileIndexInfoRetriever (CASSANDRA-12731)
 + * ColumnIndex does not reuse buffer (CASSANDRA-12502)
 + * cdc column addition still breaks schema migration tasks (CASSANDRA-12697)
 + * Upgrade metrics-reporter dependencies (CASSANDRA-12089)
 + * Tune compaction thread count via nodetool (CASSANDRA-12248)
 + * Add +=/-= shortcut syntax for update queries (CASSANDRA-12232)
 + * Include repair session IDs in repair start message (CASSANDRA-12532)
 + * Add a blocking task to Index, run before joining the ring (CASSANDRA-12039)
 + * Fix NPE when using CQLSSTableWriter (CASSANDRA-12667)
 + * Support optional backpressure strategies at the coordinator 
(CASSANDRA-9318)
 + * Make randompartitioner work with new vnode allocation (CASSANDRA-12647)
 + * Fix cassandra-stress graphing (CASSANDRA-12237)
 + * Allow filtering on partition key columns for queries without secondary 
indexes (CASSANDRA-11031)
 + * Fix Cassandra Stress reporting thread model and precision 

[03/10] cassandra git commit: Replace empty strings with null values if they cannot be converted

2017-01-06 Thread stefania
Replace empty strings with null values if they cannot be converted

patch by Stefania Alborghetti; reviewed by Tyler Hobbs for CASSANDRA-12794


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

Branch: refs/heads/cassandra-3.X
Commit: 65bd45523584302572782c45b352bbd2bbd3c558
Parents: 6e716c6
Author: Stefania Alborghetti 
Authored: Fri Dec 23 15:12:14 2016 +0800
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:03:11 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 77a310d..11b0482 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Replace empty strings with null values if they cannot be converted 
(CASSANDRA-12794)
  * Fixed flacky SSTableRewriterTest: check file counts before calling 
validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index b474f3e..facf9dd 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -2054,6 +2054,13 @@ class ImportConversion(object):
 try:
 return c(v) if v != self.nullval else self.get_null_val()
 except Exception, e:
+# if we could not convert an empty string, then self.nullval 
has been set to a marker
+# because the user needs to import empty strings, except that 
the converters for some types
+# will fail to convert an empty string, in this case the null 
value should be inserted
+# see CASSANDRA-12794
+if v == '':
+return self.get_null_val()
+
 if self.debug:
 traceback.print_exc()
 raise ParseError("Failed to parse %s : %s" % (val, e.message))



[01/10] cassandra git commit: Replace empty strings with null values if they cannot be converted

2017-01-06 Thread stefania
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 6e716c6da -> 65bd45523
  refs/heads/cassandra-3.11 e6ee718c8 -> ad8c23691
  refs/heads/cassandra-3.X a90b3feba -> 4fefdee59
  refs/heads/trunk 8cb8c63e0 -> 84b9b9a49


Replace empty strings with null values if they cannot be converted

patch by Stefania Alborghetti; reviewed by Tyler Hobbs for CASSANDRA-12794


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

Branch: refs/heads/cassandra-3.0
Commit: 65bd45523584302572782c45b352bbd2bbd3c558
Parents: 6e716c6
Author: Stefania Alborghetti 
Authored: Fri Dec 23 15:12:14 2016 +0800
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:03:11 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 77a310d..11b0482 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Replace empty strings with null values if they cannot be converted 
(CASSANDRA-12794)
  * Fixed flacky SSTableRewriterTest: check file counts before calling 
validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index b474f3e..facf9dd 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -2054,6 +2054,13 @@ class ImportConversion(object):
 try:
 return c(v) if v != self.nullval else self.get_null_val()
 except Exception, e:
+# if we could not convert an empty string, then self.nullval 
has been set to a marker
+# because the user needs to import empty strings, except that 
the converters for some types
+# will fail to convert an empty string, in this case the null 
value should be inserted
+# see CASSANDRA-12794
+if v == '':
+return self.get_null_val()
+
 if self.debug:
 traceback.print_exc()
 raise ParseError("Failed to parse %s : %s" % (val, e.message))



[05/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread stefania
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.X
Commit: ad8c23691a81bbdda20eb6dce0b1bce11474fd0c
Parents: e6ee718 65bd455
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:04:29 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:04:29 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad8c2369/CHANGES.txt
--
diff --cc CHANGES.txt
index 64314dc,11b0482..94bdb4a
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,115 -1,6 +1,116 @@@
 -3.0.11
 +3.10
 + * Fixed query monitoring for range queries (CASSANDRA-13050)
 + * Remove outboundBindAny configuration property (CASSANDRA-12673)
 + * Use correct bounds for all-data range when filtering (CASSANDRA-12666)
 + * Remove timing window in test case (CASSANDRA-12875)
 + * Resolve unit testing without JCE security libraries installed 
(CASSANDRA-12945)
 + * Fix inconsistencies in cassandra-stress load balancing policy 
(CASSANDRA-12919)
 + * Fix validation of non-frozen UDT cells (CASSANDRA-12916)
 + * Don't shut down socket input/output on StreamSession (CASSANDRA-12903)
 + * Fix Murmur3PartitionerTest (CASSANDRA-12858)
 + * Move cqlsh syntax rules into separate module and allow easier 
customization (CASSANDRA-12897)
 + * Fix CommitLogSegmentManagerTest (CASSANDRA-12283)
 + * Fix cassandra-stress truncate option (CASSANDRA-12695)
 + * Fix crossNode value when receiving messages (CASSANDRA-12791)
 + * Don't load MX4J beans twice (CASSANDRA-12869)
 + * Extend native protocol request flags, add versions to SUPPORTED, and 
introduce ProtocolVersion enum (CASSANDRA-12838)
 + * Set JOINING mode when running pre-join tasks (CASSANDRA-12836)
 + * remove net.mintern.primitive library due to license issue (CASSANDRA-12845)
 + * Properly format IPv6 addresses when logging JMX service URL 
(CASSANDRA-12454)
 + * Optimize the vnode allocation for single replica per DC (CASSANDRA-12777)
 + * Use non-token restrictions for bounds when token restrictions are 
overridden (CASSANDRA-12419)
 + * Fix CQLSH auto completion for PER PARTITION LIMIT (CASSANDRA-12803)
 + * Use different build directories for Eclipse and Ant (CASSANDRA-12466)
 + * Avoid potential AttributeError in cqlsh due to no table metadata 
(CASSANDRA-12815)
 + * Fix RandomReplicationAwareTokenAllocatorTest.testExistingCluster 
(CASSANDRA-12812)
 + * Upgrade commons-codec to 1.9 (CASSANDRA-12790)
 + * Make the fanout size for LeveledCompactionStrategy to be configurable 
(CASSANDRA-11550)
 + * Add duration data type (CASSANDRA-11873)
 + * Fix timeout in ReplicationAwareTokenAllocatorTest (CASSANDRA-12784)
 + * Improve sum aggregate functions (CASSANDRA-12417)
 + * Make cassandra.yaml docs for batch_size_*_threshold_in_kb reflect changes 
in CASSANDRA-10876 (CASSANDRA-12761)
 + * cqlsh fails to format collections when using aliases (CASSANDRA-11534)
 + * Check for hash conflicts in prepared statements (CASSANDRA-12733)
 + * Exit query parsing upon first error (CASSANDRA-12598)
 + * Fix cassandra-stress to use single seed in UUID generation 
(CASSANDRA-12729)
 + * CQLSSTableWriter does not allow Update statement (CASSANDRA-12450)
 + * Config class uses boxed types but DD exposes primitive types 
(CASSANDRA-12199)
 + * Add pre- and post-shutdown hooks to Storage Service (CASSANDRA-12461)
 + * Add hint delivery metrics (CASSANDRA-12693)
 + * Remove IndexInfo cache from FileIndexInfoRetriever (CASSANDRA-12731)
 + * ColumnIndex does not reuse buffer (CASSANDRA-12502)
 + * cdc column addition still breaks schema migration tasks (CASSANDRA-12697)
 + * Upgrade metrics-reporter dependencies (CASSANDRA-12089)
 + * Tune compaction thread count via nodetool (CASSANDRA-12248)
 + * Add +=/-= shortcut syntax for update queries (CASSANDRA-12232)
 + * Include repair session IDs in repair start message (CASSANDRA-12532)
 + * Add a blocking task to Index, run before joining the ring (CASSANDRA-12039)
 + * Fix NPE when using CQLSSTableWriter (CASSANDRA-12667)
 + * Support optional backpressure strategies at the coordinator 
(CASSANDRA-9318)
 + * Make randompartitioner work with new vnode allocation (CASSANDRA-12647)
 + * Fix cassandra-stress graphing (CASSANDRA-12237)
 + * Allow filtering on partition key columns for queries without secondary 
indexes (CASSANDRA-11031)
 + * Fix Cassandra Stress reporting thread model and 

[02/10] cassandra git commit: Replace empty strings with null values if they cannot be converted

2017-01-06 Thread stefania
Replace empty strings with null values if they cannot be converted

patch by Stefania Alborghetti; reviewed by Tyler Hobbs for CASSANDRA-12794


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

Branch: refs/heads/cassandra-3.11
Commit: 65bd45523584302572782c45b352bbd2bbd3c558
Parents: 6e716c6
Author: Stefania Alborghetti 
Authored: Fri Dec 23 15:12:14 2016 +0800
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:03:11 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 77a310d..11b0482 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Replace empty strings with null values if they cannot be converted 
(CASSANDRA-12794)
  * Fixed flacky SSTableRewriterTest: check file counts before calling 
validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index b474f3e..facf9dd 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -2054,6 +2054,13 @@ class ImportConversion(object):
 try:
 return c(v) if v != self.nullval else self.get_null_val()
 except Exception, e:
+# if we could not convert an empty string, then self.nullval 
has been set to a marker
+# because the user needs to import empty strings, except that 
the converters for some types
+# will fail to convert an empty string, in this case the null 
value should be inserted
+# see CASSANDRA-12794
+if v == '':
+return self.get_null_val()
+
 if self.debug:
 traceback.print_exc()
 raise ParseError("Failed to parse %s : %s" % (val, e.message))



[04/10] cassandra git commit: Replace empty strings with null values if they cannot be converted

2017-01-06 Thread stefania
Replace empty strings with null values if they cannot be converted

patch by Stefania Alborghetti; reviewed by Tyler Hobbs for CASSANDRA-12794


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

Branch: refs/heads/trunk
Commit: 65bd45523584302572782c45b352bbd2bbd3c558
Parents: 6e716c6
Author: Stefania Alborghetti 
Authored: Fri Dec 23 15:12:14 2016 +0800
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:03:11 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 77a310d..11b0482 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Replace empty strings with null values if they cannot be converted 
(CASSANDRA-12794)
  * Fixed flacky SSTableRewriterTest: check file counts before calling 
validateCFS (CASSANDRA-12348)
  * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/65bd4552/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index b474f3e..facf9dd 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -2054,6 +2054,13 @@ class ImportConversion(object):
 try:
 return c(v) if v != self.nullval else self.get_null_val()
 except Exception, e:
+# if we could not convert an empty string, then self.nullval 
has been set to a marker
+# because the user needs to import empty strings, except that 
the converters for some types
+# will fail to convert an empty string, in this case the null 
value should be inserted
+# see CASSANDRA-12794
+if v == '':
+return self.get_null_val()
+
 if self.debug:
 traceback.print_exc()
 raise ParseError("Failed to parse %s : %s" % (val, e.message))



[10/10] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread stefania
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 84b9b9a49d151a91b7288d29933c0e6345de5415
Parents: 8cb8c63 4fefdee
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:06:30 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:06:30 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/84b9b9a4/CHANGES.txt
--
diff --cc CHANGES.txt
index eb1ead7,b47ba37..f96e166
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -142,8 -131,9 +142,9 @@@ Merged from 3.0
   * Remove pre-startup check for open JMX port (CASSANDRA-12074)
   * Remove compaction Severity from DynamicEndpointSnitch (CASSANDRA-11738)
   * Restore resumable hints delivery (CASSANDRA-11960)
 - * Properly report LWT contention (CASSANDRA-12626)
 + * Properly record CAS contention (CASSANDRA-12626)
  Merged from 3.0:
+  * Replace empty strings with null values if they cannot be converted 
(CASSANDRA-12794)
   * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
   * Add parent repair session id to anticompaction log message 
(CASSANDRA-12186)
   * Improve contention handling on failure to acquire MV lock for streaming 
and hints (CASSANDRA-12905)



[06/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread stefania
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.11
Commit: ad8c23691a81bbdda20eb6dce0b1bce11474fd0c
Parents: e6ee718 65bd455
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:04:29 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:04:29 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ad8c2369/CHANGES.txt
--
diff --cc CHANGES.txt
index 64314dc,11b0482..94bdb4a
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,115 -1,6 +1,116 @@@
 -3.0.11
 +3.10
 + * Fixed query monitoring for range queries (CASSANDRA-13050)
 + * Remove outboundBindAny configuration property (CASSANDRA-12673)
 + * Use correct bounds for all-data range when filtering (CASSANDRA-12666)
 + * Remove timing window in test case (CASSANDRA-12875)
 + * Resolve unit testing without JCE security libraries installed 
(CASSANDRA-12945)
 + * Fix inconsistencies in cassandra-stress load balancing policy 
(CASSANDRA-12919)
 + * Fix validation of non-frozen UDT cells (CASSANDRA-12916)
 + * Don't shut down socket input/output on StreamSession (CASSANDRA-12903)
 + * Fix Murmur3PartitionerTest (CASSANDRA-12858)
 + * Move cqlsh syntax rules into separate module and allow easier 
customization (CASSANDRA-12897)
 + * Fix CommitLogSegmentManagerTest (CASSANDRA-12283)
 + * Fix cassandra-stress truncate option (CASSANDRA-12695)
 + * Fix crossNode value when receiving messages (CASSANDRA-12791)
 + * Don't load MX4J beans twice (CASSANDRA-12869)
 + * Extend native protocol request flags, add versions to SUPPORTED, and 
introduce ProtocolVersion enum (CASSANDRA-12838)
 + * Set JOINING mode when running pre-join tasks (CASSANDRA-12836)
 + * remove net.mintern.primitive library due to license issue (CASSANDRA-12845)
 + * Properly format IPv6 addresses when logging JMX service URL 
(CASSANDRA-12454)
 + * Optimize the vnode allocation for single replica per DC (CASSANDRA-12777)
 + * Use non-token restrictions for bounds when token restrictions are 
overridden (CASSANDRA-12419)
 + * Fix CQLSH auto completion for PER PARTITION LIMIT (CASSANDRA-12803)
 + * Use different build directories for Eclipse and Ant (CASSANDRA-12466)
 + * Avoid potential AttributeError in cqlsh due to no table metadata 
(CASSANDRA-12815)
 + * Fix RandomReplicationAwareTokenAllocatorTest.testExistingCluster 
(CASSANDRA-12812)
 + * Upgrade commons-codec to 1.9 (CASSANDRA-12790)
 + * Make the fanout size for LeveledCompactionStrategy to be configurable 
(CASSANDRA-11550)
 + * Add duration data type (CASSANDRA-11873)
 + * Fix timeout in ReplicationAwareTokenAllocatorTest (CASSANDRA-12784)
 + * Improve sum aggregate functions (CASSANDRA-12417)
 + * Make cassandra.yaml docs for batch_size_*_threshold_in_kb reflect changes 
in CASSANDRA-10876 (CASSANDRA-12761)
 + * cqlsh fails to format collections when using aliases (CASSANDRA-11534)
 + * Check for hash conflicts in prepared statements (CASSANDRA-12733)
 + * Exit query parsing upon first error (CASSANDRA-12598)
 + * Fix cassandra-stress to use single seed in UUID generation 
(CASSANDRA-12729)
 + * CQLSSTableWriter does not allow Update statement (CASSANDRA-12450)
 + * Config class uses boxed types but DD exposes primitive types 
(CASSANDRA-12199)
 + * Add pre- and post-shutdown hooks to Storage Service (CASSANDRA-12461)
 + * Add hint delivery metrics (CASSANDRA-12693)
 + * Remove IndexInfo cache from FileIndexInfoRetriever (CASSANDRA-12731)
 + * ColumnIndex does not reuse buffer (CASSANDRA-12502)
 + * cdc column addition still breaks schema migration tasks (CASSANDRA-12697)
 + * Upgrade metrics-reporter dependencies (CASSANDRA-12089)
 + * Tune compaction thread count via nodetool (CASSANDRA-12248)
 + * Add +=/-= shortcut syntax for update queries (CASSANDRA-12232)
 + * Include repair session IDs in repair start message (CASSANDRA-12532)
 + * Add a blocking task to Index, run before joining the ring (CASSANDRA-12039)
 + * Fix NPE when using CQLSSTableWriter (CASSANDRA-12667)
 + * Support optional backpressure strategies at the coordinator 
(CASSANDRA-9318)
 + * Make randompartitioner work with new vnode allocation (CASSANDRA-12647)
 + * Fix cassandra-stress graphing (CASSANDRA-12237)
 + * Allow filtering on partition key columns for queries without secondary 
indexes (CASSANDRA-11031)
 + * Fix Cassandra Stress reporting thread model and 

[08/10] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread stefania
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/cassandra-3.X
Commit: 4fefdee591b21b375735c9dc26e9f1ed916204de
Parents: a90b3fe ad8c236
Author: Stefania Alborghetti 
Authored: Fri Jan 6 10:05:00 2017 +0100
Committer: Stefania Alborghetti 
Committed: Fri Jan 6 10:05:00 2017 +0100

--
 CHANGES.txt| 1 +
 pylib/cqlshlib/copyutil.py | 7 +++
 2 files changed, 8 insertions(+)
--


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



[jira] [Updated] (CASSANDRA-13104) Use StandardCharset instead of Charset.forName()

2017-01-06 Thread Robert Stupp (JIRA)

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

Robert Stupp updated CASSANDRA-13104:
-
Resolution: Fixed
Status: Resolved  (was: Ready to Commit)

Thanks!
Committed as 
[8cb8c63e029b453c706922443d187d029d687af0|https://github.com/apache/cassandra/commit/8cb8c63e029b453c706922443d187d029d687af0]
 to [trunk|https://github.com/apache/cassandra/tree/trunk]


> Use StandardCharset instead of Charset.forName()
> 
>
> Key: CASSANDRA-13104
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13104
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 4.0
>
>
> Trivial change replacing {{Charset.forName()}} with {{StandardCharset}} 
> instances.



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


[jira] [Resolved] (CASSANDRA-12883) Remove support for non-JavaScript UDFs

2017-01-06 Thread Robert Stupp (JIRA)

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

Robert Stupp resolved CASSANDRA-12883.
--
Resolution: Fixed

Oh, sorry for the merge conflicts. 3.11 should have been in the merge path - 
just with {{-s ours}}. Fixed the merge.

> Remove support for non-JavaScript UDFs
> --
>
> Key: CASSANDRA-12883
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12883
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 2.2.9, 3.0.11, 3.12
>
>
> As recently reported in the user mailing list, JSR-223 languages other than 
> JavaScript no longer work since version 3.0.
> The reason is that the sandbox implemented in CASSANDRA-9402 restricts the 
> use of "evil" packages, classes and functions. Unfortunately, even "non-evil" 
> packages from JSR-223 providers are blocked.
> In order to get a JSR-223 provider working fine, we need to allow JSR-223 
> provider specific packages and also allow specific runtime permissions.
> The fact that "arbitrary" JSR-223 providers no longer work since 3.0 has just 
> been reported recently, means that this functionality (i.e. non-JavaSCript 
> JSR-223 UDFs) is obviously not used.
> Therefore I propose to remove support for UDFs that do not use Java or 
> JavaScript in 4.0. This will also allow to specialize scripted UDFs on 
> Nashorn and allow to use its security features, although these are limited, 
> more extensively. (Clarification: this ticket is just about to remove that 
> support)
> Also want to point out that we never "officially" supported UDFs that are not 
> Java or JavaScript.
> Sample error message:
> {code}
> Traceback (most recent call last):
>   File "/usr/bin/cqlsh.py", line 1264, in perform_simple_statement
> result = future.result()
>   File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.5.0.post0-d8d0456.zip/cassandra-driver-3.5.0.post0-d8d0456/cassandra/cluster.py",
>  line 3650, in result
> raise self._final_exception
> FunctionFailure: Error from server: code=1400 [User Defined Function failure] 
> message="execution of 'e.test123[bigint]' failed: 
> java.security.AccessControlException: access denied: 
> ("java.lang.RuntimePermission" 
> "accessClassInPackage.org.python.jline.console")
> {code}



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


[9/9] cassandra git commit: Use StandardCharset instead of Charset.forName()

2017-01-06 Thread snazy
Use StandardCharset instead of Charset.forName()

patch by Robert Stupp; reviewed by Stefania for CASSANDRA-13104


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

Branch: refs/heads/trunk
Commit: 8cb8c63e029b453c706922443d187d029d687af0
Parents: 84c3fee
Author: Robert Stupp 
Authored: Fri Jan 6 09:39:12 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:39:12 2017 +0100

--
 src/java/org/apache/cassandra/db/marshal/AsciiType.java |  6 +++---
 src/java/org/apache/cassandra/db/marshal/UTF8Type.java  |  4 ++--
 .../metrics/DecayingEstimatedHistogramReservoir.java|  9 +++--
 src/java/org/apache/cassandra/transport/CBUtil.java |  4 ++--
 .../org/apache/cassandra/io/util/FileUtilsTest.java |  6 +++---
 .../cassandra/io/util/RandomAccessReaderTest.java   | 12 ++--
 6 files changed, 19 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8cb8c63e/src/java/org/apache/cassandra/db/marshal/AsciiType.java
--
diff --git a/src/java/org/apache/cassandra/db/marshal/AsciiType.java 
b/src/java/org/apache/cassandra/db/marshal/AsciiType.java
index 3cd45de..05077ee 100644
--- a/src/java/org/apache/cassandra/db/marshal/AsciiType.java
+++ b/src/java/org/apache/cassandra/db/marshal/AsciiType.java
@@ -19,9 +19,9 @@ package org.apache.cassandra.db.marshal;
 
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
-import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CharacterCodingException;
+import java.nio.charset.StandardCharsets;
 
 import io.netty.util.concurrent.FastThreadLocal;
 import org.apache.cassandra.cql3.Constants;
@@ -46,7 +46,7 @@ public class AsciiType extends AbstractType
 @Override
 protected CharsetEncoder initialValue()
 {
-return Charset.forName("US-ASCII").newEncoder();
+return StandardCharsets.US_ASCII.newEncoder();
 }
 };
 
@@ -85,7 +85,7 @@ public class AsciiType extends AbstractType
 {
 try
 {
-return '"' + Json.quoteAsJsonString(ByteBufferUtil.string(buffer, 
Charset.forName("US-ASCII"))) + '"';
+return '"' + Json.quoteAsJsonString(ByteBufferUtil.string(buffer, 
StandardCharsets.US_ASCII)) + '"';
 }
 catch (CharacterCodingException exc)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8cb8c63e/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
--
diff --git a/src/java/org/apache/cassandra/db/marshal/UTF8Type.java 
b/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
index 1da6629..46e0d90 100644
--- a/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
+++ b/src/java/org/apache/cassandra/db/marshal/UTF8Type.java
@@ -19,7 +19,7 @@ package org.apache.cassandra.db.marshal;
 
 import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.cassandra.cql3.Constants;
 import org.apache.cassandra.cql3.Json;
@@ -63,7 +63,7 @@ public class UTF8Type extends AbstractType
 {
 try
 {
-return '"' + Json.quoteAsJsonString(ByteBufferUtil.string(buffer, 
Charset.forName("UTF-8"))) + '"';
+return '"' + Json.quoteAsJsonString(ByteBufferUtil.string(buffer, 
StandardCharsets.UTF_8)) + '"';
 }
 catch (CharacterCodingException exc)
 {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8cb8c63e/src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java
--
diff --git 
a/src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java
 
b/src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java
index e0cddee..d5a85cf 100644
--- 
a/src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java
+++ 
b/src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java
@@ -21,7 +21,7 @@ package org.apache.cassandra.metrics;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLongArray;
@@ -48,7 +48,7 @@ import org.apache.cassandra.utils.EstimatedHistogram;
  * end of the 30:th 

[4/9] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread snazy
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.X
Commit: e6ee718c85a53542586c387857c8b4f5ed219bf3
Parents: 26d467e 6e716c6
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:30 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:30 2017 +0100

--

--




[7/9] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/trunk
Commit: a90b3feba584e0bc0d33cd09b661e27b0a24df10
Parents: eca51a0 e6ee718
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:51 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:51 2017 +0100

--

--




[3/9] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread snazy
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.11
Commit: e6ee718c85a53542586c387857c8b4f5ed219bf3
Parents: 26d467e 6e716c6
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:30 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:30 2017 +0100

--

--




[5/9] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2017-01-06 Thread snazy
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: e6ee718c85a53542586c387857c8b4f5ed219bf3
Parents: 26d467e 6e716c6
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:30 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:30 2017 +0100

--

--




[8/9] cassandra git commit: Merge branch 'cassandra-3.X' into trunk

2017-01-06 Thread snazy
Merge branch 'cassandra-3.X' into trunk


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

Branch: refs/heads/trunk
Commit: 84c3feed33d209b92c817a2776f5c96a03a47491
Parents: 2cabf9c a90b3fe
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:58 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:58 2017 +0100

--

--




[2/9] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2017-01-06 Thread snazy
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.11
Commit: 6e716c6da41900950e32a5549b3bb1e858ecad18
Parents: c0765ed 6f360b6
Author: Robert Stupp 
Authored: Thu Jan 5 22:20:31 2017 +0100
Committer: Robert Stupp 
Committed: Thu Jan 5 22:20:31 2017 +0100

--
 CHANGES.txt |  1 +
 NEWS.txt|  3 ++
 doc/cql3/CQL.textile|  2 +-
 lib/jsr223/clojure/README.txt   |  8 ---
 lib/jsr223/groovy/README.txt| 35 -
 lib/jsr223/jaskell/README.txt   |  5 --
 lib/jsr223/jruby/README.txt | 54 
 lib/jsr223/jython/README.txt| 33 
 lib/jsr223/scala/README.txt | 37 --
 .../cql3/functions/ScriptBasedUDFunction.java   | 30 +--
 .../cql3/validation/entities/UFScriptTest.java  |  3 +-
 .../validation/entities/UFSecurityTest.java | 12 -
 12 files changed, 29 insertions(+), 194 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6e716c6d/CHANGES.txt
--
diff --cc CHANGES.txt
index 666a771,b41313d..77a310d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,23 -1,5 +1,24 @@@
 -2.2.9
 +3.0.11
 + * Fixed flacky SSTableRewriterTest: check file counts before calling 
validateCFS (CASSANDRA-12348)
 + * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
 + * Add parent repair session id to anticompaction log message 
(CASSANDRA-12186)
 + * Improve contention handling on failure to acquire MV lock for streaming 
and hints (CASSANDRA-12905)
 + * Fix DELETE and UPDATE queries with empty IN restrictions (CASSANDRA-12829)
 + * Mark MVs as built after successful bootstrap (CASSANDRA-12984)
 + * Estimated TS drop-time histogram updated with Cell.NO_DELETION_TIME 
(CASSANDRA-13040)
 + * Nodetool compactionstats fails with NullPointerException (CASSANDRA-13021)
 + * Thread local pools never cleaned up (CASSANDRA-13033)
 + * Set RPC_READY to false when draining or if a node is marked as shutdown 
(CASSANDRA-12781)
 + * CQL often queries static columns unnecessarily (CASSANDRA-12768)
 + * Make sure sstables only get committed when it's safe to discard commit log 
records (CASSANDRA-12956)
 + * Reject default_time_to_live option when creating or altering MVs 
(CASSANDRA-12868)
 + * Nodetool should use a more sane max heap size (CASSANDRA-12739)
 + * LocalToken ensures token values are cloned on heap (CASSANDRA-12651)
 + * AnticompactionRequestSerializer serializedSize is incorrect 
(CASSANDRA-12934)
 + * Prevent reloading of logback.xml from UDF sandbox (CASSANDRA-12535)
 + * Reenable HeapPool (CASSANDRA-12900)
 +Merged from 2.2:
+  * Remove support for non-JavaScript UDFs (CASSANDRA-12883)
   * Fix DynamicEndpointSnitch noop in multi-datacenter situations 
(CASSANDRA-13074)
   * cqlsh copy-from: encode column names to avoid primary key parsing errors 
(CASSANDRA-12909)
   * Temporarily fix bug that creates commit log when running offline tools 
(CASSANDRA-8616)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6e716c6d/NEWS.txt
--
diff --cc NEWS.txt
index 32b5084,37949a1..b4e6551
--- a/NEWS.txt
+++ b/NEWS.txt
@@@ -13,77 -13,20 +13,80 @@@ restore snapshots created with the prev
  'sstableloader' tool. You can upgrade the file format of your snapshots
  using the provided 'sstableupgrade' tool.
  
 -2.2.9
 +3.0.11
  =
  
 +Upgrading
 +-
 +   - Nothing specific to this release, but please see previous versions 
upgrading section,
 + especially if you are upgrading from 2.2.
 +   - Specifying the default_time_to_live option when creating or altering a
 + materialized view was erroneously accepted (and ignored). It is now
 + properly rejected.
++   - Only Java and JavaScript are now supported UDF languages.
++ The sandbox in 3.0 already prevented the use of script languages except 
Java
++ and JavaScript.
 +
 +3.0.10
 +=
 +
 +Upgrading
 +-
 +   - memtable_allocation_type: offheap_buffers is no longer allowed to be 
specified in the 3.0 series.
 + This was an oversight that can cause segfaults. Offheap was 
re-introduced in 3.4 see CASSANDRA-11039
 + and CASSANDRA-9472 for details.
 +
 +3.0.9
 +=
 +
 +Upgrading
 +-
 +   - The ReversedType behaviour has been corrected for clustering columns of
 

[6/9] cassandra git commit: Merge branch 'cassandra-3.11' into cassandra-3.X

2017-01-06 Thread snazy
Merge branch 'cassandra-3.11' into cassandra-3.X


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

Branch: refs/heads/cassandra-3.X
Commit: a90b3feba584e0bc0d33cd09b661e27b0a24df10
Parents: eca51a0 e6ee718
Author: Robert Stupp 
Authored: Fri Jan 6 09:37:51 2017 +0100
Committer: Robert Stupp 
Committed: Fri Jan 6 09:37:51 2017 +0100

--

--




[1/9] cassandra git commit: Remove support for non-JavaScript UDFs

2017-01-06 Thread snazy
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 26d467e80 -> e6ee718c8
  refs/heads/cassandra-3.X eca51a034 -> a90b3feba
  refs/heads/trunk 2cabf9c49 -> 8cb8c63e0


Remove support for non-JavaScript UDFs

patch by Robert Stupp; reviewed by Tyler Hobbs for CASSANDRA-12883


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

Branch: refs/heads/cassandra-3.11
Commit: 6f360b6d239a7b3d3b625e1bcefcaeb2f6b2be1d
Parents: 0cf0f67
Author: Robert Stupp 
Authored: Thu Jan 5 22:18:37 2017 +0100
Committer: Robert Stupp 
Committed: Thu Jan 5 22:19:50 2017 +0100

--
 CHANGES.txt |  1 +
 NEWS.txt| 16 
 .../cassandra/cql3/functions/ScriptBasedUDF.java|  5 +
 3 files changed, 22 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f360b6d/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index d31ffc8..b41313d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.9
+ * Remove support for non-JavaScript UDFs (CASSANDRA-12883)
  * Fix DynamicEndpointSnitch noop in multi-datacenter situations 
(CASSANDRA-13074)
  * cqlsh copy-from: encode column names to avoid primary key parsing errors 
(CASSANDRA-12909)
  * Temporarily fix bug that creates commit log when running offline tools 
(CASSANDRA-8616)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f360b6d/NEWS.txt
--
diff --git a/NEWS.txt b/NEWS.txt
index 0a3ab36..37949a1 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -13,6 +13,19 @@ restore snapshots created with the previous major version 
using the
 'sstableloader' tool. You can upgrade the file format of your snapshots
 using the provided 'sstableupgrade' tool.
 
+2.2.9
+=
+
+Deprecation
+---
+
+(See note about the new feature User-Defined-Functions in 2.2.0.)
+
+Since the security manager added in 3.0 only allows Java and JavaScript
+UDFs to be run, UDFs for other languages are deprecated and support for
+non-Java and non-JavaScript UDFs is deprecated in 2.2 and has been removed
+in version 3.0.11.
+
 2.2.8
 =
 
@@ -230,6 +243,9 @@ New features
  3.0.  This will inherently be backwards-incompatible with any 2.2
  UDF that perform insecure operations such as opening a socket or
  writing to the filesystem.
+
+ Per the previous note about adding a security manager in 3.0, this 
security manager
+ means that non JavaScipt UDF's won't run, there for their use is 
deprecated.
  
- Row-cache is now fully off-heap.
- jemalloc is now automatically preloaded and used on Linux and OS-X if

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6f360b6d/src/java/org/apache/cassandra/cql3/functions/ScriptBasedUDF.java
--
diff --git a/src/java/org/apache/cassandra/cql3/functions/ScriptBasedUDF.java 
b/src/java/org/apache/cassandra/cql3/functions/ScriptBasedUDF.java
index e55d450..2d46934 100644
--- a/src/java/org/apache/cassandra/cql3/functions/ScriptBasedUDF.java
+++ b/src/java/org/apache/cassandra/cql3/functions/ScriptBasedUDF.java
@@ -73,6 +73,11 @@ public class ScriptBasedUDF extends UDFunction
 {
 super(name, argNames, argTypes, returnType, calledOnNullInput, 
language, body);
 
+if (!"JavaScript".equalsIgnoreCase(language))
+logger.warn("Support for UDFs using '" + language + "' has been 
deprecated and removed in 3.0. If '" +
+language + "' actually is JavaScript, change the 
language used in CREATE/ALTER FUNCTION to " +
+"'javascript'.");
+
 Compilable scriptEngine = scriptEngines.get(language);
 if (scriptEngine == null)
 throw new InvalidRequestException(String.format("Invalid language 
'%s' for function '%s'", language, name));



[jira] [Commented] (CASSANDRA-13090) Coalescing strategy sleep too much

2017-01-06 Thread Corentin Chary (JIRA)

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

Corentin Chary commented on CASSANDRA-13090:


Sure I'll do that. I'll wait for Ariel answer's and additional comments in 
order to batch the changes :)

> Coalescing strategy sleep too much
> --
>
> Key: CASSANDRA-13090
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13090
> Project: Cassandra
>  Issue Type: Bug
>  Components: Streaming and Messaging
>Reporter: Corentin Chary
> Fix For: 3.x
>
> Attachments: 0001-Fix-wait-time-coalescing-CASSANDRA-13090.patch
>
>
> With the current code maybeSleep is called even if we managed to take 
> maxItems out of the backlog. In this case we should really avoid sleeping 
> because it means that backlog is building up.
> I'll send a patch shortly.



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


[jira] [Reopened] (CASSANDRA-12883) Remove support for non-JavaScript UDFs

2017-01-06 Thread Stefania (JIRA)

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

Stefania reopened CASSANDRA-12883:
--

I got conflicts when merging 3.0 into 3.11 for CASSANDRA-12794. 

The conflicts were easy to resolve but {{UFTest}} was failing, and so I decided 
to reopen this ticket rather than carry on with the merge.

> Remove support for non-JavaScript UDFs
> --
>
> Key: CASSANDRA-12883
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12883
> Project: Cassandra
>  Issue Type: Improvement
>  Components: CQL
>Reporter: Robert Stupp
>Assignee: Robert Stupp
>Priority: Minor
> Fix For: 2.2.9, 3.0.11, 3.12
>
>
> As recently reported in the user mailing list, JSR-223 languages other than 
> JavaScript no longer work since version 3.0.
> The reason is that the sandbox implemented in CASSANDRA-9402 restricts the 
> use of "evil" packages, classes and functions. Unfortunately, even "non-evil" 
> packages from JSR-223 providers are blocked.
> In order to get a JSR-223 provider working fine, we need to allow JSR-223 
> provider specific packages and also allow specific runtime permissions.
> The fact that "arbitrary" JSR-223 providers no longer work since 3.0 has just 
> been reported recently, means that this functionality (i.e. non-JavaSCript 
> JSR-223 UDFs) is obviously not used.
> Therefore I propose to remove support for UDFs that do not use Java or 
> JavaScript in 4.0. This will also allow to specialize scripted UDFs on 
> Nashorn and allow to use its security features, although these are limited, 
> more extensively. (Clarification: this ticket is just about to remove that 
> support)
> Also want to point out that we never "officially" supported UDFs that are not 
> Java or JavaScript.
> Sample error message:
> {code}
> Traceback (most recent call last):
>   File "/usr/bin/cqlsh.py", line 1264, in perform_simple_statement
> result = future.result()
>   File 
> "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.5.0.post0-d8d0456.zip/cassandra-driver-3.5.0.post0-d8d0456/cassandra/cluster.py",
>  line 3650, in result
> raise self._final_exception
> FunctionFailure: Error from server: code=1400 [User Defined Function failure] 
> message="execution of 'e.test123[bigint]' failed: 
> java.security.AccessControlException: access denied: 
> ("java.lang.RuntimePermission" 
> "accessClassInPackage.org.python.jline.console")
> {code}



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