Select with filtering

2014-04-25 Thread Mikhail Mazursky
Hello all,

I have the following schema:

CREATE TABLE my_table (
a varchar,
b varchar,
c int,
d varchar,
e uuid,
PRIMARY KEY ((a, b), c, d)
)

SELECT * FROM my_table WHERE a=? AND b=? AND e=? ALLOW FILTERING

The query above gives me the following exception message:

com.datastax.driver.core.exceptions.InvalidQueryException: No indexed
columns present in by-columns clause with Equal operator

SELECT * FROM my_table WHERE a=? AND b=?
Works fine and I see not reason why original query should not be able to do
such filtering.

If I add a secondary index by e column, then such query will work, but I
do not want to do that.

Cassandra 2.0.5
Driver 2.0.1

Is that a bug/not implemented feature? Or maybe I'm doing something wrong?

Kind regards,
Mikhail.


Re: Select with filtering

2014-04-25 Thread Mikhail Mazursky
Hello Paco,

thanks for response.

IMHO this is a not implemented feature in such case. Instead of fetching
whole wide row using partitioning key and filtering it on client side this
can be done on server side. In my particular case this will be more optimal
than adding secondary index. Maybe in case if there is a secondary index
and the whole partitioning key specified C* can use some statistics about
data to determine which way to go to make query more selective.

What do core developers think? Should I fill an issue in Jira?



2014-04-25 15:23 GMT+06:00 Paco Trujillo f.truji...@genetwister.nl:

 Hi Mikhail



 It is not a bug/not implemented feature and you are not doing nothing
 wrong.  As you can check on the documentation you can only filter on a key
 name or a column that has a secondary index created on it:




 http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html



 *From:* Mikhail Mazursky [mailto:ash...@gmail.com]
 *Sent:* vrijdag 25 april 2014 11:01
 *To:* user@cassandra.apache.org
 *Subject:* Select with filtering



 Hello all,

 I have the following schema:


 CREATE TABLE my_table (
 a varchar,
 b varchar,
 c int,
 d varchar,
 e uuid,
 PRIMARY KEY ((a, b), c, d)
 )

 SELECT * FROM my_table WHERE a=? AND b=? AND e=? ALLOW FILTERING



 The query above gives me the following exception message:


 com.datastax.driver.core.exceptions.InvalidQueryException: No indexed
 columns present in by-columns clause with Equal operator

 SELECT * FROM my_table WHERE a=? AND b=?

 Works fine and I see not reason why original query should not be able to
 do such filtering.

 If I add a secondary index by e column, then such query will work, but I
 do not want to do that.



 Cassandra 2.0.5

 Driver 2.0.1

 Is that a bug/not implemented feature? Or maybe I'm doing something wrong?



 Kind regards,

 Mikhail.



Node hang on shutdown

2013-10-31 Thread Mikhail Mazursky
Hi.

I was upgrading my 3 node testing cluster from 2.0.1 to 2.0.2. I
successfully upgraded two nodes but the last one did not shutdown properly.
Does somebody see anything suspicious in the attached thread dump?

Regards,
Mikhail.
2013-10-31 12:09:12
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode):

Attach Listener daemon prio=10 tid=0x7f15e0007800 nid=0x3467 waiting on 
condition [0x]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
- None

StorageServiceShutdownHook prio=10 tid=0x7f15e4678800 nid=0x343e waiting 
on condition [0x7f15dc97b000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  0xc6fddb10 (a 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at 
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
at 
java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1468)
at 
org.apache.cassandra.service.StorageService$1.runMayThrow(StorageService.java:502)
at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
at java.lang.Thread.run(Thread.java:724)

   Locked ownable synchronizers:
- None

SIGTERM handler daemon prio=10 tid=0x7f15e001c800 nid=0x343c in 
Object.wait() [0x7f15da198000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0xc6fe9218 (a java.lang.Thread)
at java.lang.Thread.join(Thread.java:1260)
- locked 0xc6fe9218 (a java.lang.Thread)
at java.lang.Thread.join(Thread.java:1334)
at 
java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks.java:106)
at 
java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.java:46)
at java.lang.Shutdown.runHooks(Shutdown.java:123)
at java.lang.Shutdown.sequence(Shutdown.java:167)
at java.lang.Shutdown.exit(Shutdown.java:212)
- locked 0xc6c5e8c0 (a java.lang.Class for java.lang.Shutdown)
at java.lang.Terminator$1.handle(Terminator.java:52)
at sun.misc.Signal$1.run(Signal.java:212)
at java.lang.Thread.run(Thread.java:724)

   Locked ownable synchronizers:
- None

MigrationStage:3 daemon prio=10 tid=0x7f15ec00f000 nid=0x343a waiting on 
condition [0x7f15dc62e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  0xc6fcdb10 (a 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at 
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
at 
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at 
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

   Locked ownable synchronizers:
- None

MutationStage:2718 daemon prio=10 tid=0x7f15f4026000 nid=0x33ea waiting 
on condition [0x7f15d857a000]
   java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  0xc2a186a0 (a 
java.util.concurrent.FutureTask$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:248)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at 
org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:407)
at 
org.apache.cassandra.db.ColumnFamilyStore.forceBlockingFlush(ColumnFamilyStore.java:818)
at 
org.apache.cassandra.db.ColumnFamilyStore.truncateBlocking(ColumnFamilyStore.java:1913)
at 
org.apache.cassandra.db.TruncateVerbHandler.doVerb(TruncateVerbHandler.java:40)
at 
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 

Re: Node hang on shutdown

2013-10-31 Thread Mikhail Mazursky
Romain,

yes, I had to kill -9 to stop it.

INFO [RequestResponseStage:54] 2013-10-31 11:59:10,413 Gossiper.java (line
789) InetAddress /192.168.0.197 is now UP
 INFO [GossipStage:1] 2013-10-31 11:59:10,706 StorageService.java (line
1298) Node /192.168.0.197 state jump to normal
 INFO [GossipStage:1] 2013-10-31 12:00:55,905 Gossiper.java (line 806)
InetAddress /192.168.0.251 is now DOWN
 INFO [HANDSHAKE-/192.168.0.251] 2013-10-31 12:01:35,848
OutboundTcpConnection.java (line 386) Handshaking version with /
192.168.0.251
 INFO [GossipStage:1] 2013-10-31 12:01:35,978 Gossiper.java (line 824) Node
/192.168.0.251 has restarted, now UP
 INFO [MemoryMeter:1] 2013-10-31 12:01:35,980 Memtable.java (line 442)
CFS(Keyspace='system', ColumnFamily='peers') liveRatio is
17.361702127659573 (just-counted was 17.361702127659573).  calculation took
0m
s for 10 columns
 INFO [HANDSHAKE-/192.168.0.251] 2013-10-31 12:01:35,989
OutboundTcpConnection.java (line 386) Handshaking version with /
192.168.0.251
 INFO [RequestResponseStage:55] 2013-10-31 12:01:36,065 Gossiper.java (line
789) InetAddress /192.168.0.251 is now UP
ERROR [MigrationStage:2] 2013-10-31 12:01:36,176 CassandraDaemon.java (line
185) Exception in thread Thread[MigrationStage:2,5,main]
java.lang.RuntimeException: java.io.FileNotFoundException:
/var/lib/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-jb-95-Index.db
(Too many open files)
at
org.apache.cassandra.io.util.RandomAccessReader.open(RandomAccessReader.java:102)
at
org.apache.cassandra.io.util.RandomAccessReader.open(RandomAccessReader.java:90)
at
org.apache.cassandra.io.sstable.SSTableReader.openIndexReader(SSTableReader.java:1337)
at
org.apache.cassandra.io.sstable.SSTableScanner.init(SSTableScanner.java:68)
at
org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:1115)
at
org.apache.cassandra.db.RowIteratorFactory.getIterator(RowIteratorFactory.java:69)
at
org.apache.cassandra.db.ColumnFamilyStore.getSequentialIterator(ColumnFamilyStore.java:1507)
at
org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1626)
at
org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1564)
at
org.apache.cassandra.db.SystemKeyspace.serializedSchema(SystemKeyspace.java:722)
at
org.apache.cassandra.db.SystemKeyspace.serializeSchema(SystemKeyspace.java:743)
at
org.apache.cassandra.db.SystemKeyspace.serializeSchema(SystemKeyspace.java:733)
at
org.apache.cassandra.db.MigrationRequestVerbHandler.doVerb(MigrationRequestVerbHandler.java:42)
at
org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.io.FileNotFoundException:
/var/lib/cassandra/data/system/schema_keyspaces/system-schema_keyspaces-jb-95-Index.db
(Too many open files)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.init(RandomAccessFile.java:233)
at
org.apache.cassandra.io.util.RandomAccessReader.init(RandomAccessReader.java:58)
at
org.apache.cassandra.io.util.RandomAccessReader.open(RandomAccessReader.java:98)
... 16 more
 INFO [GossipStage:1] 2013-10-31 12:01:36,549 StorageService.java (line
1298) Node /192.168.0.251 state jump to normal
 INFO [StorageServiceShutdownHook] 2013-10-31 12:02:38,067
ThriftServer.java (line 141) Stop listening to thrift clients
 INFO [StorageServiceShutdownHook] 2013-10-31 12:02:38,174 Server.java
(line 174) Stop listening for CQL clients
 INFO [StorageServiceShutdownHook] 2013-10-31 12:02:38,175 Gossiper.java
(line 1129) Announcing shutdown
 INFO [StorageServiceShutdownHook] 2013-10-31 12:02:40,175
MessagingService.java (line 665) Waiting for messaging service to quiesce
 INFO [ACCEPT-/192.168.0.232] 2013-10-31 12:02:40,176 MessagingService.java
(line 846) MessagingService shutting down server thread.

And there are a lot of such exceptions (the above one is the last before it
hanged).
There are no exceptions after upgrade and startup.
Looks like C* is leaking file handles (nothing else is running on that VM).
I will try to debug it.

Thanks for pointing me to the logs.

Regards,
Mikhail.



2013/10/31 Romain HARDOUIN romain.hardo...@urssaf.fr

 Hi,

 So you had to kill -9 the process?
 Is there something interesting in system.log?
 Can you restart the node or are there any errors on startup?

 Romain

 Mikhail Mazursky ash...@gmail.com a écrit sur 31/10/2013 08:02:22 :

  De : Mikhail Mazursky ash...@gmail.com
  A : user@cassandra.apache.org,
  Date : 31/10/2013 08:04
  Objet : Node hang on shutdown
 
  Hi.

  I was upgrading my 3 node testing cluster from 2.0.1 to 2.0.2. I
  successfully upgraded two nodes

Re: Node hang on shutdown

2013-10-31 Thread Mikhail Mazursky
Looks like a bug. See
https://issues.apache.org/jira/browse/CASSANDRA-6275for more details.


Re: C* consumes all RAM

2013-04-16 Thread Mikhail Mazursky
Thank you, Aaron.

p.s. we're on 1.1.9 - i forgot to mention that.


2013/4/17 aaron morton aa...@thelastpickle.com

 You are probably seeing this http://wiki.apache.org/cassandra/FAQ#mmap

 Cheers

-
 Aaron Morton
 Freelance Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com

 On 16/04/2013, at 8:43 PM, Mikhail Mazursky ash...@gmail.com wrote:

 More details:

 USER   PID %CPU %MEMVSZ   RSS TTY  STAT START   TIME COMMAND
 219   3801  0.7 92.7 6561116 3567016 ? SLl  Mar11 372:44
 /usr/java/latest/bin/java

 Linux XXX@YYY 3.2.30-49.59.amzn1.x86_64 #1 SMP Wed Oct 3 19:54:33 UTC
 2012 x86_64 x86_64 x86_64 GNU/Linux

 total   used   free sharedbuffers cached
 Mem:  3754   3695 59  0 37 75
 -/+ buffers/cache:   3582171
 Swap: 2055165   1890



 2013/4/16 Mikhail Mazursky ash...@gmail.com

 Hello.

 C* have been running without any problem for some weeks but now it
 started to consume all available ram.

 The cluster have very little data in it. There are no errors in logs, CPU
 is not loaded at all, jstack shows no deadlocks, there are 83 threads.
 Read/write latency is 1-4ms.

 The question is: how to find out where is the RAM used?

 # nodetool ring keyspace name
 Address DC  RackStatus State   Load
 Effective-Ownership Token

 114967934986393518082067045023985443411
 10.0.1.220  datacenter1 rack1   Up Normal  889.71 KB
 100.00% 0
 10.0.1.222  datacenter1 rack1   Up Normal  918.92 KB
 100.00% 56662868904138943096229641828625627278
 10.0.1.221  datacenter1 rack1   Up Normal  1.04 MB
 100.00% 114967934986393518082067045023985443411

 We use AWS m1.medium - 3.75 RAM, 1 Core

 java version 1.7.0_10
 Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
 Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

 C* is started with the following command
 /usr/java/latest/bin/java -ea
 -javaagent:/usr/share/cassandra/lib/jamm-0.2.5.jar -XX:+UseThreadPriorities
 -XX:ThreadPriorityPolicy=42 -Xms1G -Xmx1G -Xmn512M
 -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX:+UseParNewGC

 Thanks in advance.

 Mikhail.






Re: Blobs in CQL?

2013-04-12 Thread Mikhail Mazursky
Hi,

let me ask a related question. Is it planned to support passing InputStream
or Guava's InputSupplierInputStream/ByteSource to BoundStatement to make
it possible to take advantage of new native transport's streaming?

p.s. the new driver looks cool, but I haven't tried it yet.

Mikhail.


Re: [VOTE] Release Mojo's Cassandra Maven Plugin 1.2.1-1

2013-02-14 Thread Mikhail Mazursky
+1 =)


2013/2/14 Stephen Connolly stephen.alan.conno...@gmail.com

 Hi,

 I'd like to release version 1.2.1-1 of Mojo's Cassandra Maven Plugin
 to sync up with the 1.2.1 release of Apache Cassandra.

 We solved 1 issues:

 http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=12121version=19089

 Staging Repository:
 https://nexus.codehaus.org/content/repositories/orgcodehausmojo-015/

 Site:
 http://mojo.codehaus.org/cassandra-maven-plugin/index.html

 SCM Tag:
 https://svn.codehaus.org/mojo/tags/cassandra-maven-plugin-1.2.1-1@17931

  [ ] +1 Yeah! fire ahead oh and the blind man on the galloping horse
 says it looks fine too.
  [ ] 0 Mehhh! like I care, I don't have any opinions either, I'd
 follow somebody else if only I could decide who
  [ ] -1 No! wait up there I have issues (in general like, ya know,
 and being a trouble-maker is only one of them)

 The vote is open for 72h and will succeed by lazy consensus.

 Guide to testing staged releases:
 http://maven.apache.org/guides/development/guide-testing-releases.html

 Cheers

 -Stephen

 P.S.
  In the interest of ensuring (more is) better testing, and as is now
 tradition for Mojo's Cassandra Maven Plugin, this vote is
 also open to any subscribers of the dev and user@cassandra.apache.org
 mailing lists that want to test or use this plugin.



Re: [VOTE] Release Mojo's Cassandra Maven Plugin 1.2.0-1

2013-02-13 Thread Mikhail Mazursky
+1. Please, release it.


2013/2/14 Stephen Connolly stephen.alan.conno...@gmail.com

 More I'm looking for somebody who is actively sing C* to test it (there
 are a couple of users... The lot f you who asked me to roll another
 release). I will roll a 1.2.1 once I close this vote... I could close with
 lazy consensus, but feel more comfortable if it has ad some testing ;-)


 On Wednesday, 13 February 2013, Michael Kjellman wrote:

 Considering that 1.2.1 is out, and looking at your project very quickly
 (looks interesting)/overlaps a bit with CCMBridge no?/ I'd def say +1 :)

 From: Stephen Connolly stephen.alan.conno...@gmail.commailto:
 stephen.alan.conno...@gmail.com
 Reply-To: user@cassandra.apache.orgmailto:user@cassandra.apache.org 
 user@cassandra.apache.orgmailto:user@cassandra.apache.org

 Date: Wednesday, February 13, 2013 1:27 PM
 To: d...@mojo.codehaus.orgmailto:d...@mojo.codehaus.org 
 d...@mojo.codehaus.orgmailto:d...@mojo.codehaus.org, dev 
 d...@cassandra.apache.orgmailto:d...@cassandra.apache.org, 
 user@cassandra.apache.orgmailto:user@cassandra.apache.org 
 user@cassandra.apache.orgmailto:user@cassandra.apache.org

 Subject: Re: [VOTE] Release Mojo's Cassandra Maven Plugin 1.2.0-1

 Ping

 On Monday, 4 February 2013, Stephen Connolly wrote:
 Hi,

 I'd like to release version 1.2.0-1 of Mojo's Cassandra Maven Plugin
 to sync up with the 1.2.0 release of Apache Cassandra. (a 1.2.1-1 will
 follow shortly after this release, but it should be possible to use the
 xpath://project/build/plugins/plugin/dependencies/dependency override of
 cassandra-server to use C* releases from the 1.2.x stream now that the link
 errors have been resolved, so that is less urgent)

 We solved 1 issues:

 http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=12121version=18467

 Staging Repository:
 https://nexus.codehaus.org/content/repositories/orgcodehausmojo-013/

 Site:
 http://mojo.codehaus.org/cassandra-maven-plugin/index.html

 SCM Tag:
 https://svn.codehaus.org/mojo/tags/cassandra-maven-plugin-1.2.0-1@17921

  [ ] +1 Yeah! fire ahead oh and the blind man on the galloping horse
 says it looks fine too.
  [ ] 0 Mehhh! like I care, I don't have any opinions either, I'd
 follow somebody else if only I could decide who
  [ ] -1 No! wait up there I have issues (in general like, ya know,
 and being a trouble-maker is only one of them)

 The vote is open for 72h and will succeed by lazy consensus.

 Guide to testing staged releases:
 http://maven.apache.org/guides/development/guide-testing-releases.html

 Cheers

 -Stephen

 P.S.
  In the interest of ensuring (more is) better testing, and as is now
 tradition for Mojo's Cassandra Maven Plugin, this vote is
 also open to any subscribers of the dev and user@cassandra.apache.org
 javascript:_e({},%20'cvml',%20'user@cassandra.apache.org');

 mailing lists that want to test or use this plugin.