Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10584

reads with EACH_QUORUM on keyspace with SimpleTopologyStrategy throw a ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 3.0.0
    • Component/s: Legacy/CQL
    • Labels:
      None

      Description

      I think this may be a regression introduced w/ CASSANDRA-9602. Starting with C* 3.0.0-rc2 an error is returned when querying a keyspace with SimpleTopologyStrategy using EACH_QUORUM CL:

      cqlsh> create keyspace test with replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      cqlsh> create table test.test (k int PRIMARY KEY, i int);
      cqlsh> consistency EACH_QUORUM;
      Consistency level set to EACH_QUORUM.
      cqlsh> select * from test.test;
      ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.ClassCastException: org.apache.cassandra.locator.SimpleStrategy cannot be cast to org.apache.cassandra.locator.NetworkTopologyStrategy">
      

      The exception yielded in the system logs:

      ERROR [SharedPool-Worker-1] 2015-10-23 13:02:15,405 ErrorMessage.java:336 - Unexpected exception during request
      java.lang.ClassCastException: org.apache.cassandra.locator.SimpleStrategy cannot be cast to org.apache.cassandra.locator.NetworkTopologyStrategy
              at org.apache.cassandra.db.ConsistencyLevel.filterForEachQuorum(ConsistencyLevel.java:227) ~[main/:na]
              at org.apache.cassandra.db.ConsistencyLevel.filterForQuery(ConsistencyLevel.java:188) ~[main/:na]
              at org.apache.cassandra.db.ConsistencyLevel.filterForQuery(ConsistencyLevel.java:180) ~[main/:na]
              at org.apache.cassandra.service.StorageProxy$RangeIterator.computeNext(StorageProxy.java:1795) ~[main/:na]
              at org.apache.cassandra.service.StorageProxy$RangeIterator.computeNext(StorageProxy.java:1762) ~[main/:na]
              at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[main/:na]
              at com.google.common.collect.Iterators$PeekingImpl.hasNext(Iterators.java:1149) ~[guava-18.0.jar:na]
              at org.apache.cassandra.service.StorageProxy$RangeMerger.computeNext(StorageProxy.java:1814) ~[main/:na]
              at org.apache.cassandra.service.StorageProxy$RangeMerger.computeNext(StorageProxy.java:1799) ~[main/:na]
              at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[main/:na]
              at org.apache.cassandra.service.StorageProxy$RangeCommandIterator.computeNext(StorageProxy.java:1925) ~[main/:na]
              at org.apache.cassandra.service.StorageProxy$RangeCommandIterator.computeNext(StorageProxy.java:1892) ~[main/:na]
              at org.apache.cassandra.utils.AbstractIterator.hasNext(AbstractIterator.java:47) ~[main/:na]
              at org.apache.cassandra.db.partitions.WrappingPartitionIterator.hasNext(WrappingPartitionIterator.java:33) ~[main/:na]
              at org.apache.cassandra.db.partitions.CountingPartitionIterator.hasNext(CountingPartitionIterator.java:49) ~[main/:na]
              at org.apache.cassandra.db.partitions.WrappingPartitionIterator.hasNext(WrappingPartitionIterator.java:33) ~[main/:na]
              at org.apache.cassandra.db.partitions.CountingPartitionIterator.hasNext(CountingPartitionIterator.java:49) ~[main/:na]
              at org.apache.cassandra.service.pager.AbstractQueryPager$PagerIterator.hasNext(AbstractQueryPager.java:99) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:610) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:371) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:327) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:213) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:76) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:205) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:236) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:221) ~[main/:na]
              at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115) ~[main/:na]
              at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507) [main/:na]
              at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401) [main/:na]
              at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.23.Final.jar:4.0.23.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]
              at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32) [netty-all-4.0.23.Final.jar:4.0.23.Final]
              at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324) [netty-all-4.0.23.Final.jar:4.0.23.Final]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
              at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164) [main/:na]
              at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [main/:na]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
      

      On 3.0.0-rc1 we get an invalid query error back instead (as expected with prior to CASSANDRA-9602):

      InvalidRequest: code=2200 [Invalid query] message="EACH_QUORUM ConsistencyLevel is only supported for writes"
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                carlyeks Carl Yeksigian
                Reporter:
                andrew.tolbert Andy Tolbert
                Authors:
                Carl Yeksigian
                Reviewers:
                Ariel Weisberg
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: