cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Suteu (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6458) nodetool getendpoints doesn't validate key arity
Date Tue, 10 Jun 2014 08:55:02 GMT


Mihai Suteu commented on CASSANDRA-6458:

I started working on this issue, but would like to have some feedback on how to proceed. I
am quite new to Cassandra and might be making some wrong assumptions about it's internals.
In order for NodeTool to check the arity, it has to get the number of columns in the partition
key of a cf. As far as I understand it, I would have to get that from CFMetaData.
The problem is that NodeTool can only connect through NodeProbe, which has the proxies for
the MBeans.
The closest I got was through the StorageServerProxy and ColumnFamilyStore proxy, but none
of them specify a method in their interface to access a cfMetaData.

The options I see so far are to either add a method to ColumnFamilyStoreMBean or try to validate
the key arity somewhere lower.

Or is there an easier way?


> nodetool getendpoints doesn't validate key arity 
> -------------------------------------------------
>                 Key: CASSANDRA-6458
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Daneel Yaitskov
>            Priority: Trivial
>              Labels: lhf
> I have a complex row key.
> $ create table b (x int, s text, ((x,s)) primary key);
> In cqlsh I cannot fill row key partially:
> {noformat}
> $ insert into b (x) values(4);
> Bad Request: Missing mandatory PRIMARY KEY part s
> {noformat}
> But nodetool can find hosts by incomplete key
> {noformat}
> $ nodetool -h cas3 getendpoints anti_portal b 12
> {noformat}
> No error is reported.
> I found that columns are separated by ":".
> And If I pass to many elements then the error happens.
> {noformat}
> $ nodetool -h cas3 getendpoints anit_portal b 12:dd:dd
> Exception in thread "main" org.apache.cassandra.serializers.MarshalException: unable
to make int from '12:dd:dd'
>     at org.apache.cassandra.db.marshal.Int32Type.fromString(
>     at org.apache.cassandra.service.StorageService.getNaturalEndpoints(
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>     at java.lang.reflect.Method.invoke(
>     at sun.reflect.misc.Trampoline.invoke(
>     at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>     at java.lang.reflect.Method.invoke(
>     at sun.reflect.misc.MethodUtil.invoke(
>     at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(
>     at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(
>     at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(
>     at com.sun.jmx.mbeanserver.PerInterface.invoke(
>     at com.sun.jmx.mbeanserver.MBeanSupport.invoke(
>     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(
>     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(
>     at
>     at$300(
>     at$
>     at
>     at
>     at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>     at java.lang.reflect.Method.invoke(
>     at sun.rmi.server.UnicastServerRef.dispatch(
>     at sun.rmi.transport.Transport$
>     at sun.rmi.transport.Transport$
>     at Method)
>     at sun.rmi.transport.Transport.serviceCall(
>     at sun.rmi.transport.tcp.TCPTransport.handleMessages(
>     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
>     at sun.rmi.transport.tcp.TCPTransport$
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(
>     at java.util.concurrent.ThreadPoolExecutor$
>     at
> Caused by: java.lang.NumberFormatException: For input string: "12:dd:dd"
>     at java.lang.NumberFormatException.forInputString(
>     at java.lang.Integer.parseInt(
>     at java.lang.Integer.parseInt(
>     at org.apache.cassandra.db.marshal.Int32Type.fromString(
>     ... 36 more
> {noformat}
> I think showing huge stack trace is not proper behavior.
> Error message should be printer if arity of passed key and table key are not equal.

This message was sent by Atlassian JIRA

View raw message