You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by mcasandra <mo...@gmail.com> on 2011/02/15 00:55:01 UTC

Internal error processing insert

I am following example posted on 
http://www.datastax.com/dev/tutorials/getting_started_0.7/using_cli#cassandra-cli
cli 

I am seeing:

$ set users['jsmith']['password']='ch@ngem3';
Internal error processing insert

In the logs I see:

java.lang.AssertionError: invalid response count 1 for replication factor 0
        at
org.apache.cassandra.service.WriteResponseHandler.determineBlockFor(WriteResponseHandler.java:98)
        at
org.apache.cassandra.service.WriteResponseHandler.<init>(WriteResponseHandler.java:48)
        at
org.apache.cassandra.service.WriteResponseHandler.create(WriteResponseHandler.java:61)
        at
org.apache.cassandra.locator.AbstractReplicationStrategy.getWriteResponseHandler(AbstractReplicationStrategy.java:125)
        at
org.apache.cassandra.locator.NetworkTopologyStrategy.getWriteResponseHandler(NetworkTopologyStrategy.java:165)

--

My guess is because I am using network topology as specified in the example.
Is that correct?

What's the best way to fix the problem?
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025740.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by Matthew Dennis <md...@datastax.com>.
On Mon, Feb 14, 2011 at 6:28 PM, Aaron Morton <aa...@thelastpickle.com>wrote:

> Will take a closer look at the code tonight, perhaps we should return an
> error if you try to using Network Topology it cannot detect any DC's .
>
>
+1

Re: Internal error processing insert

Posted by Eric Gilmore <er...@datastax.com>.
For now, I have committed a change in the misleading documentation,
substituting SimpleStrategy for NTS.

Sorry you ran into trouble due to that, mcasandra.

On Mon, Feb 14, 2011 at 4:28 PM, Aaron Morton <aa...@thelastpickle.com>wrote:

> Will take a closer look at the code tonight, perhaps we should return an
> error if you try to using Network Topology it cannot detect any DC's .
>
> Cheers
> Aaron
>
>
> On 15 Feb, 2011,at 01:22 PM, mcasandra <mo...@gmail.com> wrote:
>
>
> That's what I thought might be happening since network topology will try to
> find one node on the other data center. Message is little confusing though.
>
> [default@unknown] update keyspace twissandra
> placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
> Syntax error at position 28: missing EOF at 'placement_strategy'
> [default@unknown] update keyspace twissandra with
> placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
> 5c487967-3899-11e0-993f-b7fa7ed61af9
> [default@unknown] use twissandra
> ... ;
> Authenticated to keyspace: twissandra
> [default@twissandra] set users['jsmith']['password']='ch@ngem3';
> Value inserted.
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025813.html<http://cassandra-user-incubator-apache-org.3065146.n2.nabblecom/Internal-error-processing-insert-tp6025740p6025813.html>
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
> Nabble.com.
>
>

Re: Internal error processing insert

Posted by Matthew Dennis <md...@datastax.com>.
I had actually meant to (and thought I did) type "greater than zero and less
than *or equal* to number of nodes".

That being said, you usually do want it less than the number of nodes in the
cluster because otherwise your cluster essentially has the same performance
as a single node.  In general (fuzzy) performance is num_nodes / RF.  If you
have 9 nodes and RF=3 you have performance roughly along the lines of having
3 boxen.  If you have N nodes and RF=N, you have roughly the same
performance as... one machine.

What Arron says about RF and Consistency Level (CL) is also correct.  RF=2
implies CL.Q requires both nodes meaning you can't lose a single node and
still read/write at CL.Q

Just to be pedantic though, you have have a cluster of N nodes (for large N)
and read/write at CL.Q even after losing some nodes.  For example, if you
have 10 nodes and RF=10 you only need 6 nodes up to read/write at CL.Q

On Mon, Feb 14, 2011 at 6:58 PM, Aaron Morton <aa...@thelastpickle.com>wrote:

> He probably meant in production. When playing around, and if you only have
> 2 nodes, you can set it to 2.
>
> From memory RF of 2 means the Quorum is also 2, so you cannot afford to
> lose one. Thats fine for playing.
>
> Aaron
>
>
> On 15 Feb, 2011,at 01:51 PM, mcasandra <mo...@gmail.com> wrote:
>
>
>
> mcasandra wrote:
> >
> > In earlier post same thread you mentioned that replication factor should
> > be set to less than N.
> >
> > Currently I am testing on 2 node cluster and I was able to set
> > replication_factor to 2 (=N) and also when I did cfstats (I don't quite
> > understand cfstats in detail) and see some activity on both nodes now
> >
> > [default@twissandra] update keyspace twissandra with
> replication_factor=2;
> > 3ed6b708-389b-11e0-993f-b7fa7ed61af9
> > [default@twissandra] set users['b']['add']='111';
> > Value inserted.
> >
> > On the other node when I ran nodetool with -h as localhost, I see:
> >
> >
> > Column Family: users
> > SSTable count: 0
> > Space used (live): 0
> > Space used (total): 0
> > Memtable Columns Count: 2
> > Memtable Data Size: 52
> > Memtable Switch Count: 0
> > Read Count: 3
> > Read Latency: NaN ms.
> > Write Count: 2
> > Write Latency: NaN ms.
> > Pending Tasks: 0
> > Key cache capacity: 200000
> > Key cache size: 0
> > Key cache hit rate: NaN
> > Row cache: disabled
> > Compacted row minimum size: 0
> > Compacted row maximum size: 0
> > Compacted row mean size: 0
> >
> >
> Sorry I meant to say someone (Matthew Dennis) on the thread mentioned that
> replication factor should be less than no. of nodes.
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025882.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
> Nabble.com.
>
>

Re: Internal error processing insert

Posted by Aaron Morton <aa...@thelastpickle.com>.
He probably meant in production. When playing around, and if you only have 2 nodes, you can set it to 2. 

From memory RF of 2 means the Quorum is also 2, so you cannot afford to lose one. Thats fine for playing. 

Aaron
 

On 15 Feb, 2011,at 01:51 PM, mcasandra <mo...@gmail.com> wrote:



mcasandra wrote:
> 
> In earlier post same thread you mentioned that replication factor should
> be set to less than N.
> 
> Currently I am testing on 2 node cluster and I was able to set
> replication_factor to 2 (=N) and also when I did cfstats (I don't quite
> understand cfstats in detail) and see some activity on both nodes now.
> 
> [default@twissandra] update keyspace twissandra with replication_factor=2;
> 3ed6b708-389b-11e0-993f-b7fa7ed61af9
> [default@twissandra] set users['b']['add']='111';
> Value inserted.
> 
> On the other node when I ran nodetool with -h as localhost, I see:
> 
> 
> Column Family: users
> SSTable count: 0
> Space used (live): 0
> Space used (total): 0
> Memtable Columns Count: 2
> Memtable Data Size: 52
> Memtable Switch Count: 0
> Read Count: 3
> Read Latency: NaN ms.
> Write Count: 2
> Write Latency: NaN ms.
> Pending Tasks: 0
> Key cache capacity: 200000
> Key cache size: 0
> Key cache hit rate: NaN
> Row cache: disabled
> Compacted row minimum size: 0
> Compacted row maximum size: 0
> Compacted row mean size: 0
> 
> 
Sorry I meant to say someone (Matthew Dennis) on the thread mentioned that
replication factor should be less than no. of nodes.
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025882.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by mcasandra <mo...@gmail.com>.

mcasandra wrote:
> 
> In earlier post same thread you mentioned that replication factor should
> be set to less than N.
> 
> Currently I am testing on 2 node cluster and I was able to set
> replication_factor to 2 (=N) and also when I did cfstats (I don't quite
> understand cfstats in detail) and see some activity on both nodes now.
> 
> [default@twissandra] update keyspace twissandra with replication_factor=2;
> 3ed6b708-389b-11e0-993f-b7fa7ed61af9
> [default@twissandra] set users['b']['add']='111';
> Value inserted.
> 
> On the other node when I ran nodetool with -h as localhost, I see:
> 
> 
>                 Column Family: users
>                 SSTable count: 0
>                 Space used (live): 0
>                 Space used (total): 0
>                 Memtable Columns Count: 2
>                 Memtable Data Size: 52
>                 Memtable Switch Count: 0
>                 Read Count: 3
>                 Read Latency: NaN ms.
>                 Write Count: 2
>                 Write Latency: NaN ms.
>                 Pending Tasks: 0
>                 Key cache capacity: 200000
>                 Key cache size: 0
>                 Key cache hit rate: NaN
>                 Row cache: disabled
>                 Compacted row minimum size: 0
>                 Compacted row maximum size: 0
>                 Compacted row mean size: 0
> 
> 
Sorry I meant to say someone (Matthew Dennis) on the thread mentioned that
replication factor should be less than no. of nodes.
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025882.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by mcasandra <mo...@gmail.com>.
In earlier post same thread you mentioned that replication factor should be
set to less than N.

Currently I am testing on 2 node cluster and I was able to set
replication_factor to 2 (=N) and also when I did cfstats (I don't quite
understand cfstats in detail) and see some activity on both nodes now.

[default@twissandra] update keyspace twissandra with replication_factor=2;
3ed6b708-389b-11e0-993f-b7fa7ed61af9
[default@twissandra] set users['b']['add']='111';
Value inserted.

On the other node when I ran nodetool with -h as localhost, I see:


                Column Family: users
                SSTable count: 0
                Space used (live): 0
                Space used (total): 0
                Memtable Columns Count: 2
                Memtable Data Size: 52
                Memtable Switch Count: 0
                Read Count: 3
                Read Latency: NaN ms.
                Write Count: 2
                Write Latency: NaN ms.
                Pending Tasks: 0
                Key cache capacity: 200000
                Key cache size: 0
                Key cache hit rate: NaN
                Row cache: disabled
                Compacted row minimum size: 0
                Compacted row maximum size: 0
                Compacted row mean size: 0

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025878.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by Aaron Morton <aa...@thelastpickle.com>.
Will take a closer look at the code tonight, perhaps we should return an error if you try to using Network Topology it cannot detect any DC's . 

Cheers
Aaron
 

On 15 Feb, 2011,at 01:22 PM, mcasandra <mo...@gmail.com> wrote:


That's what I thought might be happening since network topology will try to
find one node on the other data center. Message is little confusing though.

[default@unknown] update keyspace twissandra 
placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
Syntax error at position 28: missing EOF at 'placement_strategy'
[default@unknown] update keyspace twissandra with
placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
5c487967-3899-11e0-993f-b7fa7ed61af9
[default@unknown] use twissandra
... ;
Authenticated to keyspace: twissandra
[default@twissandra] set users['jsmith']['password']='ch@ngem3';
Value inserted.

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025813.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by mcasandra <mo...@gmail.com>.
That's what I thought might be happening since network topology will try to
find one node on the other data center. Message is little confusing though.

[default@unknown] update keyspace twissandra 
placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
Syntax error at position 28: missing EOF at 'placement_strategy'
[default@unknown]  update keyspace twissandra with
placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
5c487967-3899-11e0-993f-b7fa7ed61af9
[default@unknown] use twissandra
...     ;
Authenticated to keyspace: twissandra
[default@twissandra] set users['jsmith']['password']='ch@ngem3';
Value inserted.

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025813.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by Aaron Morton <aa...@thelastpickle.com>.
Not sure why the docs suggest to use the NetworkTopologyStrategy, if their are no data centres configured the NetworkTopologyStrategy will say the replication factor is 0. I think this is the source of the "invalid response count 1 for replication factor 0"  message. 

Can you try with the SimpleStrategy? 

create keyspace twissandra with replication_factor=1
and placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
Aaron


On 15 Feb, 2011,at 01:02 PM, mcasandra <mo...@gmail.com> wrote:


No it's not set to 0. I am just following the example on datastax getting
started site. Here are all the commands:

[default@unknown] create keyspace twissandra with replication_factor=1
... and
placement_strategy='org.apache.cassandra.locator.NetworkTopologyStrategy';
22dea790-3893-11e0-9174-b7fa7ed61af9
[default@unknown] use twissandra;
Authenticated to keyspace: twissandra
[default@twissandra] create column family users with comparator = UTF8Type
... ... and column_metadata = [{column_name: password,
validation_class:
... .. UTF8Type}];
Syntax error at position 54: missing EOF at '.'
[default@twissandra] create column family users with comparator = UTF8Type
.. and column_metadata = [{column_name: password, validation_class:
UTF8Type}];
5ecbfe61-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family tweets with comparator = UTF8Type
and
... column_metadata = [{column_name: body, validation_class:
... UTF8Type}, {column_name: username, validation_class: UTF8Type}];
b468f492-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family friends with comparator =
UTF8Type;
c08ae1c3-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family followers with comparator =
UTF8Type;
c856bb44-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family userline with comparator =
LongType and
... default_validation_class = TimeUUIDType;
cd9ef725-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family timeline with comparator =
LongType and
... default_validation_class = TimeUUIDType;
d34d6ee6-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] set users['jsmith']['password']='ch@ngem3';
Internal error processing insert

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025762.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabblecom.

Re: Internal error processing insert

Posted by mcasandra <mo...@gmail.com>.
No it's not set to 0. I am just following the example on datastax getting
started site. Here are all the commands:

[default@unknown] create keyspace twissandra with replication_factor=1
...     and
placement_strategy='org.apache.cassandra.locator.NetworkTopologyStrategy';
22dea790-3893-11e0-9174-b7fa7ed61af9
[default@unknown] use twissandra;
Authenticated to keyspace: twissandra
[default@twissandra] create column family users with comparator = UTF8Type
...     ...     and column_metadata = [{column_name: password,
validation_class:
...     ...     UTF8Type}];
Syntax error at position 54: missing EOF at '.'
[default@twissandra] create column family users with comparator = UTF8Type
...     and column_metadata = [{column_name: password, validation_class:
UTF8Type}];
5ecbfe61-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family tweets with comparator = UTF8Type
and
...     column_metadata = [{column_name: body, validation_class:
...     UTF8Type}, {column_name: username, validation_class: UTF8Type}];
b468f492-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family friends with comparator =
UTF8Type;
c08ae1c3-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family followers with comparator =
UTF8Type;
c856bb44-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family userline with comparator =
LongType and
...     default_validation_class = TimeUUIDType;
cd9ef725-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] create column family timeline with comparator =
LongType and
...     default_validation_class = TimeUUIDType;
d34d6ee6-3893-11e0-9174-b7fa7ed61af9
[default@twissandra] set users['jsmith']['password']='ch@ngem3';
Internal error processing insert

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025762.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Internal error processing insert

Posted by Matthew Dennis <md...@datastax.com>.
Is your ReplicationFactor (RF) really set to 0?  Don't do that, it needs to
be at least 1 and probably needs to be 3 in production if you care about
your data.  It must be greater than 0 and less than the number of nodes in
your ring.  It represents the number of nodes to copy/replicate data to.
Another way to look at it is I'm willing to tolerate this many failures
before I lose data.

On Mon, Feb 14, 2011 at 5:55 PM, mcasandra <mo...@gmail.com> wrote:

>
> I am following example posted on
>
> http://www.datastax.com/dev/tutorials/getting_started_0.7/using_cli#cassandra-cli
> cli
>
> I am seeing:
>
> $ set users['jsmith']['password']='ch@ngem3';
> Internal error processing insert
>
> In the logs I see:
>
> java.lang.AssertionError: invalid response count 1 for replication factor 0
>        at
>
> org.apache.cassandra.service.WriteResponseHandler.determineBlockFor(WriteResponseHandler.java:98)
>        at
>
> org.apache.cassandra.service.WriteResponseHandler.<init>(WriteResponseHandler.java:48)
>        at
>
> org.apache.cassandra.service.WriteResponseHandler.create(WriteResponseHandler.java:61)
>        at
>
> org.apache.cassandra.locator.AbstractReplicationStrategy.getWriteResponseHandler(AbstractReplicationStrategy.java:125)
>        at
>
> org.apache.cassandra.locator.NetworkTopologyStrategy.getWriteResponseHandler(NetworkTopologyStrategy.java:165)
>
> --
>
> My guess is because I am using network topology as specified in the
> example.
> Is that correct?
>
> What's the best way to fix the problem?
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Internal-error-processing-insert-tp6025740p6025740.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
> Nabble.com.
>