Cassandra
  1. Cassandra
  2. CASSANDRA-4555

select statement with indexed column causes node to OOM

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      MAC OSx

      Description

      After creating a keyspace, table and index on a clean ccm 3 node cluster based on trunk, when a select statement with an index expression is executed in cqlsh one of the nodes OOM's and goes down.

      The steps to reproduce the problem are:

      create a 3 node cluster from trunk (I used ccm)

      execute the following statements in cqlsh:

      CREATE KEYSPACE trace WITH strategy_class = 'SimpleStrategy'
        AND strategy_options:replication_factor = '1';
      
      CREATE TABLE trace.trace_events(sessionId  timeuuid,
        coordinator       inet,
        eventId           timeuuid,
        description       text,
        duration          bigint,
        happened_at       timestamp,
        name              text,
        payload_types     map<text, text>,
        payload           map<text, blob>,
        source            inet,
        type              text,
        PRIMARY KEY (sessionId, coordinator, eventId));
      
      CREATE INDEX idx_name ON trace.trace_events (name);
      

      Executing the following statement causes node2 to OOM:

      select * from trace_events where name = 'batch_mutate';

      In my case node2 goes down with:

      ERROR [Thread-9] 2012-08-17 19:42:55,741 CassandraDaemon.java (line 131) Exception in thread Thread[Thread-9,5,main]
      java.lang.OutOfMemoryError: Java heap space
      	at org.apache.cassandra.dht.Token$TokenSerializer.deserialize(Token.java:97)
      	at org.apache.cassandra.dht.AbstractBounds$AbstractBoundsSerializer.deserialize(AbstractBounds.java:161)
      	at org.apache.cassandra.db.RangeSliceCommandSerializer.deserialize(RangeSliceCommand.java:299)
      	at org.apache.cassandra.db.RangeSliceCommandSerializer.deserialize(RangeSliceCommand.java:181)
      	at org.apache.cassandra.net.MessageIn.read(MessageIn.java:94)
      	at org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:181)
      	at org.apache.cassandra.net.IncomingTcpConnection.handleModernVersion(IncomingTcpConnection.java:122)
      	at org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:69)
       INFO [StorageServiceShutdownHook] 2012-08-17 19:42:55,746 ThriftServer.java (line 221) Stop listening to thrift clients
       INFO [StorageServiceShutdownHook] 2012-08-17 19:42:55,748 Gossiper.java (line 1054) Announcing shutdown
       INFO [StorageServiceShutdownHook] 2012-08-17 19:42:56,749 MessagingService.java (line 657) Waiting for messaging service to quiesce
       INFO [ACCEPT-/127.0.0.2] 2012-08-17 19:42:56,751 MessagingService.java (line 849) MessagingService shutting down server thread.
      
      1. 4555.txt
        3 kB
        Jonathan Ellis

        Activity

        Hide
        Jonathan Ellis added a comment -

        committed

        Show
        Jonathan Ellis added a comment - committed
        Hide
        David Alves added a comment -

        +1 applies cleanly and solves the problem.

        Show
        David Alves added a comment - +1 applies cleanly and solves the problem.
        Hide
        Jonathan Ellis added a comment -

        patch to make de/serializers agree to use a short length for index expression value, and to add validation that client-provided expressions do conform to this limitation

        Show
        Jonathan Ellis added a comment - patch to make de/serializers agree to use a short length for index expression value, and to add validation that client-provided expressions do conform to this limitation
        Hide
        David Alves added a comment -

        With and without data. It OOMs because it tries to allocate a huge byte[] on TokenSerializer.deserialize().

        Show
        David Alves added a comment - With and without data. It OOMs because it tries to allocate a huge byte[] on TokenSerializer.deserialize().
        Hide
        Jonathan Ellis added a comment -

        It OOMs with no data in it at all?

        Show
        Jonathan Ellis added a comment - It OOMs with no data in it at all?

          People

          • Assignee:
            Jonathan Ellis
            Reporter:
            David Alves
            Reviewer:
            David Alves
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development