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

Better config validation/documentation

    XMLWordPrintableJSON

Details

    • Low

    Description

      There are a number of properties in the yaml that are "in_mb", however resolve to bytes when calculated in DatabaseDescriptor.java, but are stored in int's. This means that their maximum values are 2047, as any higher when converted to bytes overflows the int.

      Where possible/reasonable we should convert these to be long's, and stored as long's. If there is no reason for the value to ever be >2047 we should at least document that as the max value, or better yet make it error if set higher than that. Noting that although it's bad practice to increase a lot of them to such high values, there may be cases where it is necessary and in which case we should handle it appropriately rather than overflowing and surprising the user. That is, causing it to break but not in the way the user expected it to

      Following are functions that currently could be at risk of the above:

      DatabaseDescriptor.java
      getThriftFramedTransportSize()
      getMaxValueSize()
      getCompactionLargePartitionWarningThreshold()
      getCommitLogSegmentSize()
      getNativeTransportMaxFrameSize()
      # These are in KB so max value of 2096128
      getBatchSizeWarnThreshold()
      getColumnIndexSize()
      getColumnIndexCacheSize()
      getMaxMutationSize()
      

      Note we may not actually need to fix all of these, and there may be more. This was just from a rough scan over the code.

      Attachments

        Issue Links

          Activity

            People

              jasonstack Zhao Yang
              KurtG Kurt Greaves
              Zhao Yang
              Kurt Greaves
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: