[jira] [Commented] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-14169:


Thanks [~VincentWhite] for the review.

bq. }}
The migration-sstables is removed in CASSANDRA-12716, removing them in the 
{{build.xml}}.

bq. 
It wouldn't impact the test, but nice to have. added.

bq. 
It's just to print warning message: 
[LeveledCompactionStrategy.java:69|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java#L69].
 I think it's good to have them in IDE debug.

bq. 
It's added in CASSANDRA-9403. would be nice to have. added.


Also for {{LEGACY_SSTABLE_ROOT}} -> {{LEGACY_SSTABLE_PROP}}, changed.

The patch is updated.



> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Assigned] (CASSANDRA-14164) Calling StorageService.loadNewSSTables function results in deadlock with compaction background task

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson reassigned CASSANDRA-14164:
---

Assignee: Marcus Eriksson

> Calling StorageService.loadNewSSTables function results in deadlock with 
> compaction background task
> ---
>
> Key: CASSANDRA-14164
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14164
> Project: Cassandra
>  Issue Type: Bug
>  Components: Compaction, Tools
> Environment: code
>Reporter: Ignace Desimpel
>Assignee: Marcus Eriksson
>Priority: Blocker
> Fix For: 2.2.x, 3.0.x
>
> Attachments: Stack1.txt
>
>
> Tested on version 2.2.11 (but seems like trunck 3.x is still the same for the 
> related code path), using nodetool refresh for restoring a snapshot
> Calling StorageService.loadNewSSTables function results in deadlock with 
> compaction background task.
> because  : 
> From StorageService class , function public void loadNewSSTables(String 
> ksName, String cfName) a call is made to ColumnFamilyStore class , function 
> public static synchronized void loadNewSSTables(String ksName, String cfName) 
> and then a call to Keyspace class, function public static Keyspace 
> open(String keyspaceName)
> getting to the function private static Keyspace open(String keyspaceName, 
> Schema schema, boolean loadSSTables)
> finally trying to get a lock by synchronized (Keyspace.class)
> So inside the ColumnFamilyStore class lock, there is an attempt to get the 
> lock on the Keyspace.class
> Now at the same time I have the thread OptionalTasks executing the 
> ColumnFamilyStore.getBackgroundCompactionTaskSubmitter() task.
> The thread task is also calling Keyspace.open function, already progressed as 
> far as getting the lock on Keyspace class.
> But then the call also initializes the column families and thus is calling on 
> class ColumnFamilyStore the public static synchronized ColumnFamilyStore 
> createColumnFamilyStore ...
> Result : the external call on loadNewSSTables blocks the internal compaction 
> background task.
> So function 1 locks A and then B
> And function 2 locks B and then A
> leading to deadlock (due to incorrect order of locking objects)
> Regards,
> Ignace



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14140) Add unittest

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-14140:


Hi [~jasobrown], the patch is unittest for CASSANDRA-14109, it doesn't change 
any code logic, but just make it testable.

> Add unittest
> 
>
> Key: CASSANDRA-14140
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14140
> Project: Cassandra
>  Issue Type: Sub-task
>  Components: Testing
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Minor
>  Labels: testing
>
> It's a fairly big change, would be better to have a few unittest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Vincent White (JIRA)

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

Vincent White commented on CASSANDRA-14169:
---

I wonder if we should include the rest of the parameters that are normally 
included by build.xml e.g. 

{code:java}
 
 
 
 {code}


I don't know if it should be its own ticket, but I also noticed this the 
exception message isn't particularly helpful since it outputs the wrong variable

{code: title=org.apache.cassandra.io.sstable.LegacySSTableTest#defineSchema | 
java}
String scp = System.getProperty(LEGACY_SSTABLE_PROP);
Assert.assertNotNull("System property " + LEGACY_SSTABLE_ROOT + " not 
set", scp);
{code}

I believe it is meant to be:

{code: title=org.apache.cassandra.io.sstable.LegacySSTableTest#defineSchema | 
java}
String scp = System.getProperty(LEGACY_SSTABLE_PROP);
Assert.assertNotNull("System property " + LEGACY_SSTABLE_PROP + " not 
set", scp);
{code}

> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-9067) BloomFilter serialization format should not change byte ordering

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang updated CASSANDRA-9067:
--
Status: Patch Available  (was: Awaiting Feedback)

> BloomFilter serialization format should not change byte ordering
> 
>
> Key: CASSANDRA-9067
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9067
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Benedict
>Assignee: Jay Zhuang
>Priority: Minor
> Fix For: 4.x
>
>
> As a follow-up to CASSANDRA-9066 and CASSANDRA-9060, it appears we do some 
> unnecessary byte swapping during the serialization of bloom filters, which 
> makes the logic slower and harder to follow. We should either perform them 
> more efficiently (using Long.reverseBytes) or, preferably, eliminate the 
> conversion altogether since it does not appear to serve any purpose.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-9067) BloomFilter serialization format should not change byte ordering

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-9067:
---

Here is the patch, please review:
| Branch | uTest |
| [9067|https://github.com/cooldoger/cassandra/tree/9067] | 
[!https://circleci.com/gh/cooldoger/cassandra/tree/9067.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/9067]
 |

Here is the microbench test result (Score number is the running time, smaller 
is better):
{noformat}
 [java] Benchmark (numElemsInK)  
(oldBfFormat)  Mode  Cnt  Score   Error  Units
 [java] BloomFilterSerializerBench.serializationTest  1 
  true  avgt4143.170 ?35.566  us/op
 [java] BloomFilterSerializerBench.serializationTest  1 
 false  avgt4 95.692 ?61.473  us/op
 [java] BloomFilterSerializerBench.serializationTest 10 
  true  avgt4662.022 ?   202.386  us/op
 [java] BloomFilterSerializerBench.serializationTest 10 
 false  avgt4186.326 ?87.105  us/op
 [java] BloomFilterSerializerBench.serializationTest100 
  true  avgt4   6312.909 ?  2090.136  us/op
 [java] BloomFilterSerializerBench.serializationTest100 
 false  avgt4   1125.158 ?   553.381  us/op
 [java] BloomFilterSerializerBench.serializationTest   1024 
  true  avgt4  60436.370 ? 16174.150  us/op
 [java] BloomFilterSerializerBench.serializationTest   1024 
 false  avgt4  10781.518 ?  6975.222  us/op
{noformat}

> BloomFilter serialization format should not change byte ordering
> 
>
> Key: CASSANDRA-9067
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9067
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Benedict
>Assignee: Jay Zhuang
>Priority: Minor
> Fix For: 4.x
>
>
> As a follow-up to CASSANDRA-9066 and CASSANDRA-9060, it appears we do some 
> unnecessary byte swapping during the serialization of bloom filters, which 
> makes the logic slower and harder to follow. We should either perform them 
> more efficiently (using Long.reverseBytes) or, preferably, eliminate the 
> conversion altogether since it does not appear to serve any purpose.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang updated CASSANDRA-14169:
---
Status: Patch Available  (was: Open)

> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-14169:


| Branch | uTest |
| [14169|https://github.com/cooldoger/cassandra/tree/14169] | 
[!https://circleci.com/gh/cooldoger/cassandra/tree/14169.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/14169]
 |

> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang updated CASSANDRA-14169:
---
Environment: (was: Unable to run 
{{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
 in the Intellij, because the 
{{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
 is not defined.)

> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang updated CASSANDRA-14169:
---
Description: Unable to run 
{{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
 in the Intellij, because the 
{{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
 is not defined.

> Trivial intellij junit run fix
> --
>
> Key: CASSANDRA-14169
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
> Project: Cassandra
>  Issue Type: Bug
> Environment: Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Trivial
>
> Unable to run 
> {{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
>  in the Intellij, because the 
> {{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
>  is not defined.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Created] (CASSANDRA-14169) Trivial intellij junit run fix

2018-01-15 Thread Jay Zhuang (JIRA)
Jay Zhuang created CASSANDRA-14169:
--

 Summary: Trivial intellij junit run fix
 Key: CASSANDRA-14169
 URL: https://issues.apache.org/jira/browse/CASSANDRA-14169
 Project: Cassandra
  Issue Type: Bug
 Environment: Unable to run 
{{[LegacySSTableTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L63]}}
 in the Intellij, because the 
{{[legacy-sstable-root|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java#L96]}}
 is not defined.
Reporter: Jay Zhuang
Assignee: Jay Zhuang






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14152) Remove unused on-heap BloomFilter implementation

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang updated CASSANDRA-14152:
---
Status: Patch Available  (was: In Progress)

> Remove unused on-heap BloomFilter implementation
> 
>
> Key: CASSANDRA-14152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14152
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Minor
>
> Seems like it's just dead code, should that be removed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Comment Edited] (CASSANDRA-14152) Remove unused on-heap BloomFilter implementation

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang edited comment on CASSANDRA-14152 at 1/16/18 2:08 AM:
-

Thanks [~jasobrown]

Here is the patch for trunk, please review:
| Branch | uTest |
| [14152|https://github.com/cooldoger/cassandra/tree/14152] | 
[!https://circleci.com/gh/cooldoger/cassandra/tree/14152.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/14152]
 |


was (Author: jay.zhuang):
Thanks [~jasobrown]

Here is the patch for trunk, please review:
| Branch | uTest |
| [14152|https://github.com/cooldoger/cassandra/tree/14152] | 
[![https://circleci.com/gh/cooldoger/cassandra/tree/14152.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/14152]]
 |

> Remove unused on-heap BloomFilter implementation
> 
>
> Key: CASSANDRA-14152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14152
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Minor
>
> Seems like it's just dead code, should that be removed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14152) Remove unused on-heap BloomFilter implementation

2018-01-15 Thread Jay Zhuang (JIRA)

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

Jay Zhuang commented on CASSANDRA-14152:


Thanks [~jasobrown]

Here is the patch for trunk, please review:
| Branch | uTest |
| [14152|https://github.com/cooldoger/cassandra/tree/14152] | 
[![https://circleci.com/gh/cooldoger/cassandra/tree/14152.svg?style=svg!|https://circleci.com/gh/cooldoger/cassandra/tree/14152]]
 |

> Remove unused on-heap BloomFilter implementation
> 
>
> Key: CASSANDRA-14152
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14152
> Project: Cassandra
>  Issue Type: Sub-task
>Reporter: Jay Zhuang
>Assignee: Jay Zhuang
>Priority: Minor
>
> Seems like it's just dead code, should that be removed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Created] (CASSANDRA-14168) Throw error when attempting to mutate non-existant table

2018-01-15 Thread Paulo Motta (JIRA)
Paulo Motta created CASSANDRA-14168:
---

 Summary: Throw error when attempting to mutate non-existant table
 Key: CASSANDRA-14168
 URL: https://issues.apache.org/jira/browse/CASSANDRA-14168
 Project: Cassandra
  Issue Type: Bug
Reporter: Paulo Motta
Assignee: Paulo Motta


When a node receives a write request for a table that was just created but it's 
TableMetadata is not yet registered, it will [throw a 
UnknownTableException|https://github.com/apache/cassandra/blob/7a40abb6a5108688fb1b10c375bb751cbb782ea4/src/java/org/apache/cassandra/schema/Schema.java#L474].

There is a small racy period though between when the {{TableMetadata}} [is 
registered|https://github.com/apache/cassandra/blob/88c0e29caaffab41422adc673182bb9549e735ab/src/java/org/apache/cassandra/schema/Schema.java#L642]
 and it's {{ColumnFamilyStore}} is 
[created|https://github.com/apache/cassandra/blob/88c0e29caaffab41422adc673182bb9549e735ab/src/java/org/apache/cassandra/schema/Schema.java#L643],
 that a write request can be [silently dropped due to ColumnFamilyStore not 
being 
instantiated|https://github.com/apache/cassandra/blob/8b3a60b9a7dbefeecc06bace617279612ec7092d/src/java/org/apache/cassandra/db/Keyspace.java#L603]
 - even though an error is logged, the request will be completed and an ack 
wrongly sent to the coordinator.

This was detected during investigation of a flakiness on 
{{materialized_views_test.py:TestMaterializedViews.populate_mv_after_insert_wide_rows_test}}.

ps: this is not an issue before 4.0, because a new table's {{TableMetadata}} 
was only registered after its
 {{ColumnFamilyStore}} object [was 
loaded|https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/config/Schema.java#L671]
 (which appears to be changed by CASSANDRA-9425).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-13943) Infinite compaction of L0 SSTables in JBOD

2018-01-15 Thread Jeremy Hanna (JIRA)

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

Jeremy Hanna updated CASSANDRA-13943:
-
Labels: jbod-aware-compaction  (was: )

> Infinite compaction of L0 SSTables in JBOD
> --
>
> Key: CASSANDRA-13943
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13943
> Project: Cassandra
>  Issue Type: Bug
>  Components: Compaction
> Environment: Cassandra 3.11.0 / Centos 6
>Reporter: Dan Kinder
>Assignee: Marcus Eriksson
>Priority: Major
>  Labels: jbod-aware-compaction
> Attachments: cassandra-jstack-2017-10-12-infinite-sstable-adding.txt, 
> cassandra-jstack-2017-10-12.txt, cassandra.yaml, debug.log, 
> debug.log-with-commit-d8f3f2780, debug.log.1.zip, debug.log.zip, jvm.options
>
>
> I recently upgraded from 2.2.6 to 3.11.0.
> I am seeing Cassandra loop infinitely compacting the same data over and over. 
> Attaching logs.
> It is compacting two tables, one on /srv/disk10, the other on /srv/disk1. It 
> does create new SSTables but immediately recompacts again. Note that I am not 
> inserting anything at the moment, there is no flushing happening on this 
> table (Memtable switch count has not changed).
> My theory is that it somehow thinks those should be compaction candidates. 
> But they shouldn't be, they are on different disks and I ran nodetool 
> relocatesstables as well as nodetool compact. So, it tries to compact them 
> together, but the compaction results in the exact same 2 SSTables on the 2 
> disks, because the keys are split by data disk.
> This is pretty serious, because all our nodes right now are consuming CPU 
> doing this for multiple tables, it seems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-12619) Improve JBOD throughput

2018-01-15 Thread Jeremy Hanna (JIRA)

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

Jeremy Hanna updated CASSANDRA-12619:
-
Labels: jbod-aware-compaction performance  (was: performance)

> Improve JBOD throughput
> ---
>
> Key: CASSANDRA-12619
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12619
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: Natale Galioto
>Priority: Major
>  Labels: jbod-aware-compaction, performance
> Fix For: 4.x
>
>
> Nodes with spinning disks have very limited throughputs during compactions. 
> This is mainly due to 
> [https://issues.apache.org/jira/browse/CASSANDRA-6696][CASSANDRA-6696] where 
> each SSTable got "sticked" to one data directory only. In order to increase 
> the performance during compactions, reads and writes should always happen on 
> different directories, and a single data directory (for both reads or writes) 
> should be used by no more than one compactor at time. The current throughput 
> of a single spinning disk can get as low as 20MB/s due to r/w seeks 
> penalties, but a compaction between two different spindles could easily get 
> 100MB/s or more throughput. Since 6696 requires sstables to always be on the 
> same data directory, even a compaction between two different data directory 
> and then a "brutal" copy back to the "appropriate" directory could get an 
> overall throughput of 50MB/s. Another option would be to let SStables "float" 
> between two data directories only, and "switch" between them at every 
> compaction.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-13948) Reload compaction strategies when JBOD disk boundary changes

2018-01-15 Thread Jeremy Hanna (JIRA)

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

Jeremy Hanna updated CASSANDRA-13948:
-
Labels: jbod-aware-compaction  (was: )

> Reload compaction strategies when JBOD disk boundary changes
> 
>
> Key: CASSANDRA-13948
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13948
> Project: Cassandra
>  Issue Type: Bug
>  Components: Compaction
>Reporter: Paulo Motta
>Assignee: Paulo Motta
>Priority: Major
>  Labels: jbod-aware-compaction
> Fix For: 3.11.2, 4.0
>
> Attachments: 13948dtest.png, 13948testall.png, 3.11-13948-dtest.png, 
> 3.11-13948-testall.png, debug.log, dtest13948.png, dtest2.png, 
> threaddump-cleanup.txt, threaddump.txt, trace.log, trunk-13948-dtest.png, 
> trunk-13948-testall.png
>
>
> The thread dump below shows a race between an sstable replacement by the 
> {{IndexSummaryRedistribution}} and 
> {{AbstractCompactionTask.getNextBackgroundTask}}:
> {noformat}
> Thread 94580: (state = BLOCKED)
>  - sun.misc.Unsafe.park(boolean, long) @bci=0 (Compiled frame; information 
> may be imprecise)
>  - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=14, 
> line=175 (Compiled frame)
>  - 
> java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt() 
> @bci=1, line=836 (Compiled frame)
>  - 
> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(java.util.concurrent.locks.AbstractQueuedSynchronizer$Node,
>  int) @bci=67, line=870 (Compiled frame)
>  - java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(int) 
> @bci=17, line=1199 (Compiled frame)
>  - java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock() @bci=5, 
> line=943 (Compiled frame)
>  - 
> org.apache.cassandra.db.compaction.CompactionStrategyManager.handleListChangedNotification(java.lang.Iterable,
>  java.lang.Iterable) @bci=359, line=483 (Interpreted frame)
>  - 
> org.apache.cassandra.db.compaction.CompactionStrategyManager.handleNotification(org.apache.cassandra.notifications.INotification,
>  java.lang.Object) @bci=53, line=555 (Interpreted frame)
>  - 
> org.apache.cassandra.db.lifecycle.Tracker.notifySSTablesChanged(java.util.Collection,
>  java.util.Collection, org.apache.cassandra.db.compaction.OperationType, 
> java.lang.Throwable) @bci=50, line=409 (Interpreted frame)
>  - 
> org.apache.cassandra.db.lifecycle.LifecycleTransaction.doCommit(java.lang.Throwable)
>  @bci=157, line=227 (Interpreted frame)
>  - 
> org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.commit(java.lang.Throwable)
>  @bci=61, line=116 (Compiled frame)
>  - 
> org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.commit()
>  @bci=2, line=200 (Interpreted frame)
>  - 
> org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.finish()
>  @bci=5, line=185 (Interpreted frame)
>  - 
> org.apache.cassandra.io.sstable.IndexSummaryRedistribution.redistributeSummaries()
>  @bci=559, line=130 (Interpreted frame)
>  - 
> org.apache.cassandra.db.compaction.CompactionManager.runIndexSummaryRedistribution(org.apache.cassandra.io.sstable.IndexSummaryRedistribution)
>  @bci=9, line=1420 (Interpreted frame)
>  - 
> org.apache.cassandra.io.sstable.IndexSummaryManager.redistributeSummaries(org.apache.cassandra.io.sstable.IndexSummaryRedistribution)
>  @bci=4, line=250 (Interpreted frame)
>  - 
> org.apache.cassandra.io.sstable.IndexSummaryManager.redistributeSummaries() 
> @bci=30, line=228 (Interpreted frame)
>  - org.apache.cassandra.io.sstable.IndexSummaryManager$1.runMayThrow() 
> @bci=4, line=125 (Interpreted frame)
>  - org.apache.cassandra.utils.WrappedRunnable.run() @bci=1, line=28 
> (Interpreted frame)
>  - 
> org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor$UncomplainingRunnable.run()
>  @bci=4, line=118 (Compiled frame)
>  - java.util.concurrent.Executors$RunnableAdapter.call() @bci=4, line=511 
> (Compiled frame)
>  - java.util.concurrent.FutureTask.runAndReset() @bci=47, line=308 (Compiled 
> frame)
>  - 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask)
>  @bci=1, line=180 (Compiled frame)
>  - java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() 
> @bci=37, line=294 (Compiled frame)
>  - 
> java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)
>  @bci=95, line=1149 (Compiled frame)
>  - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=624 
> (Interpreted frame)
>  - 
> org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(java.lang.Runnable)
>  @bci=1, line=81 (Interpreted frame)
>  - 

[jira] [Assigned] (CASSANDRA-14023) add_dc_after_mv_network_replication_test - materialized_views_test.TestMaterializedViews fails due to invalid datacenter

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson reassigned CASSANDRA-14023:
---

Assignee: Marcus Eriksson

> add_dc_after_mv_network_replication_test - 
> materialized_views_test.TestMaterializedViews fails due to invalid datacenter
> 
>
> Key: CASSANDRA-14023
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14023
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Assignee: Marcus Eriksson
>Priority: Major
>
> add_dc_after_mv_network_replication_test - 
> materialized_views_test.TestMaterializedViews always fails due to:
>  message="Unrecognized strategy option {dc2} passed to NetworkTopologyStrategy 
> for keyspace ks">



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Assigned] (CASSANDRA-12151) Audit logging for database activity

2018-01-15 Thread Jason Brown (JIRA)

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

Jason Brown reassigned CASSANDRA-12151:
---

Assignee: Anuj Wadehra

> Audit logging for database activity
> ---
>
> Key: CASSANDRA-12151
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12151
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: stefan setyadi
>Assignee: Anuj Wadehra
>Priority: Major
> Fix For: 4.x
>
> Attachments: 12151.txt
>
>
> we would like a way to enable cassandra to log database activity being done 
> on our server.
> It should show username, remote address, timestamp, action type, keyspace, 
> column family, and the query statement.
> it should also be able to log connection attempt and changes to the 
> user/roles.
> I was thinking of making a new keyspace and insert an entry for every 
> activity that occurs.
> Then It would be possible to query for specific activity or a query targeting 
> a specific keyspace and column family.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14024) secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk due to "WITH COMPACT STORAGE"

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson updated CASSANDRA-14024:

Status: Ready to Commit  (was: Patch Available)

> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> -
>
> Key: CASSANDRA-14024
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14024
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Priority: Major
>
> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> Most likely just needs @since("2.0", max_version="3.X")... looks like other 
> ones got this annotation added but this one was missed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14024) secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk due to "WITH COMPACT STORAGE"

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson updated CASSANDRA-14024:

Status: Patch Available  (was: Open)

> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> -
>
> Key: CASSANDRA-14024
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14024
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Priority: Major
>
> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> Most likely just needs @since("2.0", max_version="3.X")... looks like other 
> ones got this annotation added but this one was missed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14024) secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk due to "WITH COMPACT STORAGE"

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson commented on CASSANDRA-14024:
-

+1

> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> -
>
> Key: CASSANDRA-14024
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14024
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Priority: Major
>
> secondary_indexes_test#test_query_indexes_with_vnodes always fails on trunk 
> due to "WITH COMPACT STORAGE"
> Most likely just needs @since("2.0", max_version="3.X")... looks like other 
> ones got this annotation added but this one was missed?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-12151) Audit logging for database activity

2018-01-15 Thread Anuj Wadehra (JIRA)

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

Anuj Wadehra commented on CASSANDRA-12151:
--

[~jasobrown] Yes. Our team is keen to work on this ticket. I will be sharing 
the "Proposal" soon. For now, you can assign the JIRA to me.

> Audit logging for database activity
> ---
>
> Key: CASSANDRA-12151
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12151
> Project: Cassandra
>  Issue Type: New Feature
>Reporter: stefan setyadi
>Priority: Major
> Fix For: 4.x
>
> Attachments: 12151.txt
>
>
> we would like a way to enable cassandra to log database activity being done 
> on our server.
> It should show username, remote address, timestamp, action type, keyspace, 
> column family, and the query statement.
> it should also be able to log connection attempt and changes to the 
> user/roles.
> I was thinking of making a new keyspace and insert an entry for every 
> activity that occurs.
> Then It would be possible to query for specific activity or a query targeting 
> a specific keyspace and column family.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Resolved] (CASSANDRA-14021) test_pycodestyle_compliance - cqlsh_tests.cqlsh_tests.TestCqlsh code style errors

2018-01-15 Thread Jason Brown (JIRA)

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

Jason Brown resolved CASSANDRA-14021.
-
   Resolution: Fixed
 Reviewer: Jay Zhuang
Fix Version/s: 4.0
   3.11.2
   3.0.16
   2.2.12
   2.1.20

While I'm quite sure we won't release another 2.1, I've backported all the way 
to 2.1 and every version up to trunk (your welcome, [~mkjellman] :D).

 

committed as sha \{{f8d73a3acb00d807d09aa33e1612c89389b18480}}.

 

Thanks, all!

> test_pycodestyle_compliance - cqlsh_tests.cqlsh_tests.TestCqlsh code style 
> errors
> -
>
> Key: CASSANDRA-14021
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14021
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Michael Kjellman
>Assignee: Michael Kjellman
>Priority: Major
>  Labels: cqlsh
> Fix For: 2.1.20, 2.2.12, 3.0.16, 3.11.2, 4.0
>
>
> Once we commit CASSANDRA-14020, we'll need to cleanup all of the errors that 
> pycodestyle has found to get the test passing



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[09/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/copyutil.py
--
diff --cc pylib/cqlshlib/copyutil.py
index b72b517,85e2678..c9c5829
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@@ -150,37 -129,28 +150,37 @@@ class SendingChannel(object)
  def num_pending(self):
  return self.pending_messages.qsize() if self.pending_messages else 0
  
 -def recv(self):
 -with self.rlock:
 -return self.reader.recv()
 +def close(self):
 +self.pipe.close()
 +
 +
 +class SendingChannels(object):
 +"""
 +A group of one way channels for sending messages.
 +"""
 +def __init__(self, num_channels):
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [SendingChannel(p) for p in self.pipes]
 +self.num_channels = num_channels
  
  def close(self):
 -self.reader.close()
 -self.writer.close()
 +for ch in self.channels:
 +try:
 +ch.close()
- except:
++except Exception:
 +pass
  
  
 -class OneWayChannels(object):
 +class ReceivingChannels(object):
  """
 -A group of one way channels.
 +A group of one way channels for receiving messages.
  """
  def __init__(self, num_channels):
 -self.channels = [OneWayChannel() for _ in xrange(num_channels)]
 -self._readers = [ch.reader for ch in self.channels]
 -self._rlocks = [ch.rlock for ch in self.channels]
 -self._rlocks_by_readers = dict([(ch.reader, ch.rlock) for ch in 
self.channels])
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [ReceivingChannel(p) for p in self.pipes]
 +self._readers = [p.reader for p in self.pipes]
 +self._rlocks = [p.rlock for p in self.pipes]
 +self._rlocks_by_readers = dict([(p.reader, p.rlock) for p in 
self.pipes])
  self.num_channels = num_channels
  
  self.recv = self.recv_select if IS_LINUX else self.recv_polling

http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/cql3handling.py
--
diff --cc pylib/cqlshlib/cql3handling.py
index 897ee16,012e383..8224ad9
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@@ -34,7 -34,8 +34,8 @@@ class UnexpectedTableStructure(UserWarn
  def __str__(self):
  return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
  
+ 
 -SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 +SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth', 
'system_distributed')
  NONALTERBALE_KEYSPACES = ('system')
  
  
@@@ -785,10 -691,17 +792,11 @@@ def select_relation_lhs_completer(ctxt
  filterable.add(layout.clustering_key[num].name)
  else:
  break
 -for cd in layout.columns.values():
 -if cd.index:
 -filterable.add(cd.name)
 +for idx in layout.indexes.itervalues():
 +filterable.add(idx.index_options["target"])
  return map(maybe_escape_name, filterable)
  
+ 
 -@completer_for('selectClause', 'star')
 -def select_count_star_completer(ctxt, cass):
 -return ['*']
 -
 -
  explain_completion('selector', 'colname')
  
  syntax_rules += r'''
@@@ -1178,12 -1076,11 +1193,13 @@@ explain_completion('createUserTypeState
  
  @completer_for('createIndexStatement', 'col')
  def create_index_col_completer(ctxt, cass):
 +""" Return the columns for which an index doesn't exist yet. """
  layout = get_table_meta(ctxt, cass)
 -colnames = [cd.name for cd in layout.columns.values() if not cd.index]
 +idx_targets = [idx.index_options["target"] for idx in 
layout.indexes.itervalues()]
 +colnames = [cd.name for cd in layout.columns.values() if cd.name not in 
idx_targets]
  return map(maybe_escape_name, colnames)
  
+ 
  syntax_rules += r'''
   ::= "DROP" "KEYSPACE" ("IF" "EXISTS")? 
ksname=
;
@@@ -1403,20 -1246,6 +1421,21 @@@ def username_name_completer(ctxt, cass)
  return [maybe_quote(row.values()[0].replace("'", "''")) for row in 
session.execute("LIST USERS")]
  
  
 +@completer_for('rolename', 'role')
 +def rolename_completer(ctxt, cass):
 +def maybe_quote(name):
 +if CqlRuleSet.is_valid_cql3_name(name):
 +return name
 +return "'%s'" % name
 +
 +# disable completion for CREATE ROLE.
 +if ctxt.matched[0][1].upper() == 'CREATE':
 +return [Hint('')]
 +
 +session = cass.session
 +return [maybe_quote(row[0].replace("'", "''")) for row in 
session.execute("LIST ROLES")]
 +
++
  syntax_rules += r'''
   ::= "CREATE" "TRIGGER" ( "IF" "NOT" "EXISTS" )? 

 "ON" cf= "USING" 
class=


[21/23] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2018-01-15 Thread jasobrown
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/02bbdd63
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02bbdd63
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02bbdd63

Branch: refs/heads/cassandra-3.11
Commit: 02bbdd63422c57efa4ba2356e72d87a28aebaaf8
Parents: 36375f8 685dde1
Author: Jason Brown 
Authored: Mon Jan 15 06:03:50 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:05:04 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 18 ++
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 18 ++
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 53 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/CHANGES.txt
--
diff --cc CHANGES.txt
index 973939e,8696653..ebb7a66
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -41,23 -25,11 +41,25 @@@ Merged from 2.2
   * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
 - * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 -
 -
 -3.0.15
++ * More PEP8 compiance for cqlsh (CASSANDRA-14021)
 +
 +
 +3.11.1
 + * Fix the computation of cdc_total_space_in_mb for exabyte filesystems 
(CASSANDRA-13808)
 + * AbstractTokenTreeBuilder#serializedSize returns wrong value when there is 
a single leaf and overflow collisions (CASSANDRA-13869)
 + * Add a compaction option to TWCS to ignore sstables overlapping checks 
(CASSANDRA-13418)
 + * BTree.Builder memory leak (CASSANDRA-13754)
 + * Revert CASSANDRA-10368 of supporting non-pk column filtering due to 
correctness (CASSANDRA-13798)
 + * Add a skip read validation flag to cassandra-stress (CASSANDRA-13772)
 + * Fix cassandra-stress hang issues when an error during cluster connection 
happens (CASSANDRA-12938)
 + * Better bootstrap failure message when blocked by (potential) range 
movement (CASSANDRA-13744)
 + * "ignore" option is ignored in sstableloader (CASSANDRA-13721)
 + * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652)
 + * Duplicate the buffer before passing it to analyser in SASI operation 
(CASSANDRA-13512)
 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641)
 +Merged from 3.0:
   * Improve TRUNCATE performance (CASSANDRA-13909)
   * Implement short read protection on partition boundaries (CASSANDRA-13595)
   * Fix ISE thrown by UPI.Serializer.hasNext() for some SELECT queries 
(CASSANDRA-13911)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/bin/cqlsh.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/copyutil.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/cql3handling.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/displaying.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/formatting.py
--
diff --cc pylib/cqlshlib/formatting.py
index cf3b32d,dfef609..803ea63
--- a/pylib/cqlshlib/formatting.py
+++ b/pylib/cqlshlib/formatting.py
@@@ -100,18 -99,19 +102,19 @@@ def color_text(bval, colormap, displayw
  displaywidth -= bval.count(r'\\')
  return FormattedValue(bval, coloredval, displaywidth)
  
+ 
  DEFAULT_NANOTIME_FORMAT = '%H:%M:%S.%N'
  DEFAULT_DATE_FORMAT = '%Y-%m-%d'
 -DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S%z'
  
 -if platform.system() == 'Windows':
 -DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
 +DEFAULT_TIMESTAMP_FORMAT = os.environ.get('CQLSH_DEFAULT_TIMESTAMP_FORMAT', 
'')
 +if not DEFAULT_TIMESTAMP_FORMAT:
 +DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S.%f%z'
  
  
 -class DateTimeFormat():
 +class DateTimeFormat:
  
  def __init__(self, timestamp_format=DEFAULT_TIMESTAMP_FORMAT, 
date_format=DEFAULT_DATE_FORMAT,
 - nanotime_format=DEFAULT_NANOTIME_FORMAT, timezone=None):
 + 

[19/23] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2018-01-15 Thread jasobrown
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/685dde10
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/685dde10
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/685dde10

Branch: refs/heads/cassandra-3.11
Commit: 685dde10e3a6b4a27936893840f536fa25ae9da5
Parents: 51bf518 503aec7
Author: Jason Brown 
Authored: Mon Jan 15 06:01:38 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:03:22 2018 -0800

--
 CHANGES.txt|  3 ++-
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/685dde10/CHANGES.txt
--
diff --cc CHANGES.txt
index 0453ddd,055a35d..8696653
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -25,67 -2,11 +25,68 @@@ Merged from 2.2
   * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
-- * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.2.11
 +
 +3.0.15
 + * Improve TRUNCATE performance (CASSANDRA-13909)
 + * Implement short read protection on partition boundaries (CASSANDRA-13595)
 + * Fix ISE thrown by UPI.Serializer.hasNext() for some SELECT queries 
(CASSANDRA-13911)
 + * Filter header only commit logs before recovery (CASSANDRA-13918)
 + * AssertionError prepending to a list (CASSANDRA-13149)
 + * Fix support for SuperColumn tables (CASSANDRA-12373)
 + * Handle limit correctly on tables with strict liveness (CASSANDRA-13883)
 + * Fix missing original update in TriggerExecutor (CASSANDRA-13894)
 + * Remove non-rpc-ready nodes from counter leader candidates (CASSANDRA-13043)
 + * Improve short read protection performance (CASSANDRA-13794)
 + * Fix sstable reader to support range-tombstone-marker for multi-slices 
(CASSANDRA-13787)
 + * Fix short read protection for tables with no clustering columns 
(CASSANDRA-13880)
 + * Make isBuilt volatile in PartitionUpdate (CASSANDRA-13619)
 + * Prevent integer overflow of timestamps in CellTest and RowsTest 
(CASSANDRA-13866)
 + * Fix counter application order in short read protection (CASSANDRA-12872)
 + * Don't block RepairJob execution on validation futures (CASSANDRA-13797)
 + * Wait for all management tasks to complete before shutting down CLSM 
(CASSANDRA-13123)
 + * INSERT statement fails when Tuple type is used as clustering column with 
default DESC order (CASSANDRA-13717)
 + * Fix pending view mutations handling and cleanup batchlog when there are 
local and remote paired mutations (CASSANDRA-13069)
 + * Improve config validation and documentation on overflow and NPE 
(CASSANDRA-13622)
 + * Range deletes in a CAS batch are ignored (CASSANDRA-13655)
 + * Avoid assertion error when IndexSummary > 2G (CASSANDRA-12014)
 + * Change repair midpoint logging for tiny ranges (CASSANDRA-13603)
 + * Better handle corrupt final commitlog segment (CASSANDRA-11995)
 + * StreamingHistogram is not thread safe (CASSANDRA-13756)
 + * Fix MV timestamp issues (CASSANDRA-11500)
 + * Better tolerate improperly formatted bcrypt hashes (CASSANDRA-13626) 
 + * Fix race condition in read command serialization (CASSANDRA-13363)
 + * Enable segement creation before recovering commitlogs (CASSANDRA-13587)
 + * Fix AssertionError in short read protection (CASSANDRA-13747)
 + * Don't skip corrupted sstables on startup (CASSANDRA-13620)
 + * Fix the merging of cells with different user type versions 
(CASSANDRA-13776)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13640)
 + * Potential AssertionError during ReadRepair of range tombstone and 
partition deletions (CASSANDRA-13719)
 + * Don't let stress write warmup data if n=0 (CASSANDRA-13773)
 + * Gossip thread slows down when using batch commit log (CASSANDRA-12966)
 + * Randomize batchlog endpoint selection with only 1 or 2 racks 
(CASSANDRA-12884)
 + * Fix digest calculation for counter cells (CASSANDRA-13750)
 + * Fix ColumnDefinition.cellValueType() for non-frozen collection and change 
SSTabledump to use type.toJSONString() (CASSANDRA-13573)
 + * Skip materialized view addition if the base table doesn't exist 
(CASSANDRA-13737)
 + * Drop table should 

[13/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/bin/cqlsh.py
--
diff --cc bin/cqlsh.py
index 1f63826,000..e242d42
mode 100644,00..100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@@ -1,2588 -1,0 +1,2592 @@@
 +#!/bin/sh
 +# -*- mode: Python -*-
 +
 +# Licensed to the Apache Software Foundation (ASF) under one
 +# or more contributor license agreements.  See the NOTICE file
 +# distributed with this work for additional information
 +# regarding copyright ownership.  The ASF licenses this file
 +# to you under the Apache License, Version 2.0 (the
 +# "License"); you may not use this file except in compliance
 +# with the License.  You may obtain a copy of the License at
 +#
 +# http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +""":"
 +# bash code here; finds a suitable python interpreter and execs this file.
 +# prefer unqualified "python" if suitable:
 +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 
0x0300))' 2>/dev/null \
 +&& exec python "$0" "$@"
 +for pyver in 2.7; do
 +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
 +done
 +echo "No appropriate python interpreter found." >&2
 +exit 1
 +":"""
 +
 +from __future__ import with_statement
 +
 +import cmd
 +import codecs
 +import ConfigParser
 +import csv
 +import getpass
 +import optparse
 +import os
 +import platform
 +import sys
 +import traceback
 +import warnings
 +import webbrowser
 +from StringIO import StringIO
 +from contextlib import contextmanager
 +from glob import glob
 +from uuid import UUID
 +
 +if sys.version_info[0] != 2 or sys.version_info[1] != 7:
 +sys.exit("\nCQL Shell supports only Python 2.7\n")
 +
 +UTF8 = 'utf-8'
 +CP65001 = 'cp65001'  # Win utf-8 variant
 +
 +description = "CQL Shell for Apache Cassandra"
 +version = "5.0.1"
 +
 +readline = None
 +try:
 +# check if tty first, cause readline doesn't check, and only cares
 +# about $TERM. we don't want the funky escape code stuff to be
 +# output if not a tty.
 +if sys.stdin.isatty():
 +import readline
 +except ImportError:
 +pass
 +
 +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-'
 +
 +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 
'..')
 +CASSANDRA_CQL_HTML_FALLBACK = 
'https://cassandra.apache.org/doc/cql3/CQL-2.2.html'
 +
 +if os.path.exists(CASSANDRA_PATH + '/doc/cql3/CQL.html'):
 +# default location of local CQL.html
 +CASSANDRA_CQL_HTML = 'file://' + CASSANDRA_PATH + '/doc/cql3/CQL.html'
 +elif os.path.exists('/usr/share/doc/cassandra/CQL.html'):
 +# fallback to package file
 +CASSANDRA_CQL_HTML = 'file:///usr/share/doc/cassandra/CQL.html'
 +else:
 +# fallback to online version
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +
 +# On Linux, the Python webbrowser module uses the 'xdg-open' executable
 +# to open a file/URL. But that only works, if the current session has been
 +# opened from _within_ a desktop environment. I.e. 'xdg-open' will fail,
 +# if the session's been opened via ssh to a remote box.
 +#
 +# Use 'python' to get some information about the detected browsers.
 +# >>> import webbrowser
 +# >>> webbrowser._tryorder
 +# >>> webbrowser._browser
 +#
 +if len(webbrowser._tryorder) == 0:
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +elif webbrowser._tryorder[0] == 'xdg-open' and 
os.environ.get('XDG_DATA_DIRS', '') == '':
 +# only on Linux (some OS with xdg-open)
 +webbrowser._tryorder.remove('xdg-open')
 +webbrowser._tryorder.append('xdg-open')
 +
 +# use bundled libs for python-cql and thrift, if available. if there
 +# is a ../lib dir, use bundled libs there preferentially.
 +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')]
 +myplatform = platform.system()
 +is_win = myplatform == 'Windows'
 +
 +# Workaround for supporting CP65001 encoding on python < 3.3 
(https://bugs.python.org/issue13216)
 +if is_win and sys.version_info < (3, 3):
 +codecs.register(lambda name: codecs.lookup(UTF8) if name == CP65001 else 
None)
 +
 +if myplatform == 'Linux':
 +ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
 +
 +if os.environ.get('CQLSH_NO_BUNDLED', ''):
 +ZIPLIB_DIRS = ()
 +
 +
 +def find_zip(libprefix):
 +for ziplibdir in ZIPLIB_DIRS:
 +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip'))
 +if zips:
 +return max(zips)   # probably the highest version, if multiple
 +
++
 +cql_zip = find_zip(CQL_LIB_PREFIX)
 +if cql_zip:
 +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
 +sys.path.insert(0, os.path.join(cql_zip, 

[22/23] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

2018-01-15 Thread jasobrown
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/02bbdd63
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/02bbdd63
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/02bbdd63

Branch: refs/heads/trunk
Commit: 02bbdd63422c57efa4ba2356e72d87a28aebaaf8
Parents: 36375f8 685dde1
Author: Jason Brown 
Authored: Mon Jan 15 06:03:50 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:05:04 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 18 ++
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 18 ++
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 53 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/CHANGES.txt
--
diff --cc CHANGES.txt
index 973939e,8696653..ebb7a66
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -41,23 -25,11 +41,25 @@@ Merged from 2.2
   * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
 - * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 -
 -
 -3.0.15
++ * More PEP8 compiance for cqlsh (CASSANDRA-14021)
 +
 +
 +3.11.1
 + * Fix the computation of cdc_total_space_in_mb for exabyte filesystems 
(CASSANDRA-13808)
 + * AbstractTokenTreeBuilder#serializedSize returns wrong value when there is 
a single leaf and overflow collisions (CASSANDRA-13869)
 + * Add a compaction option to TWCS to ignore sstables overlapping checks 
(CASSANDRA-13418)
 + * BTree.Builder memory leak (CASSANDRA-13754)
 + * Revert CASSANDRA-10368 of supporting non-pk column filtering due to 
correctness (CASSANDRA-13798)
 + * Add a skip read validation flag to cassandra-stress (CASSANDRA-13772)
 + * Fix cassandra-stress hang issues when an error during cluster connection 
happens (CASSANDRA-12938)
 + * Better bootstrap failure message when blocked by (potential) range 
movement (CASSANDRA-13744)
 + * "ignore" option is ignored in sstableloader (CASSANDRA-13721)
 + * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652)
 + * Duplicate the buffer before passing it to analyser in SASI operation 
(CASSANDRA-13512)
 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641)
 +Merged from 3.0:
   * Improve TRUNCATE performance (CASSANDRA-13909)
   * Implement short read protection on partition boundaries (CASSANDRA-13595)
   * Fix ISE thrown by UPI.Serializer.hasNext() for some SELECT queries 
(CASSANDRA-13911)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/bin/cqlsh.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/copyutil.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/cql3handling.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/displaying.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02bbdd63/pylib/cqlshlib/formatting.py
--
diff --cc pylib/cqlshlib/formatting.py
index cf3b32d,dfef609..803ea63
--- a/pylib/cqlshlib/formatting.py
+++ b/pylib/cqlshlib/formatting.py
@@@ -100,18 -99,19 +102,19 @@@ def color_text(bval, colormap, displayw
  displaywidth -= bval.count(r'\\')
  return FormattedValue(bval, coloredval, displaywidth)
  
+ 
  DEFAULT_NANOTIME_FORMAT = '%H:%M:%S.%N'
  DEFAULT_DATE_FORMAT = '%Y-%m-%d'
 -DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S%z'
  
 -if platform.system() == 'Windows':
 -DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
 +DEFAULT_TIMESTAMP_FORMAT = os.environ.get('CQLSH_DEFAULT_TIMESTAMP_FORMAT', 
'')
 +if not DEFAULT_TIMESTAMP_FORMAT:
 +DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S.%f%z'
  
  
 -class DateTimeFormat():
 +class DateTimeFormat:
  
  def __init__(self, timestamp_format=DEFAULT_TIMESTAMP_FORMAT, 
date_format=DEFAULT_DATE_FORMAT,
 - nanotime_format=DEFAULT_NANOTIME_FORMAT, timezone=None):
 + 

[12/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/copyutil.py
--
diff --cc pylib/cqlshlib/copyutil.py
index b72b517,85e2678..c9c5829
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@@ -150,37 -129,28 +150,37 @@@ class SendingChannel(object)
  def num_pending(self):
  return self.pending_messages.qsize() if self.pending_messages else 0
  
 -def recv(self):
 -with self.rlock:
 -return self.reader.recv()
 +def close(self):
 +self.pipe.close()
 +
 +
 +class SendingChannels(object):
 +"""
 +A group of one way channels for sending messages.
 +"""
 +def __init__(self, num_channels):
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [SendingChannel(p) for p in self.pipes]
 +self.num_channels = num_channels
  
  def close(self):
 -self.reader.close()
 -self.writer.close()
 +for ch in self.channels:
 +try:
 +ch.close()
- except:
++except Exception:
 +pass
  
  
 -class OneWayChannels(object):
 +class ReceivingChannels(object):
  """
 -A group of one way channels.
 +A group of one way channels for receiving messages.
  """
  def __init__(self, num_channels):
 -self.channels = [OneWayChannel() for _ in xrange(num_channels)]
 -self._readers = [ch.reader for ch in self.channels]
 -self._rlocks = [ch.rlock for ch in self.channels]
 -self._rlocks_by_readers = dict([(ch.reader, ch.rlock) for ch in 
self.channels])
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [ReceivingChannel(p) for p in self.pipes]
 +self._readers = [p.reader for p in self.pipes]
 +self._rlocks = [p.rlock for p in self.pipes]
 +self._rlocks_by_readers = dict([(p.reader, p.rlock) for p in 
self.pipes])
  self.num_channels = num_channels
  
  self.recv = self.recv_select if IS_LINUX else self.recv_polling

http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/cql3handling.py
--
diff --cc pylib/cqlshlib/cql3handling.py
index 897ee16,012e383..8224ad9
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@@ -34,7 -34,8 +34,8 @@@ class UnexpectedTableStructure(UserWarn
  def __str__(self):
  return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
  
+ 
 -SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 +SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth', 
'system_distributed')
  NONALTERBALE_KEYSPACES = ('system')
  
  
@@@ -785,10 -691,17 +792,11 @@@ def select_relation_lhs_completer(ctxt
  filterable.add(layout.clustering_key[num].name)
  else:
  break
 -for cd in layout.columns.values():
 -if cd.index:
 -filterable.add(cd.name)
 +for idx in layout.indexes.itervalues():
 +filterable.add(idx.index_options["target"])
  return map(maybe_escape_name, filterable)
  
+ 
 -@completer_for('selectClause', 'star')
 -def select_count_star_completer(ctxt, cass):
 -return ['*']
 -
 -
  explain_completion('selector', 'colname')
  
  syntax_rules += r'''
@@@ -1178,12 -1076,11 +1193,13 @@@ explain_completion('createUserTypeState
  
  @completer_for('createIndexStatement', 'col')
  def create_index_col_completer(ctxt, cass):
 +""" Return the columns for which an index doesn't exist yet. """
  layout = get_table_meta(ctxt, cass)
 -colnames = [cd.name for cd in layout.columns.values() if not cd.index]
 +idx_targets = [idx.index_options["target"] for idx in 
layout.indexes.itervalues()]
 +colnames = [cd.name for cd in layout.columns.values() if cd.name not in 
idx_targets]
  return map(maybe_escape_name, colnames)
  
+ 
  syntax_rules += r'''
   ::= "DROP" "KEYSPACE" ("IF" "EXISTS")? 
ksname=
;
@@@ -1403,20 -1246,6 +1421,21 @@@ def username_name_completer(ctxt, cass)
  return [maybe_quote(row.values()[0].replace("'", "''")) for row in 
session.execute("LIST USERS")]
  
  
 +@completer_for('rolename', 'role')
 +def rolename_completer(ctxt, cass):
 +def maybe_quote(name):
 +if CqlRuleSet.is_valid_cql3_name(name):
 +return name
 +return "'%s'" % name
 +
 +# disable completion for CREATE ROLE.
 +if ctxt.matched[0][1].upper() == 'CREATE':
 +return [Hint('')]
 +
 +session = cass.session
 +return [maybe_quote(row[0].replace("'", "''")) for row in 
session.execute("LIST ROLES")]
 +
++
  syntax_rules += r'''
   ::= "CREATE" "TRIGGER" ( "IF" "NOT" "EXISTS" )? 

 "ON" cf= "USING" 
class=


[23/23] cassandra git commit: Merge branch 'cassandra-3.11' into trunk

2018-01-15 Thread jasobrown
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: 6d324f9d769f24ac209f6ea7649fee02b0200ba0
Parents: 1e58a53 02bbdd6
Author: Jason Brown 
Authored: Mon Jan 15 06:05:35 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:06:51 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 18 ++
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 18 ++
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 53 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6d324f9d/CHANGES.txt
--
diff --cc CHANGES.txt
index e38cd70,ebb7a66..0cda459
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -218,6 -42,8 +218,8 @@@ Merged from 2.2
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
   * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
 - * More PEP8 compiance for cqlsh (CASSANDRA-14021)
++ * More PEP8 compliance for cqlsh
  
  
  3.11.1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6d324f9d/bin/cqlsh.py
--

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6d324f9d/pylib/cqlshlib/cql3handling.py
--


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



[04/23] cassandra git commit: More PEP8 compliance for cqlsh

2018-01-15 Thread jasobrown
More PEP8 compliance for cqlsh

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14021


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

Branch: refs/heads/cassandra-3.0
Commit: f8d73a3acb00d807d09aa33e1612c89389b18480
Parents: d4fd82b
Author: Michael Kjellman 
Authored: Tue Nov 14 20:51:37 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:56:44 2018 -0800

--
 CHANGES.txt|  2 +-
 bin/cqlsh  |  4 
 pylib/cqlshlib/copyutil.py |  6 +++---
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 46 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index b4e6f75..6e1ca85 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.1.20
- * 
+ * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 
 2.1.19
  * Add storage port options to sstableloader (CASSANDRA-13844)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 6317ec9..30840db 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -83,6 +83,7 @@ def find_zip(libprefix):
 if zips:
 return max(zips)   # probably the highest version, if multiple
 
+
 cql_zip = find_zip(CQL_LIB_PREFIX)
 if cql_zip:
 ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
@@ -522,6 +523,8 @@ def show_warning_without_quoting_line(message, category, 
filename, lineno, file=
 file.write(warnings.formatwarning(message, category, filename, lineno, 
line=''))
 except IOError:
 pass
+
+
 warnings.showwarning = show_warning_without_quoting_line
 warnings.filterwarnings('always', 
category=cql3handling.UnexpectedTableStructure)
 
@@ -2213,6 +2216,7 @@ def main(options, hostname, port):
 if batch_mode and shell.statement_error:
 sys.exit(2)
 
+
 # always call this regardless of module name: when a sub-process is spawned
 # on Windows then the module name is not __main__, see CASSANDRA-9304
 insert_driver_hooks()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 3a45353..85e2678 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -191,7 +191,7 @@ class OneWayChannels(object):
 for ch in self.channels:
 try:
 ch.close()
-except:
+except Exception:
 pass
 
 
@@ -1967,8 +1967,8 @@ class ImportConversion(object):
 pk_values = []
 for i in partition_key_indexes:
 val = serialize(i, row[i])
-l = len(val)
-pk_values.append(struct.pack(">H%dsB" % l, l, val, 0))
+length = len(val)
+pk_values.append(struct.pack(">H%dsB" % length, length, val, 
0))
 return b"".join(pk_values)
 
 if len(partition_key_indexes) == 1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 029e0c7..012e383 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -34,6 +34,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
+
 SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 NONALTERBALE_KEYSPACES = ('system')
 
@@ -109,6 +110,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
 cqlword = cqlword[1:-1].replace("''", "'")
 return cqlword
 
+
 CqlRuleSet = Cql3ParsingRuleSet()
 
 # convenience for remainder of module
@@ -306,6 +308,7 @@ def prop_equals_completer(ctxt, cass):
 return ()
 return ['=']
 
+
 completer_for('property', 'propeq')(prop_equals_completer)
 
 
@@ -529,6 +532,7 @@ def ks_name_completer(ctxt, cass):
 def cf_ks_name_completer(ctxt, cass):
 return [maybe_escape_name(ks) + '.' for ks in 

[11/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
Merge branch 'cassandra-2.1' into cassandra-2.2


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

Branch: refs/heads/cassandra-2.2
Commit: 503aec74a56a5aada7398bf38b67ceb8743b027e
Parents: b800f3c f8d73a3
Author: Jason Brown 
Authored: Mon Jan 15 05:58:04 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:01:14 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/CHANGES.txt
--
diff --cc CHANGES.txt
index 266ed14,6e1ca85..055a35d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,9 +1,27 @@@
 -2.1.20
 +2.2.12
 + * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
 + * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
 + * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
++Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.1.19
 +2.2.11
 + * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)
 + * Fix load over calculated issue in IndexSummaryRedistribution 
(CASSANDRA-13738)
 + * Fix compaction and flush exception not captured (CASSANDRA-13833)
 + * Make BatchlogManagerMBean.forceBatchlogReplay() blocking (CASSANDRA-13809)
 + * Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
 + * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 + * Fix queries with LIMIT and filtering on clustering columns 
(CASSANDRA-11223)
 + * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
 + * Remove unused max_value_size_in_mb config setting from yaml 
(CASSANDRA-13625
 +Merged from 2.1:
   * Add storage port options to sstableloader (CASSANDRA-13844)
 - * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775) 
 + * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775)
   * Clone HeartBeatState when building gossip messages. Make its 
generation/version volatile (CASSANDRA-13700)
  
  


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



[16/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/bin/cqlsh.py
--
diff --cc bin/cqlsh.py
index 1f63826,000..e242d42
mode 100644,00..100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@@ -1,2588 -1,0 +1,2592 @@@
 +#!/bin/sh
 +# -*- mode: Python -*-
 +
 +# Licensed to the Apache Software Foundation (ASF) under one
 +# or more contributor license agreements.  See the NOTICE file
 +# distributed with this work for additional information
 +# regarding copyright ownership.  The ASF licenses this file
 +# to you under the Apache License, Version 2.0 (the
 +# "License"); you may not use this file except in compliance
 +# with the License.  You may obtain a copy of the License at
 +#
 +# http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +""":"
 +# bash code here; finds a suitable python interpreter and execs this file.
 +# prefer unqualified "python" if suitable:
 +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 
0x0300))' 2>/dev/null \
 +&& exec python "$0" "$@"
 +for pyver in 2.7; do
 +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
 +done
 +echo "No appropriate python interpreter found." >&2
 +exit 1
 +":"""
 +
 +from __future__ import with_statement
 +
 +import cmd
 +import codecs
 +import ConfigParser
 +import csv
 +import getpass
 +import optparse
 +import os
 +import platform
 +import sys
 +import traceback
 +import warnings
 +import webbrowser
 +from StringIO import StringIO
 +from contextlib import contextmanager
 +from glob import glob
 +from uuid import UUID
 +
 +if sys.version_info[0] != 2 or sys.version_info[1] != 7:
 +sys.exit("\nCQL Shell supports only Python 2.7\n")
 +
 +UTF8 = 'utf-8'
 +CP65001 = 'cp65001'  # Win utf-8 variant
 +
 +description = "CQL Shell for Apache Cassandra"
 +version = "5.0.1"
 +
 +readline = None
 +try:
 +# check if tty first, cause readline doesn't check, and only cares
 +# about $TERM. we don't want the funky escape code stuff to be
 +# output if not a tty.
 +if sys.stdin.isatty():
 +import readline
 +except ImportError:
 +pass
 +
 +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-'
 +
 +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 
'..')
 +CASSANDRA_CQL_HTML_FALLBACK = 
'https://cassandra.apache.org/doc/cql3/CQL-2.2.html'
 +
 +if os.path.exists(CASSANDRA_PATH + '/doc/cql3/CQL.html'):
 +# default location of local CQL.html
 +CASSANDRA_CQL_HTML = 'file://' + CASSANDRA_PATH + '/doc/cql3/CQL.html'
 +elif os.path.exists('/usr/share/doc/cassandra/CQL.html'):
 +# fallback to package file
 +CASSANDRA_CQL_HTML = 'file:///usr/share/doc/cassandra/CQL.html'
 +else:
 +# fallback to online version
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +
 +# On Linux, the Python webbrowser module uses the 'xdg-open' executable
 +# to open a file/URL. But that only works, if the current session has been
 +# opened from _within_ a desktop environment. I.e. 'xdg-open' will fail,
 +# if the session's been opened via ssh to a remote box.
 +#
 +# Use 'python' to get some information about the detected browsers.
 +# >>> import webbrowser
 +# >>> webbrowser._tryorder
 +# >>> webbrowser._browser
 +#
 +if len(webbrowser._tryorder) == 0:
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +elif webbrowser._tryorder[0] == 'xdg-open' and 
os.environ.get('XDG_DATA_DIRS', '') == '':
 +# only on Linux (some OS with xdg-open)
 +webbrowser._tryorder.remove('xdg-open')
 +webbrowser._tryorder.append('xdg-open')
 +
 +# use bundled libs for python-cql and thrift, if available. if there
 +# is a ../lib dir, use bundled libs there preferentially.
 +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')]
 +myplatform = platform.system()
 +is_win = myplatform == 'Windows'
 +
 +# Workaround for supporting CP65001 encoding on python < 3.3 
(https://bugs.python.org/issue13216)
 +if is_win and sys.version_info < (3, 3):
 +codecs.register(lambda name: codecs.lookup(UTF8) if name == CP65001 else 
None)
 +
 +if myplatform == 'Linux':
 +ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
 +
 +if os.environ.get('CQLSH_NO_BUNDLED', ''):
 +ZIPLIB_DIRS = ()
 +
 +
 +def find_zip(libprefix):
 +for ziplibdir in ZIPLIB_DIRS:
 +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip'))
 +if zips:
 +return max(zips)   # probably the highest version, if multiple
 +
++
 +cql_zip = find_zip(CQL_LIB_PREFIX)
 +if cql_zip:
 +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
 +sys.path.insert(0, os.path.join(cql_zip, 

[05/23] cassandra git commit: More PEP8 compliance for cqlsh

2018-01-15 Thread jasobrown
More PEP8 compliance for cqlsh

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14021


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

Branch: refs/heads/cassandra-3.11
Commit: f8d73a3acb00d807d09aa33e1612c89389b18480
Parents: d4fd82b
Author: Michael Kjellman 
Authored: Tue Nov 14 20:51:37 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:56:44 2018 -0800

--
 CHANGES.txt|  2 +-
 bin/cqlsh  |  4 
 pylib/cqlshlib/copyutil.py |  6 +++---
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 46 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index b4e6f75..6e1ca85 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.1.20
- * 
+ * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 
 2.1.19
  * Add storage port options to sstableloader (CASSANDRA-13844)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 6317ec9..30840db 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -83,6 +83,7 @@ def find_zip(libprefix):
 if zips:
 return max(zips)   # probably the highest version, if multiple
 
+
 cql_zip = find_zip(CQL_LIB_PREFIX)
 if cql_zip:
 ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
@@ -522,6 +523,8 @@ def show_warning_without_quoting_line(message, category, 
filename, lineno, file=
 file.write(warnings.formatwarning(message, category, filename, lineno, 
line=''))
 except IOError:
 pass
+
+
 warnings.showwarning = show_warning_without_quoting_line
 warnings.filterwarnings('always', 
category=cql3handling.UnexpectedTableStructure)
 
@@ -2213,6 +2216,7 @@ def main(options, hostname, port):
 if batch_mode and shell.statement_error:
 sys.exit(2)
 
+
 # always call this regardless of module name: when a sub-process is spawned
 # on Windows then the module name is not __main__, see CASSANDRA-9304
 insert_driver_hooks()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 3a45353..85e2678 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -191,7 +191,7 @@ class OneWayChannels(object):
 for ch in self.channels:
 try:
 ch.close()
-except:
+except Exception:
 pass
 
 
@@ -1967,8 +1967,8 @@ class ImportConversion(object):
 pk_values = []
 for i in partition_key_indexes:
 val = serialize(i, row[i])
-l = len(val)
-pk_values.append(struct.pack(">H%dsB" % l, l, val, 0))
+length = len(val)
+pk_values.append(struct.pack(">H%dsB" % length, length, val, 
0))
 return b"".join(pk_values)
 
 if len(partition_key_indexes) == 1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 029e0c7..012e383 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -34,6 +34,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
+
 SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 NONALTERBALE_KEYSPACES = ('system')
 
@@ -109,6 +110,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
 cqlword = cqlword[1:-1].replace("''", "'")
 return cqlword
 
+
 CqlRuleSet = Cql3ParsingRuleSet()
 
 # convenience for remainder of module
@@ -306,6 +308,7 @@ def prop_equals_completer(ctxt, cass):
 return ()
 return ['=']
 
+
 completer_for('property', 'propeq')(prop_equals_completer)
 
 
@@ -529,6 +532,7 @@ def ks_name_completer(ctxt, cass):
 def cf_ks_name_completer(ctxt, cass):
 return [maybe_escape_name(ks) + '.' for ks in 

[15/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/copyutil.py
--
diff --cc pylib/cqlshlib/copyutil.py
index b72b517,85e2678..c9c5829
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@@ -150,37 -129,28 +150,37 @@@ class SendingChannel(object)
  def num_pending(self):
  return self.pending_messages.qsize() if self.pending_messages else 0
  
 -def recv(self):
 -with self.rlock:
 -return self.reader.recv()
 +def close(self):
 +self.pipe.close()
 +
 +
 +class SendingChannels(object):
 +"""
 +A group of one way channels for sending messages.
 +"""
 +def __init__(self, num_channels):
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [SendingChannel(p) for p in self.pipes]
 +self.num_channels = num_channels
  
  def close(self):
 -self.reader.close()
 -self.writer.close()
 +for ch in self.channels:
 +try:
 +ch.close()
- except:
++except Exception:
 +pass
  
  
 -class OneWayChannels(object):
 +class ReceivingChannels(object):
  """
 -A group of one way channels.
 +A group of one way channels for receiving messages.
  """
  def __init__(self, num_channels):
 -self.channels = [OneWayChannel() for _ in xrange(num_channels)]
 -self._readers = [ch.reader for ch in self.channels]
 -self._rlocks = [ch.rlock for ch in self.channels]
 -self._rlocks_by_readers = dict([(ch.reader, ch.rlock) for ch in 
self.channels])
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [ReceivingChannel(p) for p in self.pipes]
 +self._readers = [p.reader for p in self.pipes]
 +self._rlocks = [p.rlock for p in self.pipes]
 +self._rlocks_by_readers = dict([(p.reader, p.rlock) for p in 
self.pipes])
  self.num_channels = num_channels
  
  self.recv = self.recv_select if IS_LINUX else self.recv_polling

http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/cql3handling.py
--
diff --cc pylib/cqlshlib/cql3handling.py
index 897ee16,012e383..8224ad9
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@@ -34,7 -34,8 +34,8 @@@ class UnexpectedTableStructure(UserWarn
  def __str__(self):
  return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
  
+ 
 -SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 +SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth', 
'system_distributed')
  NONALTERBALE_KEYSPACES = ('system')
  
  
@@@ -785,10 -691,17 +792,11 @@@ def select_relation_lhs_completer(ctxt
  filterable.add(layout.clustering_key[num].name)
  else:
  break
 -for cd in layout.columns.values():
 -if cd.index:
 -filterable.add(cd.name)
 +for idx in layout.indexes.itervalues():
 +filterable.add(idx.index_options["target"])
  return map(maybe_escape_name, filterable)
  
+ 
 -@completer_for('selectClause', 'star')
 -def select_count_star_completer(ctxt, cass):
 -return ['*']
 -
 -
  explain_completion('selector', 'colname')
  
  syntax_rules += r'''
@@@ -1178,12 -1076,11 +1193,13 @@@ explain_completion('createUserTypeState
  
  @completer_for('createIndexStatement', 'col')
  def create_index_col_completer(ctxt, cass):
 +""" Return the columns for which an index doesn't exist yet. """
  layout = get_table_meta(ctxt, cass)
 -colnames = [cd.name for cd in layout.columns.values() if not cd.index]
 +idx_targets = [idx.index_options["target"] for idx in 
layout.indexes.itervalues()]
 +colnames = [cd.name for cd in layout.columns.values() if cd.name not in 
idx_targets]
  return map(maybe_escape_name, colnames)
  
+ 
  syntax_rules += r'''
   ::= "DROP" "KEYSPACE" ("IF" "EXISTS")? 
ksname=
;
@@@ -1403,20 -1246,6 +1421,21 @@@ def username_name_completer(ctxt, cass)
  return [maybe_quote(row.values()[0].replace("'", "''")) for row in 
session.execute("LIST USERS")]
  
  
 +@completer_for('rolename', 'role')
 +def rolename_completer(ctxt, cass):
 +def maybe_quote(name):
 +if CqlRuleSet.is_valid_cql3_name(name):
 +return name
 +return "'%s'" % name
 +
 +# disable completion for CREATE ROLE.
 +if ctxt.matched[0][1].upper() == 'CREATE':
 +return [Hint('')]
 +
 +session = cass.session
 +return [maybe_quote(row[0].replace("'", "''")) for row in 
session.execute("LIST ROLES")]
 +
++
  syntax_rules += r'''
   ::= "CREATE" "TRIGGER" ( "IF" "NOT" "EXISTS" )? 

 "ON" cf= "USING" 
class=


[20/23] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2018-01-15 Thread jasobrown
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/685dde10
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/685dde10
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/685dde10

Branch: refs/heads/cassandra-3.0
Commit: 685dde10e3a6b4a27936893840f536fa25ae9da5
Parents: 51bf518 503aec7
Author: Jason Brown 
Authored: Mon Jan 15 06:01:38 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:03:22 2018 -0800

--
 CHANGES.txt|  3 ++-
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/685dde10/CHANGES.txt
--
diff --cc CHANGES.txt
index 0453ddd,055a35d..8696653
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -25,67 -2,11 +25,68 @@@ Merged from 2.2
   * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
-- * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.2.11
 +
 +3.0.15
 + * Improve TRUNCATE performance (CASSANDRA-13909)
 + * Implement short read protection on partition boundaries (CASSANDRA-13595)
 + * Fix ISE thrown by UPI.Serializer.hasNext() for some SELECT queries 
(CASSANDRA-13911)
 + * Filter header only commit logs before recovery (CASSANDRA-13918)
 + * AssertionError prepending to a list (CASSANDRA-13149)
 + * Fix support for SuperColumn tables (CASSANDRA-12373)
 + * Handle limit correctly on tables with strict liveness (CASSANDRA-13883)
 + * Fix missing original update in TriggerExecutor (CASSANDRA-13894)
 + * Remove non-rpc-ready nodes from counter leader candidates (CASSANDRA-13043)
 + * Improve short read protection performance (CASSANDRA-13794)
 + * Fix sstable reader to support range-tombstone-marker for multi-slices 
(CASSANDRA-13787)
 + * Fix short read protection for tables with no clustering columns 
(CASSANDRA-13880)
 + * Make isBuilt volatile in PartitionUpdate (CASSANDRA-13619)
 + * Prevent integer overflow of timestamps in CellTest and RowsTest 
(CASSANDRA-13866)
 + * Fix counter application order in short read protection (CASSANDRA-12872)
 + * Don't block RepairJob execution on validation futures (CASSANDRA-13797)
 + * Wait for all management tasks to complete before shutting down CLSM 
(CASSANDRA-13123)
 + * INSERT statement fails when Tuple type is used as clustering column with 
default DESC order (CASSANDRA-13717)
 + * Fix pending view mutations handling and cleanup batchlog when there are 
local and remote paired mutations (CASSANDRA-13069)
 + * Improve config validation and documentation on overflow and NPE 
(CASSANDRA-13622)
 + * Range deletes in a CAS batch are ignored (CASSANDRA-13655)
 + * Avoid assertion error when IndexSummary > 2G (CASSANDRA-12014)
 + * Change repair midpoint logging for tiny ranges (CASSANDRA-13603)
 + * Better handle corrupt final commitlog segment (CASSANDRA-11995)
 + * StreamingHistogram is not thread safe (CASSANDRA-13756)
 + * Fix MV timestamp issues (CASSANDRA-11500)
 + * Better tolerate improperly formatted bcrypt hashes (CASSANDRA-13626) 
 + * Fix race condition in read command serialization (CASSANDRA-13363)
 + * Enable segement creation before recovering commitlogs (CASSANDRA-13587)
 + * Fix AssertionError in short read protection (CASSANDRA-13747)
 + * Don't skip corrupted sstables on startup (CASSANDRA-13620)
 + * Fix the merging of cells with different user type versions 
(CASSANDRA-13776)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13640)
 + * Potential AssertionError during ReadRepair of range tombstone and 
partition deletions (CASSANDRA-13719)
 + * Don't let stress write warmup data if n=0 (CASSANDRA-13773)
 + * Gossip thread slows down when using batch commit log (CASSANDRA-12966)
 + * Randomize batchlog endpoint selection with only 1 or 2 racks 
(CASSANDRA-12884)
 + * Fix digest calculation for counter cells (CASSANDRA-13750)
 + * Fix ColumnDefinition.cellValueType() for non-frozen collection and change 
SSTabledump to use type.toJSONString() (CASSANDRA-13573)
 + * Skip materialized view addition if the base table doesn't exist 
(CASSANDRA-13737)
 + * Drop table should 

[03/23] cassandra git commit: More PEP8 compliance for cqlsh

2018-01-15 Thread jasobrown
More PEP8 compliance for cqlsh

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14021


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

Branch: refs/heads/trunk
Commit: f8d73a3acb00d807d09aa33e1612c89389b18480
Parents: d4fd82b
Author: Michael Kjellman 
Authored: Tue Nov 14 20:51:37 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:56:44 2018 -0800

--
 CHANGES.txt|  2 +-
 bin/cqlsh  |  4 
 pylib/cqlshlib/copyutil.py |  6 +++---
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 46 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index b4e6f75..6e1ca85 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.1.20
- * 
+ * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 
 2.1.19
  * Add storage port options to sstableloader (CASSANDRA-13844)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 6317ec9..30840db 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -83,6 +83,7 @@ def find_zip(libprefix):
 if zips:
 return max(zips)   # probably the highest version, if multiple
 
+
 cql_zip = find_zip(CQL_LIB_PREFIX)
 if cql_zip:
 ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
@@ -522,6 +523,8 @@ def show_warning_without_quoting_line(message, category, 
filename, lineno, file=
 file.write(warnings.formatwarning(message, category, filename, lineno, 
line=''))
 except IOError:
 pass
+
+
 warnings.showwarning = show_warning_without_quoting_line
 warnings.filterwarnings('always', 
category=cql3handling.UnexpectedTableStructure)
 
@@ -2213,6 +2216,7 @@ def main(options, hostname, port):
 if batch_mode and shell.statement_error:
 sys.exit(2)
 
+
 # always call this regardless of module name: when a sub-process is spawned
 # on Windows then the module name is not __main__, see CASSANDRA-9304
 insert_driver_hooks()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 3a45353..85e2678 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -191,7 +191,7 @@ class OneWayChannels(object):
 for ch in self.channels:
 try:
 ch.close()
-except:
+except Exception:
 pass
 
 
@@ -1967,8 +1967,8 @@ class ImportConversion(object):
 pk_values = []
 for i in partition_key_indexes:
 val = serialize(i, row[i])
-l = len(val)
-pk_values.append(struct.pack(">H%dsB" % l, l, val, 0))
+length = len(val)
+pk_values.append(struct.pack(">H%dsB" % length, length, val, 
0))
 return b"".join(pk_values)
 
 if len(partition_key_indexes) == 1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 029e0c7..012e383 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -34,6 +34,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
+
 SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 NONALTERBALE_KEYSPACES = ('system')
 
@@ -109,6 +110,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
 cqlword = cqlword[1:-1].replace("''", "'")
 return cqlword
 
+
 CqlRuleSet = Cql3ParsingRuleSet()
 
 # convenience for remainder of module
@@ -306,6 +308,7 @@ def prop_equals_completer(ctxt, cass):
 return ()
 return ['=']
 
+
 completer_for('property', 'propeq')(prop_equals_completer)
 
 
@@ -529,6 +532,7 @@ def ks_name_completer(ctxt, cass):
 def cf_ks_name_completer(ctxt, cass):
 return [maybe_escape_name(ks) + '.' for ks in 

[14/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
Merge branch 'cassandra-2.1' into cassandra-2.2


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

Branch: refs/heads/cassandra-3.0
Commit: 503aec74a56a5aada7398bf38b67ceb8743b027e
Parents: b800f3c f8d73a3
Author: Jason Brown 
Authored: Mon Jan 15 05:58:04 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:01:14 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/CHANGES.txt
--
diff --cc CHANGES.txt
index 266ed14,6e1ca85..055a35d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,9 +1,27 @@@
 -2.1.20
 +2.2.12
 + * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
 + * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
 + * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
++Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.1.19
 +2.2.11
 + * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)
 + * Fix load over calculated issue in IndexSummaryRedistribution 
(CASSANDRA-13738)
 + * Fix compaction and flush exception not captured (CASSANDRA-13833)
 + * Make BatchlogManagerMBean.forceBatchlogReplay() blocking (CASSANDRA-13809)
 + * Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
 + * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 + * Fix queries with LIMIT and filtering on clustering columns 
(CASSANDRA-11223)
 + * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
 + * Remove unused max_value_size_in_mb config setting from yaml 
(CASSANDRA-13625
 +Merged from 2.1:
   * Add storage port options to sstableloader (CASSANDRA-13844)
 - * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775) 
 + * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775)
   * Clone HeartBeatState when building gossip messages. Make its 
generation/version volatile (CASSANDRA-13700)
  
  


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



[01/23] cassandra git commit: More PEP8 compliance for cqlsh

2018-01-15 Thread jasobrown
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 d4fd82be5 -> f8d73a3ac
  refs/heads/cassandra-2.2 b800f3c76 -> 503aec74a
  refs/heads/cassandra-3.0 51bf51813 -> 685dde10e
  refs/heads/cassandra-3.11 36375f8b5 -> 02bbdd634
  refs/heads/trunk 1e58a53ca -> 6d324f9d7


More PEP8 compliance for cqlsh

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14021


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

Branch: refs/heads/cassandra-2.1
Commit: f8d73a3acb00d807d09aa33e1612c89389b18480
Parents: d4fd82b
Author: Michael Kjellman 
Authored: Tue Nov 14 20:51:37 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:56:44 2018 -0800

--
 CHANGES.txt|  2 +-
 bin/cqlsh  |  4 
 pylib/cqlshlib/copyutil.py |  6 +++---
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 46 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index b4e6f75..6e1ca85 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.1.20
- * 
+ * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 
 2.1.19
  * Add storage port options to sstableloader (CASSANDRA-13844)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 6317ec9..30840db 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -83,6 +83,7 @@ def find_zip(libprefix):
 if zips:
 return max(zips)   # probably the highest version, if multiple
 
+
 cql_zip = find_zip(CQL_LIB_PREFIX)
 if cql_zip:
 ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
@@ -522,6 +523,8 @@ def show_warning_without_quoting_line(message, category, 
filename, lineno, file=
 file.write(warnings.formatwarning(message, category, filename, lineno, 
line=''))
 except IOError:
 pass
+
+
 warnings.showwarning = show_warning_without_quoting_line
 warnings.filterwarnings('always', 
category=cql3handling.UnexpectedTableStructure)
 
@@ -2213,6 +2216,7 @@ def main(options, hostname, port):
 if batch_mode and shell.statement_error:
 sys.exit(2)
 
+
 # always call this regardless of module name: when a sub-process is spawned
 # on Windows then the module name is not __main__, see CASSANDRA-9304
 insert_driver_hooks()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 3a45353..85e2678 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -191,7 +191,7 @@ class OneWayChannels(object):
 for ch in self.channels:
 try:
 ch.close()
-except:
+except Exception:
 pass
 
 
@@ -1967,8 +1967,8 @@ class ImportConversion(object):
 pk_values = []
 for i in partition_key_indexes:
 val = serialize(i, row[i])
-l = len(val)
-pk_values.append(struct.pack(">H%dsB" % l, l, val, 0))
+length = len(val)
+pk_values.append(struct.pack(">H%dsB" % length, length, val, 
0))
 return b"".join(pk_values)
 
 if len(partition_key_indexes) == 1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 029e0c7..012e383 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -34,6 +34,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
+
 SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 NONALTERBALE_KEYSPACES = ('system')
 
@@ -109,6 +110,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
 cqlword = cqlword[1:-1].replace("''", "'")
 return cqlword
 
+
 CqlRuleSet = Cql3ParsingRuleSet()
 
 # convenience for remainder of module
@@ -306,6 +308,7 @@ def 

[02/23] cassandra git commit: More PEP8 compliance for cqlsh

2018-01-15 Thread jasobrown
More PEP8 compliance for cqlsh

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14021


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

Branch: refs/heads/cassandra-2.2
Commit: f8d73a3acb00d807d09aa33e1612c89389b18480
Parents: d4fd82b
Author: Michael Kjellman 
Authored: Tue Nov 14 20:51:37 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:56:44 2018 -0800

--
 CHANGES.txt|  2 +-
 bin/cqlsh  |  4 
 pylib/cqlshlib/copyutil.py |  6 +++---
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 46 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index b4e6f75..6e1ca85 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.1.20
- * 
+ * More PEP8 compliance for cqlsh (CASSANDRA-14021)
 
 2.1.19
  * Add storage port options to sstableloader (CASSANDRA-13844)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 6317ec9..30840db 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -83,6 +83,7 @@ def find_zip(libprefix):
 if zips:
 return max(zips)   # probably the highest version, if multiple
 
+
 cql_zip = find_zip(CQL_LIB_PREFIX)
 if cql_zip:
 ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
@@ -522,6 +523,8 @@ def show_warning_without_quoting_line(message, category, 
filename, lineno, file=
 file.write(warnings.formatwarning(message, category, filename, lineno, 
line=''))
 except IOError:
 pass
+
+
 warnings.showwarning = show_warning_without_quoting_line
 warnings.filterwarnings('always', 
category=cql3handling.UnexpectedTableStructure)
 
@@ -2213,6 +2216,7 @@ def main(options, hostname, port):
 if batch_mode and shell.statement_error:
 sys.exit(2)
 
+
 # always call this regardless of module name: when a sub-process is spawned
 # on Windows then the module name is not __main__, see CASSANDRA-9304
 insert_driver_hooks()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/copyutil.py
--
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 3a45353..85e2678 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -191,7 +191,7 @@ class OneWayChannels(object):
 for ch in self.channels:
 try:
 ch.close()
-except:
+except Exception:
 pass
 
 
@@ -1967,8 +1967,8 @@ class ImportConversion(object):
 pk_values = []
 for i in partition_key_indexes:
 val = serialize(i, row[i])
-l = len(val)
-pk_values.append(struct.pack(">H%dsB" % l, l, val, 0))
+length = len(val)
+pk_values.append(struct.pack(">H%dsB" % length, length, val, 
0))
 return b"".join(pk_values)
 
 if len(partition_key_indexes) == 1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f8d73a3a/pylib/cqlshlib/cql3handling.py
--
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 029e0c7..012e383 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -34,6 +34,7 @@ class UnexpectedTableStructure(UserWarning):
 def __str__(self):
 return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
 
+
 SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 NONALTERBALE_KEYSPACES = ('system')
 
@@ -109,6 +110,7 @@ class Cql3ParsingRuleSet(CqlParsingRuleSet):
 cqlword = cqlword[1:-1].replace("''", "'")
 return cqlword
 
+
 CqlRuleSet = Cql3ParsingRuleSet()
 
 # convenience for remainder of module
@@ -306,6 +308,7 @@ def prop_equals_completer(ctxt, cass):
 return ()
 return ['=']
 
+
 completer_for('property', 'propeq')(prop_equals_completer)
 
 
@@ -529,6 +532,7 @@ def ks_name_completer(ctxt, cass):
 def cf_ks_name_completer(ctxt, cass):
 return [maybe_escape_name(ks) + '.' for ks in 

[08/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
Merge branch 'cassandra-2.1' into cassandra-2.2


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

Branch: refs/heads/trunk
Commit: 503aec74a56a5aada7398bf38b67ceb8743b027e
Parents: b800f3c f8d73a3
Author: Jason Brown 
Authored: Mon Jan 15 05:58:04 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:01:14 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/CHANGES.txt
--
diff --cc CHANGES.txt
index 266ed14,6e1ca85..055a35d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,9 +1,27 @@@
 -2.1.20
 +2.2.12
 + * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
 + * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
 + * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
++Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.1.19
 +2.2.11
 + * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)
 + * Fix load over calculated issue in IndexSummaryRedistribution 
(CASSANDRA-13738)
 + * Fix compaction and flush exception not captured (CASSANDRA-13833)
 + * Make BatchlogManagerMBean.forceBatchlogReplay() blocking (CASSANDRA-13809)
 + * Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
 + * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 + * Fix queries with LIMIT and filtering on clustering columns 
(CASSANDRA-11223)
 + * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
 + * Remove unused max_value_size_in_mb config setting from yaml 
(CASSANDRA-13625
 +Merged from 2.1:
   * Add storage port options to sstableloader (CASSANDRA-13844)
 - * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775) 
 + * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775)
   * Clone HeartBeatState when building gossip messages. Make its 
generation/version volatile (CASSANDRA-13700)
  
  


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



[17/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
Merge branch 'cassandra-2.1' into cassandra-2.2


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

Branch: refs/heads/cassandra-3.11
Commit: 503aec74a56a5aada7398bf38b67ceb8743b027e
Parents: b800f3c f8d73a3
Author: Jason Brown 
Authored: Mon Jan 15 05:58:04 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:01:14 2018 -0800

--
 CHANGES.txt|  2 ++
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/CHANGES.txt
--
diff --cc CHANGES.txt
index 266ed14,6e1ca85..055a35d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,25 -1,9 +1,27 @@@
 -2.1.20
 +2.2.12
 + * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
 + * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
 + * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
 + * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
++Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.1.19
 +2.2.11
 + * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)
 + * Fix load over calculated issue in IndexSummaryRedistribution 
(CASSANDRA-13738)
 + * Fix compaction and flush exception not captured (CASSANDRA-13833)
 + * Make BatchlogManagerMBean.forceBatchlogReplay() blocking (CASSANDRA-13809)
 + * Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
 + * Prevent integer overflow on exabyte filesystems (CASSANDRA-13067) 
 + * Fix queries with LIMIT and filtering on clustering columns 
(CASSANDRA-11223)
 + * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
 + * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
 + * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
 + * Remove unused max_value_size_in_mb config setting from yaml 
(CASSANDRA-13625
 +Merged from 2.1:
   * Add storage port options to sstableloader (CASSANDRA-13844)
 - * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775) 
 + * Remove stress-test target in CircleCI as it's not existing 
(CASSANDRA-13775)
   * Clone HeartBeatState when building gossip messages. Make its 
generation/version volatile (CASSANDRA-13700)
  
  


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



[10/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/bin/cqlsh.py
--
diff --cc bin/cqlsh.py
index 1f63826,000..e242d42
mode 100644,00..100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@@ -1,2588 -1,0 +1,2592 @@@
 +#!/bin/sh
 +# -*- mode: Python -*-
 +
 +# Licensed to the Apache Software Foundation (ASF) under one
 +# or more contributor license agreements.  See the NOTICE file
 +# distributed with this work for additional information
 +# regarding copyright ownership.  The ASF licenses this file
 +# to you under the Apache License, Version 2.0 (the
 +# "License"); you may not use this file except in compliance
 +# with the License.  You may obtain a copy of the License at
 +#
 +# http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +""":"
 +# bash code here; finds a suitable python interpreter and execs this file.
 +# prefer unqualified "python" if suitable:
 +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 
0x0300))' 2>/dev/null \
 +&& exec python "$0" "$@"
 +for pyver in 2.7; do
 +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
 +done
 +echo "No appropriate python interpreter found." >&2
 +exit 1
 +":"""
 +
 +from __future__ import with_statement
 +
 +import cmd
 +import codecs
 +import ConfigParser
 +import csv
 +import getpass
 +import optparse
 +import os
 +import platform
 +import sys
 +import traceback
 +import warnings
 +import webbrowser
 +from StringIO import StringIO
 +from contextlib import contextmanager
 +from glob import glob
 +from uuid import UUID
 +
 +if sys.version_info[0] != 2 or sys.version_info[1] != 7:
 +sys.exit("\nCQL Shell supports only Python 2.7\n")
 +
 +UTF8 = 'utf-8'
 +CP65001 = 'cp65001'  # Win utf-8 variant
 +
 +description = "CQL Shell for Apache Cassandra"
 +version = "5.0.1"
 +
 +readline = None
 +try:
 +# check if tty first, cause readline doesn't check, and only cares
 +# about $TERM. we don't want the funky escape code stuff to be
 +# output if not a tty.
 +if sys.stdin.isatty():
 +import readline
 +except ImportError:
 +pass
 +
 +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-'
 +
 +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 
'..')
 +CASSANDRA_CQL_HTML_FALLBACK = 
'https://cassandra.apache.org/doc/cql3/CQL-2.2.html'
 +
 +if os.path.exists(CASSANDRA_PATH + '/doc/cql3/CQL.html'):
 +# default location of local CQL.html
 +CASSANDRA_CQL_HTML = 'file://' + CASSANDRA_PATH + '/doc/cql3/CQL.html'
 +elif os.path.exists('/usr/share/doc/cassandra/CQL.html'):
 +# fallback to package file
 +CASSANDRA_CQL_HTML = 'file:///usr/share/doc/cassandra/CQL.html'
 +else:
 +# fallback to online version
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +
 +# On Linux, the Python webbrowser module uses the 'xdg-open' executable
 +# to open a file/URL. But that only works, if the current session has been
 +# opened from _within_ a desktop environment. I.e. 'xdg-open' will fail,
 +# if the session's been opened via ssh to a remote box.
 +#
 +# Use 'python' to get some information about the detected browsers.
 +# >>> import webbrowser
 +# >>> webbrowser._tryorder
 +# >>> webbrowser._browser
 +#
 +if len(webbrowser._tryorder) == 0:
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +elif webbrowser._tryorder[0] == 'xdg-open' and 
os.environ.get('XDG_DATA_DIRS', '') == '':
 +# only on Linux (some OS with xdg-open)
 +webbrowser._tryorder.remove('xdg-open')
 +webbrowser._tryorder.append('xdg-open')
 +
 +# use bundled libs for python-cql and thrift, if available. if there
 +# is a ../lib dir, use bundled libs there preferentially.
 +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')]
 +myplatform = platform.system()
 +is_win = myplatform == 'Windows'
 +
 +# Workaround for supporting CP65001 encoding on python < 3.3 
(https://bugs.python.org/issue13216)
 +if is_win and sys.version_info < (3, 3):
 +codecs.register(lambda name: codecs.lookup(UTF8) if name == CP65001 else 
None)
 +
 +if myplatform == 'Linux':
 +ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
 +
 +if os.environ.get('CQLSH_NO_BUNDLED', ''):
 +ZIPLIB_DIRS = ()
 +
 +
 +def find_zip(libprefix):
 +for ziplibdir in ZIPLIB_DIRS:
 +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip'))
 +if zips:
 +return max(zips)   # probably the highest version, if multiple
 +
++
 +cql_zip = find_zip(CQL_LIB_PREFIX)
 +if cql_zip:
 +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
 +sys.path.insert(0, os.path.join(cql_zip, 

[18/23] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

2018-01-15 Thread jasobrown
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/685dde10
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/685dde10
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/685dde10

Branch: refs/heads/trunk
Commit: 685dde10e3a6b4a27936893840f536fa25ae9da5
Parents: 51bf518 503aec7
Author: Jason Brown 
Authored: Mon Jan 15 06:01:38 2018 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 06:03:22 2018 -0800

--
 CHANGES.txt|  3 ++-
 bin/cqlsh.py   |  8 ++--
 pylib/cqlshlib/copyutil.py |  8 
 pylib/cqlshlib/cql3handling.py | 20 
 pylib/cqlshlib/displaying.py   |  1 +
 pylib/cqlshlib/formatting.py   | 13 +
 pylib/cqlshlib/pylexotron.py   |  1 +
 pylib/cqlshlib/wcwidth.py  |  3 +++
 8 files changed, 50 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/685dde10/CHANGES.txt
--
diff --cc CHANGES.txt
index 0453ddd,055a35d..8696653
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -25,67 -2,11 +25,68 @@@ Merged from 2.2
   * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
   * Fix race that prevents submitting compaction for a table when executor is 
full (CASSANDRA-13801)
   * Rely on the JVM to handle OutOfMemoryErrors (CASSANDRA-13006)
-- * Grab refs during scrub/index redistribution/cleanup (CASSANDRA-13873)
+ Merged from 2.1:
+  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  
 -2.2.11
 +
 +3.0.15
 + * Improve TRUNCATE performance (CASSANDRA-13909)
 + * Implement short read protection on partition boundaries (CASSANDRA-13595)
 + * Fix ISE thrown by UPI.Serializer.hasNext() for some SELECT queries 
(CASSANDRA-13911)
 + * Filter header only commit logs before recovery (CASSANDRA-13918)
 + * AssertionError prepending to a list (CASSANDRA-13149)
 + * Fix support for SuperColumn tables (CASSANDRA-12373)
 + * Handle limit correctly on tables with strict liveness (CASSANDRA-13883)
 + * Fix missing original update in TriggerExecutor (CASSANDRA-13894)
 + * Remove non-rpc-ready nodes from counter leader candidates (CASSANDRA-13043)
 + * Improve short read protection performance (CASSANDRA-13794)
 + * Fix sstable reader to support range-tombstone-marker for multi-slices 
(CASSANDRA-13787)
 + * Fix short read protection for tables with no clustering columns 
(CASSANDRA-13880)
 + * Make isBuilt volatile in PartitionUpdate (CASSANDRA-13619)
 + * Prevent integer overflow of timestamps in CellTest and RowsTest 
(CASSANDRA-13866)
 + * Fix counter application order in short read protection (CASSANDRA-12872)
 + * Don't block RepairJob execution on validation futures (CASSANDRA-13797)
 + * Wait for all management tasks to complete before shutting down CLSM 
(CASSANDRA-13123)
 + * INSERT statement fails when Tuple type is used as clustering column with 
default DESC order (CASSANDRA-13717)
 + * Fix pending view mutations handling and cleanup batchlog when there are 
local and remote paired mutations (CASSANDRA-13069)
 + * Improve config validation and documentation on overflow and NPE 
(CASSANDRA-13622)
 + * Range deletes in a CAS batch are ignored (CASSANDRA-13655)
 + * Avoid assertion error when IndexSummary > 2G (CASSANDRA-12014)
 + * Change repair midpoint logging for tiny ranges (CASSANDRA-13603)
 + * Better handle corrupt final commitlog segment (CASSANDRA-11995)
 + * StreamingHistogram is not thread safe (CASSANDRA-13756)
 + * Fix MV timestamp issues (CASSANDRA-11500)
 + * Better tolerate improperly formatted bcrypt hashes (CASSANDRA-13626) 
 + * Fix race condition in read command serialization (CASSANDRA-13363)
 + * Enable segement creation before recovering commitlogs (CASSANDRA-13587)
 + * Fix AssertionError in short read protection (CASSANDRA-13747)
 + * Don't skip corrupted sstables on startup (CASSANDRA-13620)
 + * Fix the merging of cells with different user type versions 
(CASSANDRA-13776)
 + * Copy session properties on cqlsh.py do_login (CASSANDRA-13640)
 + * Potential AssertionError during ReadRepair of range tombstone and 
partition deletions (CASSANDRA-13719)
 + * Don't let stress write warmup data if n=0 (CASSANDRA-13773)
 + * Gossip thread slows down when using batch commit log (CASSANDRA-12966)
 + * Randomize batchlog endpoint selection with only 1 or 2 racks 
(CASSANDRA-12884)
 + * Fix digest calculation for counter cells (CASSANDRA-13750)
 + * Fix ColumnDefinition.cellValueType() for non-frozen collection and change 
SSTabledump to use type.toJSONString() (CASSANDRA-13573)
 + * Skip materialized view addition if the base table doesn't exist 
(CASSANDRA-13737)
 + * Drop table should remove 

[07/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/bin/cqlsh.py
--
diff --cc bin/cqlsh.py
index 1f63826,000..e242d42
mode 100644,00..100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@@ -1,2588 -1,0 +1,2592 @@@
 +#!/bin/sh
 +# -*- mode: Python -*-
 +
 +# Licensed to the Apache Software Foundation (ASF) under one
 +# or more contributor license agreements.  See the NOTICE file
 +# distributed with this work for additional information
 +# regarding copyright ownership.  The ASF licenses this file
 +# to you under the Apache License, Version 2.0 (the
 +# "License"); you may not use this file except in compliance
 +# with the License.  You may obtain a copy of the License at
 +#
 +# http://www.apache.org/licenses/LICENSE-2.0
 +#
 +# Unless required by applicable law or agreed to in writing, software
 +# distributed under the License is distributed on an "AS IS" BASIS,
 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +# See the License for the specific language governing permissions and
 +# limitations under the License.
 +
 +""":"
 +# bash code here; finds a suitable python interpreter and execs this file.
 +# prefer unqualified "python" if suitable:
 +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 
0x0300))' 2>/dev/null \
 +&& exec python "$0" "$@"
 +for pyver in 2.7; do
 +which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
 +done
 +echo "No appropriate python interpreter found." >&2
 +exit 1
 +":"""
 +
 +from __future__ import with_statement
 +
 +import cmd
 +import codecs
 +import ConfigParser
 +import csv
 +import getpass
 +import optparse
 +import os
 +import platform
 +import sys
 +import traceback
 +import warnings
 +import webbrowser
 +from StringIO import StringIO
 +from contextlib import contextmanager
 +from glob import glob
 +from uuid import UUID
 +
 +if sys.version_info[0] != 2 or sys.version_info[1] != 7:
 +sys.exit("\nCQL Shell supports only Python 2.7\n")
 +
 +UTF8 = 'utf-8'
 +CP65001 = 'cp65001'  # Win utf-8 variant
 +
 +description = "CQL Shell for Apache Cassandra"
 +version = "5.0.1"
 +
 +readline = None
 +try:
 +# check if tty first, cause readline doesn't check, and only cares
 +# about $TERM. we don't want the funky escape code stuff to be
 +# output if not a tty.
 +if sys.stdin.isatty():
 +import readline
 +except ImportError:
 +pass
 +
 +CQL_LIB_PREFIX = 'cassandra-driver-internal-only-'
 +
 +CASSANDRA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 
'..')
 +CASSANDRA_CQL_HTML_FALLBACK = 
'https://cassandra.apache.org/doc/cql3/CQL-2.2.html'
 +
 +if os.path.exists(CASSANDRA_PATH + '/doc/cql3/CQL.html'):
 +# default location of local CQL.html
 +CASSANDRA_CQL_HTML = 'file://' + CASSANDRA_PATH + '/doc/cql3/CQL.html'
 +elif os.path.exists('/usr/share/doc/cassandra/CQL.html'):
 +# fallback to package file
 +CASSANDRA_CQL_HTML = 'file:///usr/share/doc/cassandra/CQL.html'
 +else:
 +# fallback to online version
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +
 +# On Linux, the Python webbrowser module uses the 'xdg-open' executable
 +# to open a file/URL. But that only works, if the current session has been
 +# opened from _within_ a desktop environment. I.e. 'xdg-open' will fail,
 +# if the session's been opened via ssh to a remote box.
 +#
 +# Use 'python' to get some information about the detected browsers.
 +# >>> import webbrowser
 +# >>> webbrowser._tryorder
 +# >>> webbrowser._browser
 +#
 +if len(webbrowser._tryorder) == 0:
 +CASSANDRA_CQL_HTML = CASSANDRA_CQL_HTML_FALLBACK
 +elif webbrowser._tryorder[0] == 'xdg-open' and 
os.environ.get('XDG_DATA_DIRS', '') == '':
 +# only on Linux (some OS with xdg-open)
 +webbrowser._tryorder.remove('xdg-open')
 +webbrowser._tryorder.append('xdg-open')
 +
 +# use bundled libs for python-cql and thrift, if available. if there
 +# is a ../lib dir, use bundled libs there preferentially.
 +ZIPLIB_DIRS = [os.path.join(CASSANDRA_PATH, 'lib')]
 +myplatform = platform.system()
 +is_win = myplatform == 'Windows'
 +
 +# Workaround for supporting CP65001 encoding on python < 3.3 
(https://bugs.python.org/issue13216)
 +if is_win and sys.version_info < (3, 3):
 +codecs.register(lambda name: codecs.lookup(UTF8) if name == CP65001 else 
None)
 +
 +if myplatform == 'Linux':
 +ZIPLIB_DIRS.append('/usr/share/cassandra/lib')
 +
 +if os.environ.get('CQLSH_NO_BUNDLED', ''):
 +ZIPLIB_DIRS = ()
 +
 +
 +def find_zip(libprefix):
 +for ziplibdir in ZIPLIB_DIRS:
 +zips = glob(os.path.join(ziplibdir, libprefix + '*.zip'))
 +if zips:
 +return max(zips)   # probably the highest version, if multiple
 +
++
 +cql_zip = find_zip(CQL_LIB_PREFIX)
 +if cql_zip:
 +ver = os.path.splitext(os.path.basename(cql_zip))[0][len(CQL_LIB_PREFIX):]
 +sys.path.insert(0, os.path.join(cql_zip, 

[06/23] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

2018-01-15 Thread jasobrown
http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/copyutil.py
--
diff --cc pylib/cqlshlib/copyutil.py
index b72b517,85e2678..c9c5829
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@@ -150,37 -129,28 +150,37 @@@ class SendingChannel(object)
  def num_pending(self):
  return self.pending_messages.qsize() if self.pending_messages else 0
  
 -def recv(self):
 -with self.rlock:
 -return self.reader.recv()
 +def close(self):
 +self.pipe.close()
 +
 +
 +class SendingChannels(object):
 +"""
 +A group of one way channels for sending messages.
 +"""
 +def __init__(self, num_channels):
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [SendingChannel(p) for p in self.pipes]
 +self.num_channels = num_channels
  
  def close(self):
 -self.reader.close()
 -self.writer.close()
 +for ch in self.channels:
 +try:
 +ch.close()
- except:
++except Exception:
 +pass
  
  
 -class OneWayChannels(object):
 +class ReceivingChannels(object):
  """
 -A group of one way channels.
 +A group of one way channels for receiving messages.
  """
  def __init__(self, num_channels):
 -self.channels = [OneWayChannel() for _ in xrange(num_channels)]
 -self._readers = [ch.reader for ch in self.channels]
 -self._rlocks = [ch.rlock for ch in self.channels]
 -self._rlocks_by_readers = dict([(ch.reader, ch.rlock) for ch in 
self.channels])
 +self.pipes = [OneWayPipe() for _ in xrange(num_channels)]
 +self.channels = [ReceivingChannel(p) for p in self.pipes]
 +self._readers = [p.reader for p in self.pipes]
 +self._rlocks = [p.rlock for p in self.pipes]
 +self._rlocks_by_readers = dict([(p.reader, p.rlock) for p in 
self.pipes])
  self.num_channels = num_channels
  
  self.recv = self.recv_select if IS_LINUX else self.recv_polling

http://git-wip-us.apache.org/repos/asf/cassandra/blob/503aec74/pylib/cqlshlib/cql3handling.py
--
diff --cc pylib/cqlshlib/cql3handling.py
index 897ee16,012e383..8224ad9
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@@ -34,7 -34,8 +34,8 @@@ class UnexpectedTableStructure(UserWarn
  def __str__(self):
  return 'Unexpected table structure; may not translate correctly to 
CQL. ' + self.msg
  
+ 
 -SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth')
 +SYSTEM_KEYSPACES = ('system', 'system_traces', 'system_auth', 
'system_distributed')
  NONALTERBALE_KEYSPACES = ('system')
  
  
@@@ -785,10 -691,17 +792,11 @@@ def select_relation_lhs_completer(ctxt
  filterable.add(layout.clustering_key[num].name)
  else:
  break
 -for cd in layout.columns.values():
 -if cd.index:
 -filterable.add(cd.name)
 +for idx in layout.indexes.itervalues():
 +filterable.add(idx.index_options["target"])
  return map(maybe_escape_name, filterable)
  
+ 
 -@completer_for('selectClause', 'star')
 -def select_count_star_completer(ctxt, cass):
 -return ['*']
 -
 -
  explain_completion('selector', 'colname')
  
  syntax_rules += r'''
@@@ -1178,12 -1076,11 +1193,13 @@@ explain_completion('createUserTypeState
  
  @completer_for('createIndexStatement', 'col')
  def create_index_col_completer(ctxt, cass):
 +""" Return the columns for which an index doesn't exist yet. """
  layout = get_table_meta(ctxt, cass)
 -colnames = [cd.name for cd in layout.columns.values() if not cd.index]
 +idx_targets = [idx.index_options["target"] for idx in 
layout.indexes.itervalues()]
 +colnames = [cd.name for cd in layout.columns.values() if cd.name not in 
idx_targets]
  return map(maybe_escape_name, colnames)
  
+ 
  syntax_rules += r'''
   ::= "DROP" "KEYSPACE" ("IF" "EXISTS")? 
ksname=
;
@@@ -1403,20 -1246,6 +1421,21 @@@ def username_name_completer(ctxt, cass)
  return [maybe_quote(row.values()[0].replace("'", "''")) for row in 
session.execute("LIST USERS")]
  
  
 +@completer_for('rolename', 'role')
 +def rolename_completer(ctxt, cass):
 +def maybe_quote(name):
 +if CqlRuleSet.is_valid_cql3_name(name):
 +return name
 +return "'%s'" % name
 +
 +# disable completion for CREATE ROLE.
 +if ctxt.matched[0][1].upper() == 'CREATE':
 +return [Hint('')]
 +
 +session = cass.session
 +return [maybe_quote(row[0].replace("'", "''")) for row in 
session.execute("LIST ROLES")]
 +
++
  syntax_rules += r'''
   ::= "CREATE" "TRIGGER" ( "IF" "NOT" "EXISTS" )? 

 "ON" cf= "USING" 
class=


[jira] [Resolved] (CASSANDRA-14020) test_pep8_compliance - cqlsh_tests.cqlsh_tests.TestCqlsh: pep8 has been renamed to pycodestyle (GitHub issue #466)

2018-01-15 Thread Jason Brown (JIRA)

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

Jason Brown resolved CASSANDRA-14020.
-
Resolution: Fixed
  Reviewer: Jay Zhuang

committed as sha {{0d468af9e2617a4a9083e1e527e3a1731e613fcc}}

Thanks, [~mkjellman] and [~jay.zhuang]!

> test_pep8_compliance - cqlsh_tests.cqlsh_tests.TestCqlsh: pep8 has been 
> renamed to pycodestyle (GitHub issue #466)
> --
>
> Key: CASSANDRA-14020
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14020
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Assignee: Michael Kjellman
>Priority: Major
>
> test_pep8_compliance - cqlsh_tests.cqlsh_tests.TestCqlsh always fails due to 
> us catching a informative warning from the pip8 tool.. looks like we just 
> need to swap out the usage
> /home/cassandra/env/local/lib/python2.7/site-packages/pep8.py:2124: 
> UserWarning: 
> pep8 has been renamed to pycodestyle (GitHub issue #466)
> Use of the pep8 tool will be removed in a future release.
> Please install and use `pycodestyle` instead.
> $ pip install pycodestyle
> $ pycodestyle ...
>   '\n\n'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



cassandra-dtest git commit: Replace pep8 with pycodestyle

2018-01-15 Thread jasobrown
Repository: cassandra-dtest
Updated Branches:
  refs/heads/master e67ef2b80 -> 0d468af9e


Replace pep8 with pycodestyle

patch by Michael Kjellman; reviewed by Jay Zhuang for CASSANDRA-14020


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

Branch: refs/heads/master
Commit: 0d468af9e2617a4a9083e1e527e3a1731e613fcc
Parents: e67ef2b
Author: Michael Kjellman 
Authored: Tue Nov 14 19:25:11 2017 -0800
Committer: Jason Brown 
Committed: Mon Jan 15 05:18:46 2018 -0800

--
 cqlsh_tests/cqlsh_tests.py | 8 
 requirements.txt   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/0d468af9/cqlsh_tests/cqlsh_tests.py
--
diff --git a/cqlsh_tests/cqlsh_tests.py b/cqlsh_tests/cqlsh_tests.py
index 8146ace..bf2b90c 100644
--- a/cqlsh_tests/cqlsh_tests.py
+++ b/cqlsh_tests/cqlsh_tests.py
@@ -40,11 +40,11 @@ class TestCqlsh(Tester):
 super(TestCqlsh, self).tearDown()
 
 @since('2.1.9')
-def test_pep8_compliance(self):
+def test_pycodestyle_compliance(self):
 """
 @jira_ticket CASSANDRA-10066
-Checks that cqlsh is compliant with pep8 with the following command:
-pep8 --ignore E501,E402,E731 pylib/cqlshlib/*.py bin/cqlsh.py
+Checks that cqlsh is compliant with pycodestyle (formally known as 
pep8) with the following command:
+pycodestyle --ignore E501,E402,E731 pylib/cqlshlib/*.py bin/cqlsh.py
 """
 cluster = self.cluster
 
@@ -57,7 +57,7 @@ class TestCqlsh(Tester):
 cqlshlib_paths = os.listdir(cqlshlib_path)
 cqlshlib_paths = [os.path.join(cqlshlib_path, x) for x in 
cqlshlib_paths if '.py' in x and '.pyc' not in x]
 
-cmds = ['pep8', '--ignore', 'E501,E402,E731', cqlsh_path] + 
cqlshlib_paths
+cmds = ['pycodestyle', '--ignore', 'E501,E402,E731', cqlsh_path] + 
cqlshlib_paths
 
 debug(cmds)
 

http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/0d468af9/requirements.txt
--
diff --git a/requirements.txt b/requirements.txt
index 964ef3c..bf46e38 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -15,7 +15,7 @@ mock
 nose
 nose-test-select
 parse
-pep8
+pycodestyle
 psutil
 pycassa
 thrift==0.9.3


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



[jira] [Updated] (CASSANDRA-9630) Killing cassandra process results in unclosed connections

2018-01-15 Thread Paulo Motta (JIRA)

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

Paulo Motta updated CASSANDRA-9630:
---
   Resolution: Fixed
Fix Version/s: (was: 3.11.x)
   4.0
   3.11.2
   3.0.16
   Status: Resolved  (was: Ready to Commit)

Thanks for the review! Committed as 
\{{51bf51813c4a7a9f9ad3adfe8ddac171b398816b}} to cassandra-3.0 and merged up to 
trunk.

> Killing cassandra process results in unclosed connections
> -
>
> Key: CASSANDRA-9630
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9630
> Project: Cassandra
>  Issue Type: Bug
>  Components: Distributed Metadata, Streaming and Messaging
>Reporter: Paulo Motta
>Assignee: Paulo Motta
>Priority: Minor
> Fix For: 3.0.16, 3.11.2, 4.0
>
> Attachments: apache-cassandra-3.0.8-SNAPSHOT.jar
>
>
> After upgrading from Cassandra from 2.0.12 to 2.0.15, whenever we killed a 
> cassandra process (with SIGTERM), some other nodes maintained a connection 
> with the killed node in the CLOSE_WAIT state on port 7000 for about 5-20 
> minutes.
> So, when we started the killed node again, other nodes could not establish a 
> handshake because of the connections on the CLOSE_WAIT state, so they 
> remained on the DOWN state to each other until the initial connection expired.
> The problem did not happen if I ran a nodetool disablegossip before killing 
> the node.
> I was able to fix this issue by reverting the CASSANDRA-8336 commits 
> (including CASSANDRA-9238). After reverting this, cassandra now closes 
> connection correctly when killed with -TERM, but leaves connections on 
> CLOSE_WAIT state if I run nodetool disablethrift before killing the nodes.
> I did not try to reproduce the problem in a clean environment.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



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

2018-01-15 Thread paulo
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/36375f8b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/36375f8b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/36375f8b

Branch: refs/heads/cassandra-3.11
Commit: 36375f8b5571891e318ba4abaa61d96477e52e22
Parents: 5133526 51bf518
Author: Paulo Motta 
Authored: Sat Jan 13 01:25:10 2018 -0200
Committer: Paulo Motta 
Committed: Sat Jan 13 01:25:10 2018 -0200

--
 CHANGES.txt  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/36375f8b/CHANGES.txt
--
diff --cc CHANGES.txt
index a748e28,0453ddd..973939e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,20 -1,5 +1,21 @@@
 -3.0.16
 +3.11.2
+  * Close socket on error during connect on OutboundTcpConnection 
(CASSANDRA-9630)
 + * Enable CDC unittest (CASSANDRA-14141)
 + * Acquire read lock before accessing CompactionStrategyManager fields 
(CASSANDRA-14139)
 + * Split CommitLogStressTest to avoid timeout (CASSANDRA-14143)
 + * Avoid invalidating disk boundaries unnecessarily (CASSANDRA-14083)
 + * Avoid exposing compaction strategy index externally (CASSANDRA-14082)
 + * Prevent continuous schema exchange between 3.0 and 3.11 nodes 
(CASSANDRA-14109)
 + * Fix imbalanced disks when replacing node with same address with JBOD 
(CASSANDRA-14084)
 + * Reload compaction strategies when disk boundaries are invalidated 
(CASSANDRA-13948)
 + * Remove OpenJDK log warning (CASSANDRA-13916)
 + * Prevent compaction strategies from looping indefinitely (CASSANDRA-14079)
 + * Cache disk boundaries (CASSANDRA-13215)
 + * Add asm jar to build.xml for maven builds (CASSANDRA-11193)
 + * Round buffer size to powers of 2 for the chunk cache (CASSANDRA-13897)
 + * Update jackson JSON jars (CASSANDRA-13949)
 + * Avoid locks when checking LCS fanout and if we should defrag 
(CASSANDRA-13930)
 +Merged from 3.0:
   * Set encoding for javadoc generation (CASSANDRA-14154)
   * Fix index target computation for dense composite tables with dropped 
compact storage (CASSANDRA-14104)
   * Improve commit log chain marker updating (CASSANDRA-14108)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/36375f8b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --cc src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 6cd1064,9fbd3a8..c211f0b
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@@ -541,8 -544,9 +541,8 @@@ public class OutboundTcpConnection exte
  }
  catch (IOException e)
  {
- socket = null;
+ disconnect();
 -if (logger.isTraceEnabled())
 -logger.trace("unable to connect to " + 
poolReference.endPoint(), e);
 +logger.debug("Unable to connect to {}", 
poolReference.endPoint(), e);
  Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, 
TimeUnit.MILLISECONDS);
  }
  }


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



[6/6] cassandra git commit: Merge branch 'cassandra-3.11' into trunk

2018-01-15 Thread paulo
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: 1e58a53ca17d1292acbb820a2f7c334210e9a33e
Parents: 8587b0c 36375f8
Author: Paulo Motta 
Authored: Sat Jan 13 01:27:15 2018 -0200
Committer: Paulo Motta 
Committed: Sat Jan 13 01:27:15 2018 -0200

--

--



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



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

2018-01-15 Thread paulo
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/36375f8b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/36375f8b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/36375f8b

Branch: refs/heads/trunk
Commit: 36375f8b5571891e318ba4abaa61d96477e52e22
Parents: 5133526 51bf518
Author: Paulo Motta 
Authored: Sat Jan 13 01:25:10 2018 -0200
Committer: Paulo Motta 
Committed: Sat Jan 13 01:25:10 2018 -0200

--
 CHANGES.txt  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/36375f8b/CHANGES.txt
--
diff --cc CHANGES.txt
index a748e28,0453ddd..973939e
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,20 -1,5 +1,21 @@@
 -3.0.16
 +3.11.2
+  * Close socket on error during connect on OutboundTcpConnection 
(CASSANDRA-9630)
 + * Enable CDC unittest (CASSANDRA-14141)
 + * Acquire read lock before accessing CompactionStrategyManager fields 
(CASSANDRA-14139)
 + * Split CommitLogStressTest to avoid timeout (CASSANDRA-14143)
 + * Avoid invalidating disk boundaries unnecessarily (CASSANDRA-14083)
 + * Avoid exposing compaction strategy index externally (CASSANDRA-14082)
 + * Prevent continuous schema exchange between 3.0 and 3.11 nodes 
(CASSANDRA-14109)
 + * Fix imbalanced disks when replacing node with same address with JBOD 
(CASSANDRA-14084)
 + * Reload compaction strategies when disk boundaries are invalidated 
(CASSANDRA-13948)
 + * Remove OpenJDK log warning (CASSANDRA-13916)
 + * Prevent compaction strategies from looping indefinitely (CASSANDRA-14079)
 + * Cache disk boundaries (CASSANDRA-13215)
 + * Add asm jar to build.xml for maven builds (CASSANDRA-11193)
 + * Round buffer size to powers of 2 for the chunk cache (CASSANDRA-13897)
 + * Update jackson JSON jars (CASSANDRA-13949)
 + * Avoid locks when checking LCS fanout and if we should defrag 
(CASSANDRA-13930)
 +Merged from 3.0:
   * Set encoding for javadoc generation (CASSANDRA-14154)
   * Fix index target computation for dense composite tables with dropped 
compact storage (CASSANDRA-14104)
   * Improve commit log chain marker updating (CASSANDRA-14108)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/36375f8b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --cc src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 6cd1064,9fbd3a8..c211f0b
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@@ -541,8 -544,9 +541,8 @@@ public class OutboundTcpConnection exte
  }
  catch (IOException e)
  {
- socket = null;
+ disconnect();
 -if (logger.isTraceEnabled())
 -logger.trace("unable to connect to " + 
poolReference.endPoint(), e);
 +logger.debug("Unable to connect to {}", 
poolReference.endPoint(), e);
  Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, 
TimeUnit.MILLISECONDS);
  }
  }


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



[2/6] cassandra git commit: Close socket on error during connect on OutboundTcpConnection

2018-01-15 Thread paulo
Close socket on error during connect on OutboundTcpConnection

Patch by Paulo Motta; Reviewed by Robert Stupp for CASSANDRA-9630


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

Branch: refs/heads/cassandra-3.11
Commit: 51bf51813c4a7a9f9ad3adfe8ddac171b398816b
Parents: fde05f4
Author: Paulo Motta 
Authored: Thu Jul 28 18:49:42 2016 -0300
Committer: Paulo Motta 
Committed: Sat Jan 13 01:22:22 2018 -0200

--
 CHANGES.txt  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c32e56a..0453ddd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.16
+ * Close socket on error during connect on OutboundTcpConnection 
(CASSANDRA-9630)
  * Set encoding for javadoc generation (CASSANDRA-14154)
  * Fix index target computation for dense composite tables with dropped 
compact storage (CASSANDRA-14104)
  * Improve commit log chain marker updating (CASSANDRA-14108)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 99ad194..9fbd3a8 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -538,13 +538,13 @@ public class OutboundTcpConnection extends Thread
 catch (SSLHandshakeException e)
 {
 logger.error("SSL handshake error for outbound connection to " 
+ socket, e);
-socket = null;
+disconnect();
 // SSL errors won't be recoverable within timeout period so 
we'll just abort
 return false;
 }
 catch (IOException e)
 {
-socket = null;
+disconnect();
 if (logger.isTraceEnabled())
 logger.trace("unable to connect to " + 
poolReference.endPoint(), e);
 Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, 
TimeUnit.MILLISECONDS);


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



[3/6] cassandra git commit: Close socket on error during connect on OutboundTcpConnection

2018-01-15 Thread paulo
Close socket on error during connect on OutboundTcpConnection

Patch by Paulo Motta; Reviewed by Robert Stupp for CASSANDRA-9630


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

Branch: refs/heads/trunk
Commit: 51bf51813c4a7a9f9ad3adfe8ddac171b398816b
Parents: fde05f4
Author: Paulo Motta 
Authored: Thu Jul 28 18:49:42 2016 -0300
Committer: Paulo Motta 
Committed: Sat Jan 13 01:22:22 2018 -0200

--
 CHANGES.txt  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c32e56a..0453ddd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.16
+ * Close socket on error during connect on OutboundTcpConnection 
(CASSANDRA-9630)
  * Set encoding for javadoc generation (CASSANDRA-14154)
  * Fix index target computation for dense composite tables with dropped 
compact storage (CASSANDRA-14104)
  * Improve commit log chain marker updating (CASSANDRA-14108)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 99ad194..9fbd3a8 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -538,13 +538,13 @@ public class OutboundTcpConnection extends Thread
 catch (SSLHandshakeException e)
 {
 logger.error("SSL handshake error for outbound connection to " 
+ socket, e);
-socket = null;
+disconnect();
 // SSL errors won't be recoverable within timeout period so 
we'll just abort
 return false;
 }
 catch (IOException e)
 {
-socket = null;
+disconnect();
 if (logger.isTraceEnabled())
 logger.trace("unable to connect to " + 
poolReference.endPoint(), e);
 Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, 
TimeUnit.MILLISECONDS);


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



[1/6] cassandra git commit: Close socket on error during connect on OutboundTcpConnection

2018-01-15 Thread paulo
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 fde05f4f1 -> 51bf51813
  refs/heads/cassandra-3.11 513352673 -> 36375f8b5
  refs/heads/trunk 8587b0ceb -> 1e58a53ca


Close socket on error during connect on OutboundTcpConnection

Patch by Paulo Motta; Reviewed by Robert Stupp for CASSANDRA-9630


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

Branch: refs/heads/cassandra-3.0
Commit: 51bf51813c4a7a9f9ad3adfe8ddac171b398816b
Parents: fde05f4
Author: Paulo Motta 
Authored: Thu Jul 28 18:49:42 2016 -0300
Committer: Paulo Motta 
Committed: Sat Jan 13 01:22:22 2018 -0200

--
 CHANGES.txt  | 1 +
 src/java/org/apache/cassandra/net/OutboundTcpConnection.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index c32e56a..0453ddd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.16
+ * Close socket on error during connect on OutboundTcpConnection 
(CASSANDRA-9630)
  * Set encoding for javadoc generation (CASSANDRA-14154)
  * Fix index target computation for dense composite tables with dropped 
compact storage (CASSANDRA-14104)
  * Improve commit log chain marker updating (CASSANDRA-14108)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/51bf5181/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
--
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java 
b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 99ad194..9fbd3a8 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -538,13 +538,13 @@ public class OutboundTcpConnection extends Thread
 catch (SSLHandshakeException e)
 {
 logger.error("SSL handshake error for outbound connection to " 
+ socket, e);
-socket = null;
+disconnect();
 // SSL errors won't be recoverable within timeout period so 
we'll just abort
 return false;
 }
 catch (IOException e)
 {
-socket = null;
+disconnect();
 if (logger.isTraceEnabled())
 logger.trace("unable to connect to " + 
poolReference.endPoint(), e);
 Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, 
TimeUnit.MILLISECONDS);


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



[jira] [Updated] (CASSANDRA-14165) execute_prepared_cql3_query with LIKE not working

2018-01-15 Thread Alexandr Gorbachev (JIRA)

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

Alexandr Gorbachev updated CASSANDRA-14165:
---
Description: 
Hello ,

I have faced up with following issue.
 Seems like LIKE is not supported by 'execute_prepared_cql3_query'.
 Is it by desing or somehow it is possible to find a workaroud or to fix this 
issue?

More details. Query looks like :
 SELECT * FROM tabke WHERE a= ? AND b = ? AND c IN (?,?,?,?,?,?,?) AND column 
LIKE ? ALLOW FILTERING;
 Is not working.

If I send directly query in prepare statement.
 So actully wihout passing parameters in preare statement, just like plain 
query, then this is working:
 SELECT * FROM tabke WHERE a= '1' AND b = '2' AND c IN ('3','4') AND column 
LIKE '%A%' ALLOW FILTERING;

Could you please suggest also where it is possible to find 
description/definition of 'execute_prepared_cql3_query'.

 

Thank you for help.

  was:
Hello ,

I have faced up with following issue.
Seems like LIKE is not supported by 'execute_prepared_cql3_query'.
Is it by desing or somehow it is possible to find a workaroud or to fix this 
issue?

More details. Query looks like :
SELECT * FROM tabke WHERE a= ? AND b = ? AND c IN (?,?,?,?,?,?,?) AND column 
LIKE ? ALLOW FILTERING;
Is not working.

If I send directly query in prepare statement.
So actully wihout passing parameters in preare statement, just like plain 
query,  then this is working:
SELECT * FROM tabke WHERE a= '1' AND b = '2' AND c IN ('3','4') AND column LIKE 
'%A%' ALLOW FILTERING;

Thank you for help.


> execute_prepared_cql3_query with LIKE not working
> -
>
> Key: CASSANDRA-14165
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14165
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Alexandr Gorbachev
>Priority: Major
>
> Hello ,
> I have faced up with following issue.
>  Seems like LIKE is not supported by 'execute_prepared_cql3_query'.
>  Is it by desing or somehow it is possible to find a workaroud or to fix this 
> issue?
> More details. Query looks like :
>  SELECT * FROM tabke WHERE a= ? AND b = ? AND c IN (?,?,?,?,?,?,?) AND column 
> LIKE ? ALLOW FILTERING;
>  Is not working.
> If I send directly query in prepare statement.
>  So actully wihout passing parameters in preare statement, just like plain 
> query, then this is working:
>  SELECT * FROM tabke WHERE a= '1' AND b = '2' AND c IN ('3','4') AND column 
> LIKE '%A%' ALLOW FILTERING;
> Could you please suggest also where it is possible to find 
> description/definition of 'execute_prepared_cql3_query'.
>  
> Thank you for help.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Created] (CASSANDRA-14167) IndexOutOfBoundsException when selecting column counter and consistency quorum

2018-01-15 Thread Tristan Last (JIRA)
Tristan Last created CASSANDRA-14167:


 Summary: IndexOutOfBoundsException when selecting column counter 
and consistency quorum
 Key: CASSANDRA-14167
 URL: https://issues.apache.org/jira/browse/CASSANDRA-14167
 Project: Cassandra
  Issue Type: Bug
 Environment: Cassandra 3.11.1

Ubuntu 14-04
Reporter: Tristan Last


This morning I upgraded my cluster from 3.11.0 to 3.11.1 and it appears when I 
perform a query on a counter specifying the column name cassandra throws the 
following exception:
{code:java}
WARN [ReadStage-1] 2018-01-15 10:58:30,121 
AbstractLocalAwareExecutorService.java:167 - Uncaught exception on thread 
Thread[ReadStage-1,5,main]: {}
java.lang.IndexOutOfBoundsException: null
java.nio.Buffer.checkIndex(Buffer.java:546) ~[na:1.8.0_144]
java.nio.HeapByteBuffer.getShort(HeapByteBuffer.java:314) ~[na:1.8.0_144]
org.apache.cassandra.db.context.CounterContext.headerLength(CounterContext.java:173)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.context.CounterContext.updateDigest(CounterContext.java:696)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.rows.AbstractCell.digest(AbstractCell.java:126) 
~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.rows.AbstractRow.digest(AbstractRow.java:73) 
~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.rows.UnfilteredRowIterators.digest(UnfilteredRowIterators.java:181)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.partitions.UnfilteredPartitionIterators.digest(UnfilteredPartitionIterators.java:263)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.ReadResponse.makeDigest(ReadResponse.java:120) 
~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.ReadResponse.createDigestResponse(ReadResponse.java:87) 
~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:345) 
~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.db.ReadCommandVerbHandler.doVerb(ReadCommandVerbHandler.java:50)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:66) 
~[apache-cassandra-3.11.1.jar:3.11.1]
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_144]
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
 ~[apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:134)
 [apache-cassandra-3.11.1.jar:3.11.1]
org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) 
[apache-cassandra-3.11.1.jar:3.11.1]
java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
{code}

Query works completely find on consistency level ONE but not on QUORUM. 
Is this possibly related to CASSANDRA-11726?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Updated] (CASSANDRA-14158) [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX connection error from nodetool

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson updated CASSANDRA-14158:

Status: Patch Available  (was: Open)

https://github.com/apache/cassandra-dtest/pull/16

> [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX 
> connection error from nodetool
> 
>
> Key: CASSANDRA-14158
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14158
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Assignee: Marcus Eriksson
>Priority: Major
>
> repair_test.py::test_dead_coordinator is flaky due to occasionally failing 
> when a JMX connection error is propagated by nodetool.
> the test has failed 4+ times for the same reason.
> latest failure can be found in the artifacts for the following circleci run:
> [https://circleci.com/gh/mkjellman/cassandra/538]
> I *think* that this might be expected behavior for this test and we just need 
> to catch any ToolError exceptions thrown and only fail if included stack is 
> for any error other than "JMX connection closed."
> {code}
> stderr: error: [2018-01-10 07:07:55,178] JMX connection closed. You should 
> check server log for repair status of keyspace system_traces(Subsequent 
> keyspaces are not going to be repaired).
> -- StackTrace --
> java.io.IOException: [2018-01-10 07:07:55,178] JMX connection closed. You 
> should check server log for repair status of keyspace 
> system_traces(Subsequent keyspaces are not going to be repaired).
>   at 
> org.apache.cassandra.tools.RepairRunner.handleConnectionFailed(RepairRunner.java:104)
>   at 
> org.apache.cassandra.utils.progress.jmx.JMXNotificationProgressListener.handleNotification(JMXNotificationProgressListener.java:86)
>   at 
> javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:275)
>   at 
> javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:352)
>   at 
> javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:337)
>   at 
> javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:248)
>   at 
> javax.management.remote.rmi.RMIConnector.sendNotification(RMIConnector.java:441)
>   at 
> javax.management.remote.rmi.RMIConnector.access$1200(RMIConnector.java:121)
>   at 
> javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1531)
>   at 
> javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1352)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchOneNotif(ClientNotifForwarder.java:655)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:607)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.doRun(ClientNotifForwarder.java:471)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:452)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:108)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (CASSANDRA-14158) [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX connection error from nodetool

2018-01-15 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CASSANDRA-14158:


GitHub user krummas opened a pull request:

https://github.com/apache/cassandra-dtest/pull/16

catch and ignore ToolError

CASSANDRA-14158

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/krummas/cassandra-dtest marcuse/14158

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cassandra-dtest/pull/16.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #16


commit 08fb197b1097dfc9de16ccded05df15c8ea5a103
Author: Marcus Eriksson 
Date:   2018-01-15T09:45:24Z

catch and ignore ToolError




> [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX 
> connection error from nodetool
> 
>
> Key: CASSANDRA-14158
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14158
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Assignee: Marcus Eriksson
>Priority: Major
>
> repair_test.py::test_dead_coordinator is flaky due to occasionally failing 
> when a JMX connection error is propagated by nodetool.
> the test has failed 4+ times for the same reason.
> latest failure can be found in the artifacts for the following circleci run:
> [https://circleci.com/gh/mkjellman/cassandra/538]
> I *think* that this might be expected behavior for this test and we just need 
> to catch any ToolError exceptions thrown and only fail if included stack is 
> for any error other than "JMX connection closed."
> {code}
> stderr: error: [2018-01-10 07:07:55,178] JMX connection closed. You should 
> check server log for repair status of keyspace system_traces(Subsequent 
> keyspaces are not going to be repaired).
> -- StackTrace --
> java.io.IOException: [2018-01-10 07:07:55,178] JMX connection closed. You 
> should check server log for repair status of keyspace 
> system_traces(Subsequent keyspaces are not going to be repaired).
>   at 
> org.apache.cassandra.tools.RepairRunner.handleConnectionFailed(RepairRunner.java:104)
>   at 
> org.apache.cassandra.utils.progress.jmx.JMXNotificationProgressListener.handleNotification(JMXNotificationProgressListener.java:86)
>   at 
> javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:275)
>   at 
> javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:352)
>   at 
> javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:337)
>   at 
> javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:248)
>   at 
> javax.management.remote.rmi.RMIConnector.sendNotification(RMIConnector.java:441)
>   at 
> javax.management.remote.rmi.RMIConnector.access$1200(RMIConnector.java:121)
>   at 
> javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1531)
>   at 
> javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1352)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchOneNotif(ClientNotifForwarder.java:655)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:607)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.doRun(ClientNotifForwarder.java:471)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:452)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:108)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Assigned] (CASSANDRA-14158) [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX connection error from nodetool

2018-01-15 Thread Marcus Eriksson (JIRA)

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

Marcus Eriksson reassigned CASSANDRA-14158:
---

Assignee: Marcus Eriksson

> [DTEST] [TRUNK] repair_test.py::test_dead_coordinator is flaky due to JMX 
> connection error from nodetool
> 
>
> Key: CASSANDRA-14158
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14158
> Project: Cassandra
>  Issue Type: Bug
>  Components: Testing
>Reporter: Michael Kjellman
>Assignee: Marcus Eriksson
>Priority: Major
>
> repair_test.py::test_dead_coordinator is flaky due to occasionally failing 
> when a JMX connection error is propagated by nodetool.
> the test has failed 4+ times for the same reason.
> latest failure can be found in the artifacts for the following circleci run:
> [https://circleci.com/gh/mkjellman/cassandra/538]
> I *think* that this might be expected behavior for this test and we just need 
> to catch any ToolError exceptions thrown and only fail if included stack is 
> for any error other than "JMX connection closed."
> {code}
> stderr: error: [2018-01-10 07:07:55,178] JMX connection closed. You should 
> check server log for repair status of keyspace system_traces(Subsequent 
> keyspaces are not going to be repaired).
> -- StackTrace --
> java.io.IOException: [2018-01-10 07:07:55,178] JMX connection closed. You 
> should check server log for repair status of keyspace 
> system_traces(Subsequent keyspaces are not going to be repaired).
>   at 
> org.apache.cassandra.tools.RepairRunner.handleConnectionFailed(RepairRunner.java:104)
>   at 
> org.apache.cassandra.utils.progress.jmx.JMXNotificationProgressListener.handleNotification(JMXNotificationProgressListener.java:86)
>   at 
> javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:275)
>   at 
> javax.management.NotificationBroadcasterSupport$SendNotifJob.run(NotificationBroadcasterSupport.java:352)
>   at 
> javax.management.NotificationBroadcasterSupport$1.execute(NotificationBroadcasterSupport.java:337)
>   at 
> javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:248)
>   at 
> javax.management.remote.rmi.RMIConnector.sendNotification(RMIConnector.java:441)
>   at 
> javax.management.remote.rmi.RMIConnector.access$1200(RMIConnector.java:121)
>   at 
> javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1531)
>   at 
> javax.management.remote.rmi.RMIConnector$RMINotifClient.fetchNotifs(RMIConnector.java:1352)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchOneNotif(ClientNotifForwarder.java:655)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.fetchNotifs(ClientNotifForwarder.java:607)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.doRun(ClientNotifForwarder.java:471)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$NotifFetcher.run(ClientNotifForwarder.java:452)
>   at 
> com.sun.jmx.remote.internal.ClientNotifForwarder$LinearExecutor$1.run(ClientNotifForwarder.java:108)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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