Re: Delete doesn't remove row key?

2012-02-01 Thread aaron morton
> Second, a followup question: So the row keys will be deleted after 1) the GC 
> grace period expires, and 2) I do a compaction?
Automatic compaction will purge the tombstones. 

> Third: Assuming the answer is yes, is there any way to manually force GC of 
> the deleted keys without doing the full "GC shuffle" (setting the GC grace 
> period artificially low, restarting, compacting, setting grace period back to 
> normal, restarting)?
No. But you do not need to restart. gc_grace_seconds is set per CF and can be 
updated without a restart. 

Cheers

-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 1/02/2012, at 2:32 PM, Todd Fast wrote:

> First, thanks! I'd read that before, but didn't associate doing a range scan 
> with using the CLI, much less doing "select count(*)" in CQL. Now I know what 
> to call the phenomenon.
> 
> Second, a followup question: So the row keys will be deleted after 1) the GC 
> grace period expires, and 2) I do a compaction?
> 
> Third: Assuming the answer is yes, is there any way to manually force GC of 
> the deleted keys without doing the full "GC shuffle" (setting the GC grace 
> period artificially low, restarting, compacting, setting grace period back to 
> normal, restarting)?
> 
> Todd
> 
> On 1/31/2012 5:03 PM, Benjamin Hawkes-Lewis wrote:
>> On Wed, Feb 1, 2012 at 12:58 AM, Todd Fast  wrote:
>>> I added a row with a single column to my 1.0.8 single-node cluster:
>>> 
>>>RowKey: ----
>>>=>  (column=test, value=hi, timestamp=...)
>>> 
>>> I immediately deleted the row using both the CLI and CQL:
>>> 
>>>del Foo[lexicaluuid('----')];
>>>delete from Foo using consistency all where
>>> KEY=----
>>> 
>>> In either case, the column "test" is gone but the empty row key still
>>> remains, and the row count reflects the presence of this phantom row.
>>> 
>>> I've tried nodetool compact/repair/flush/cleanup/scrub/etc. and nothing
>>> removes the row key.
>> http://wiki.apache.org/cassandra/FAQ#range_ghosts
>> 
>> --
>> Benjamin Hawkes-Lewis



Consurrent compactors

2012-02-01 Thread Viktor Jevdokimov
Hi,

When concurrent compactors are set to more then 1, it's rare when more than 1 
compaction is running in parallel.

Didn't checked the source code, but it looks like when next compaction task 
(any of minor, major, or cleanup) is for the same CF, it will not start in 
parallel and next tasks are not checked.

Will it be possible to check all tasks, not only the next one, to find which of 
them can be started?

This is actual especially when nightly cleanup is running, a lot of cleanup 
tasks are pending, regular minor compactions are waiting until all cleanup 
compactions are finished.





Best regards/ Pagarbiai



Viktor Jevdokimov

Senior Developer



Email:  viktor.jevdoki...@adform.com

Phone: +370 5 212 3063. Fax: +370 5 261 0453

J. Jasinskio 16C, LT-01112 Vilnius, Lithuania






[Adform news]

[Visit us!]

Follow:


[twitter]

Visit our blog



Disclaimer: The information contained in this message and attachments is 
intended solely for the attention and use of the named addressee and may be 
confidential. If you are not the intended recipient, you are reminded that the 
information remains the property of the sender. You must not use, disclose, 
distribute, copy, print or rely on this e-mail. If you have received this 
message in error, please contact the sender immediately and irrevocably delete 
this message and any copies.

<><><>

Re: Any tools like phpMyAdmin to see data stored in Cassandra ?

2012-02-01 Thread Alain RODRIGUEZ
If you want to try any others UI to browse your Cassandra data I can
suggest you 2 :

- https://github.com/sebgiroux/Cassandra-Cluster-Admin
- http://code.google.com/p/cassui/

The first one is built to be a phpMyAdmin Like.

Alain

2012/1/31 Brandon Williams 

> On Sun, Jan 29, 2012 at 11:52 PM, Ertio Lew  wrote:
> >
> > On Mon, Jan 30, 2012 at 7:16 AM, Frisch, Michael <
> michael.fri...@nuance.com>
> > wrote:
> >>
> >> OpsCenter?
> >>
> >> http://www.datastax.com/products/opscenter
> >>
> >
> > Thanks, that's a great product but unfortunately doesn't work with
> windows.
>
> Now it does: http://www.datastax.com/products/opscenter/platforms
>
> -Brandon
>


Node down

2012-02-01 Thread Rene Kochen
I have a cluster with seven nodes.

If I run the node-tool ring command on all nodes, I see the following:

Node1 says that node2 is down.
Node 2 says that node1 is down.
All other nodes say that everyone is up.

Is this normal behavior?

I see no network related problems. Also no problems between node1 and node2.
I use Cassandra 0.7.10

Thanks,

Rene


Re: problem with keys returned from multiget_slice

2012-02-01 Thread Ross Black
I just solved it.
It was my mistake with using ByteBuffer.. the array() method returns the
entire array without considering the index offset into the array.
It works using
String rowName =
Charset.forName(UTF_8).decode(entry.getKey()).toString();

Ross


On 1 February 2012 22:42, Ross Black  wrote:

> Hi,
>
> I am trying to get multiget_slice working with the raw thrift client, but
> am having problems interpreting the returned keys.
> I assume I am doing something wrong but figure what.
>
> Here is the test program...
>
> import org.apache.cassandra.thrift.*;
> import org.apache.thrift.protocol.TBinaryProtocol;
> import org.apache.thrift.protocol.TProtocol;
> import org.apache.thrift.transport.TFramedTransport;
> import org.apache.thrift.transport.TSocket;
> import org.apache.thrift.transport.TTransport;
>
> import java.nio.ByteBuffer;
> import java.util.Arrays;
> import java.util.Collections;
> import java.util.List;
> import java.util.Map;
>
> public class TestMultiGet {
>
> private static final String KEYSPACE = "junk";
> private static final String COLUMN_FAMILY = "blah";
>
> public static void main(String[] args) throws Exception {
> TTransport transport = new TFramedTransport(new
> TSocket("localhost", 9160, 30 * 1000));
> transport.open();
> TProtocol protocol = new TBinaryProtocol(transport);
> Cassandra.Client client = new Cassandra.Client(protocol);
>
> ByteBuffer rowKey = ByteBuffer.wrap("row111".getBytes());
> ByteBuffer colKey = ByteBuffer.wrap("BBB".getBytes());
> ByteBuffer value = ByteBuffer.wrap("datadata".getBytes());
> long timestamp = System.currentTimeMillis();
> ColumnParent columnParent = new ColumnParent(COLUMN_FAMILY);
> Column column = new
> Column().setName(colKey).setValue(value).setTimestamp(timestamp);
>
> client.set_keyspace(KEYSPACE);
> client.insert(rowKey, columnParent, column, ConsistencyLevel.ONE);
>
> SlicePredicate predicate = new
> SlicePredicate().setColumn_names(Collections.singletonList(colKey));
> Map> sliceMap =
> client.multiget_slice(Collections.singletonList(rowKey), columnParent,
> predicate, ConsistencyLevel.QUORUM);
> for (Map.Entry> entry :
> sliceMap.entrySet()) {
> byte[] key = entry.getKey().array();
> System.err.println("Row bytes = " + Arrays.toString(key));
> System.err.println("Row = ###\n" + new String(key) + "###");
>
> List columns = entry.getValue();
> for (ColumnOrSuperColumn col : columns) {
> byte[] name = col.getColumn().getName();
> System.err.println("Column = " + new String(name));
> }
> }
> }
> }
>
>
> And here is the output I get when I run it...
> Row bytes = [-128, 1, 0, 2, 0, 0, 0, 14, 109, 117, 108, 116, 105, 103,
> 101, 116, 95, 115, 108, 105, 99, 101, 0, 0, 0, 3, 13, 0, 0, 11, 15, 0, 0,
> 0, 1, 0, 0, 0, 6, 114, 111, 119, 49, 49, 49, 12, 0, 0, 0, 1, 12, 0, 1, 11,
> 0, 1, 0, 0, 0, 3, 66, 66, 66, 11, 0, 2, 0, 0, 0, 8, 100, 97, 116, 97, 100,
> 97, 116, 97, 10, 0, 3, 0, 0, 1, 53, 56, -84, 0, 87, 0, 0, 0]
> Row = ###@row111@BBB@datadata@###
> Column = BBB
>
> where the @ represents unprintable chars.
>
> I assumed that the keys in the returned Map would be the same as the keys
> passed in, but they instead seem to contain the entire result.
> I have tried this with 0.8.x and 1.0.7 with the same result.
>
> Should the returned keys be the same as the requested keys, or do they
> need to be interpreted as some other data structure?
> What do I need to do to fix this?
>
>
> Thanks,
> Ross
>
>


Re: Schedule for CQL 1.1

2012-02-01 Thread Eric Evans
On Wed, Feb 1, 2012 at 5:50 AM, Tamil selvan R.S  wrote:
>  Where to follow the progress of Cassandra CQL development progress and
> release schedule?

We don't have a formal roadmap for this I'm afraid.  Your best bet is
to search the issue tracker for CQL tickets, and follow the list.

At the moment there are 2 branches of development, CQLv2 and CQLv3.

CQLv3 (which will debut in the upcoming 1.1 release) is a significant
departure in a number of important ways, including support for
wide-rows which use the compound column approach to create indexed,
tabular structures from rows.  See
https://issues.apache.org/jira/browse/CASSANDRA-2474 (if you dare) and
https://issues.apache.org/jira/browse/CASSANDRA-3761 for more.

CQLv2 will remain the default for now, and CQLv3 will be available as
a run-time option.  When consensus is that CQLv3 is feature-complete
and ready for production use, it will become the new default, and
CQLv2 will be available as a run-time option for legacy clients (this
isn't expected to happen before 1.2).

Hope this helps.

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu


Re: Consurrent compactors

2012-02-01 Thread aaron morton
(Assuming 1.0* release)
From the comments in cassandra.yaml

# Number of simultaneous compactions to allow, NOT including
# validation "compactions" for anti-entropy repair.  Simultaneous
# compactions can help preserve read performance in a mixed read/write
# workload, by mitigating the tendency of small sstables to accumulate
# during a single long running compactions. The default is usually
# fine and if you experience problems with compaction running too
# slowly or too fast, you should look at
# compaction_throughput_mb_per_sec first.
#
# This setting has no effect on LeveledCompactionStrategy.
#
# concurrent_compactors defaults to the number of cores.
# Uncomment to make compaction mono-threaded, the pre-0.8 default.
#concurrent_compactors: 1

If you set it to 1 then only 1 compaction should run at a time, excluding 
validation. 

How often do you run a cleanup compaction ? They are only necessary when you 
perform a token move.

Cheers

-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 1/02/2012, at 9:48 PM, Viktor Jevdokimov wrote:

> Hi,
>  
> When concurrent compactors are set to more then 1, it’s rare when more than 1 
> compaction is running in parallel.
>  
> Didn’t checked the source code, but it looks like when next compaction task 
> (any of minor, major, or cleanup) is for the same CF, it will not start in 
> parallel and next tasks are not checked.
>  
> Will it be possible to check all tasks, not only the next one, to find which 
> of them can be started?
>  
> This is actual especially when nightly cleanup is running, a lot of cleanup 
> tasks are pending, regular minor compactions are waiting until all cleanup 
> compactions are finished.
>  
>  
>  
> Best regards/ Pagarbiai
>  
> Viktor Jevdokimov
> Senior Developer
>  
> Email:  viktor.jevdoki...@adform.com
> Phone: +370 5 212 3063. Fax: +370 5 261 0453
> J. Jasinskio 16C, LT-01112 Vilnius, Lithuania
>  
>  
> 
> 
> 
> Follow:
> 
> 
> Visit our blog
> 
> Disclaimer: The information contained in this message and attachments is 
> intended solely for the attention and use of the named addressee and may be 
> confidential. If you are not the intended recipient, you are reminded that 
> the information remains the property of the sender. You must not use, 
> disclose, distribute, copy, print or rely on this e-mail. If you have 
> received this message in error, please contact the sender immediately and 
> irrevocably delete this message and any copies.
> 
> 



Queries on AuthN and AuthZ for multi tenant Cassandra

2012-02-01 Thread Subrahmanya Harve
We are using Cassandra 0.8.7 and building a multi-tenant cassandra platform
where we have a common KS and common CFs for all tenants. By using Hector's
virtual keyspaces, we are able to add modify rowkeys to have a tenant
specific id. (Note that we do not allow tenants to modify/create KS/CF. We
just allow tenants to write and read data) However we are in the process of
adding authentication and authorization on top of this platform such that
no tenant should be able to retrieve data belonging to any other tenant.

By configuring Cassandra for security using the documentation here -
http://www.datastax.com/docs/0.8/configuration/authentication , we were
able to apply the security constraints on the common keyspace and common
CFs. However this does not prevent a tenant from retrieving data belonging
to another tenant. For this to happen, we would need to have separate CFs
and/or keyspaces for each tenant.
Looking for more information on the topic here
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Re-Multi-tenancy-and-authentication-and-authorization-td5935230.htmland
other places, it looks like the recommendation is "not" to create
separate CFs and KSs for every tenant as this would have impacts on
Memtables and other memory issues. Does this recommendation still hold
good?
With jiras like
https://issues.apache.org/jira/browse/CASSANDRA-2006resolved, does it
mean we can now create multiple (but limited) CFs and KSs?
More generally, how do we prevent a tenant from intentional/accidental data
manipulation of data owned by another tenant? (given that all tenants will
provide the right credentials)


Re: Node down

2012-02-01 Thread aaron morton
Without knowing too much more information I would try this…

* Restart node each node in turn, watch the logs to see what it says about the 
other. 
* If that restart did not fix it, try using the  
Dcassandra.load_ring_state=false JVM option when starting the node. That will 
tell it to ignore it's stored ring view and use what gossip is telling it. Add 
it as a new line at the bottom of cassandra-env.sh. 

If it's still failing watch the logs and see what it says when it marks the 
other as been down. 

Cheers


-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 1/02/2012, at 11:12 PM, Rene Kochen wrote:

> I have a cluster with seven nodes.
>  
> If I run the node-tool ring command on all nodes, I see the following:
>  
> Node1 says that node2 is down.
> Node 2 says that node1 is down.
> All other nodes say that everyone is up.
>  
> Is this normal behavior?
>  
> I see no network related problems. Also no problems between node1 and node2.
> I use Cassandra 0.7.10
>  
> Thanks,
>  
> Rene



read-repair?

2012-02-01 Thread Guy Incognito

how does read repair work in the following scenario?

i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, 
eg a timed-out write at quorum) node 1 has a 'new' version of the 
row/column (eg clock = 10), but node 2 and 3 have 'old' versions (clock 
= 5), when i try to read my row/column at quorum, what do i get back?


do i get the clock 5 version because that is what the quorum agrees on, 
and then read-repair kicks in and nodes 2 and 3 are updated to clock 10 
so a subsequent read returns clock 10?  or are nodes 2 and 3 updated to 
clock 10 first, and i get the clock 10 version on the initial read?


Re: read-repair?

2012-02-01 Thread Peter Schuller
> i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, eg
> a timed-out write at quorum) node 1 has a 'new' version of the row/column
> (eg clock = 10), but node 2 and 3 have 'old' versions (clock = 5), when i
> try to read my row/column at quorum, what do i get back?

You either get back the new version or the old version, depending on
whether node 1 was participated in the read. In your scenario, the
prevoius write at quorum failed (since it only made it to one node),
so this is not a violation of the contract.

Once node 2 and/or 3 return their response, read repair (if it is
active) will cause re-read and re-conciliation followed by a row
mutation being send to the nodes to correct the column.

> do i get the clock 5 version because that is what the quorum agrees on, and

No; a quorum of node is waited for, and the newest column wins. This
accomplish the reads-see-write invariant.

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)


Re: read-repair?

2012-02-01 Thread Mr.Quintero


Peter Schuller  wrote:

>> i have RF=3, my row/column lives on 3 nodes right?  if (for some reason, eg
>> a timed-out write at quorum) node 1 has a 'new' version of the row/column
>> (eg clock = 10), but node 2 and 3 have 'old' versions (clock = 5), when i
>> try to read my row/column at quorum, what do i get back?
>
>You either get back the new version or the old version, depending on
>whether node 1 was participated in the read. In your scenario, the
>prevoius write at quorum failed (since it only made it to one node),
>so this is not a violation of the contract.
>
>Once node 2 and/or 3 return their response, read repair (if it is
>active) will cause re-read and re-conciliation followed by a row
>mutation being send to the nodes to correct the column.
>
>> do i get the clock 5 version because that is what the quorum agrees on, and
>
>No; a quorum of node is waited for, and the newest column wins. This
>accomplish the reads-see-write invariant.
>
>-- 
>/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)


Cluster Cloning

2012-02-01 Thread Hefeng Yuan
Hi, 

We need clone the data between 2 clusters. These 2 clusters have different 
number of nodes.

source: 6 nodes, RF5
destination: 3 nodes, RF3

Cassandra version is 0.8.1. 

Is there any suggestion on how to do this? 

-- 
Thanks,
Hefeng