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

thrift column definition list sometimes immutable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1.3
    • None
    • None
    • Normal

    Description

      When the input cf_def.column_metadata is null, ColumnDefinition.fromThrift can return Collections.emptyList() (which is defined to be an immutable list)

      One caller, CFMetaData.internalFromThrift , incorrectly assumes that this list will always be mutable and tries to add to this immutable list, which causes the Cassandra server to throw an exception.

      It looks like this is a bug in 2.1, but not in trunk.
      I can include my one-liner patch, but I'm not sure whether it is better to fix the caller (to not assume random lists you get back from a method are mutable) or the callee (to always return a mutable list).

      Attachments

        1. cassandra-2.1.2-8695.patch
          1 kB
          Chris Lockfort

        Activity

          People

            clockfort Chris Lockfort
            clockfort Chris Lockfort
            Chris Lockfort
            Aleksey Yeschenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: