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

Incorrect error type on oversized compound partition key

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage Needed
    • Normal
    • Resolution: Unresolved
    • 4.0.x, 4.1.x
    • None
    • None
    • All
    • None

    Description

      Cassandra limits key lengths (partition and clustering) to 64 KB. If a user attempts to INSERT data with a partition key or clustering key exceeding that size, the result is a clear InvalidRequest error with a message like "Key length of 66560 is longer than maximum of 65535".

      There is one exception: If you have a compound partition key (i.e., two or more partition key components) and attempt to write one of them larger than 64 KB, then instead of an orderly InvalidRequest like you got when there was just one component, now you get a NoHostAvailable  with the message: "error("'H' format requires 0 <= number <= 65535")})". This is not only uglier, it can also confuse the Cassandra driver to retry this request - because it doesn't realize that the request itself is broken and there is no point to repeat it.

      Interestingly, if there are multiple clustering key columns, this problem doesn't happen: we still get a nice InvalidRequest if any one of these is more than 64 KB.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nyh Nadav Har'El
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: