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

Collection size overflow not handled in CQL3 binary protocol responses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Duplicate
    • None
    • None
    • None
    • Low

    Description

      In the binary/native protocol collection sizes are specified with an unsigned int, but it's still possible to create collections larger than 2^16 items. When the client asks for a row with a collection that is bigger than this the collection size field overflows and the client will see an inconsistent size. If the collection size is 2^16 + 1 the client will see a size of 1.

      All of the items in the collection are actually in the response, and the frame is still correct, it's just that a client that interprets the protocol strictly will not see them (I don't know how the Java CQL3 driver handles this, but my reading of the spec for the Ruby driver I'm writing means that I can't read those values without going outside of the spec).

      I don't know exactly what the correct thing to do is. The way it works now leads to weird results (getting only one item when the collection is 2^16 + 1), and getting only the first 2^16 items may be less surprising.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              iconara Theo Hultberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: