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

Transient Replication: unable to insert data when the keyspace is configured with the SimpleStrategy

    XMLWordPrintableJSON

Details

    • Code - Bug - Unclear Impact
    • Normal
    • Normal
    • User Report
    • All
    • None
    • Hide

      Test added/modified in as part of the patch..

      Show
      Test added/modified in as part of the patch..

    Description

      An error is thrown then trying to insert data with the transient replication + SimpleStrategy configured.

      Test case:

      CREATE KEYSPACE test_tr WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3/1'};
      CREATE TABLE test_tr.users (id int PRIMARY KEY, username text) with read_repair ='NONE';
      INSERT INTO test_tr.users (id, username) VALUES (1, 'alan');

       

      traceback:

      ERROR [Native-Transport-Requests-8] 2020-03-27 10:27:17,188 ErrorMessage.java:450 - 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.eachQuorumForRead(ConsistencyLevel.java:103)
      	at org.apache.cassandra.db.ConsistencyLevel.eachQuorumForWrite(ConsistencyLevel.java:112)
      	at org.apache.cassandra.locator.ReplicaPlans$2.select(ReplicaPlans.java:409)
      	at org.apache.cassandra.locator.ReplicaPlans.forWrite(ReplicaPlans.java:353)
      	at org.apache.cassandra.locator.ReplicaPlans.forWrite(ReplicaPlans.java:348)
      	at org.apache.cassandra.locator.ReplicaPlans.forWrite(ReplicaPlans.java:341)
      	at org.apache.cassandra.locator.ReplicaPlans.forWrite(ReplicaPlans.java:330)
      	at org.apache.cassandra.service.StorageProxy.performWrite(StorageProxy.java:1171)
      	at org.apache.cassandra.service.StorageProxy.mutate(StorageProxy.java:713)
      	at org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:951)
      	at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:475)
      	at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:453)
      	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:216)
      	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:247)
      	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:233)
      	at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:108)
      	at org.apache.cassandra.transport.Message$Request.execute(Message.java:253)
      	at org.apache.cassandra.transport.Message$Dispatcher.processRequest(Message.java:725)
      	at org.apache.cassandra.transport.Message$Dispatcher.lambda$channelRead0$0(Message.java:630)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:165)
      	at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:119)
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      	at java.lang.Thread.run(Thread.java:748)
       

       

      --> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/ConsistencyLevel.java#L103

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aboudreault Alan Boudreault
              Francisco Fernandez
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m