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

Make 0 work as 0+unit for all three config classes (DataStorageSpec, DurationSpec, DataRateSpec)

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Normal
    • Resolution: Unresolved
    • 4.1.x, 5.0.x, 5.x
    • Local/Config
    • None
    • Low Hanging Fruit
    • All
    • None

    Description

      The inline docs say:

      Setting this to 0 disables throttling.
      

      However, on startup, we throw this error:

      Caused by: java.lang.IllegalArgumentException: Invalid data rate: 0 Accepted units: MiB/s, KiB/s, B/s where case matters and only non-negative values a>
      Apr 23 23:12:01 cassandra0 cassandra[3424]:         at org.apache.cassandra.config.DataRateSpec.<init>(DataRateSpec.java:52)
      Apr 23 23:12:01 cassandra0 cassandra[3424]:         at org.apache.cassandra.config.DataRateSpec.<init>(DataRateSpec.java:61)
      Apr 23 23:12:01 cassandra0 cassandra[3424]:         at org.apache.cassandra.config.DataRateSpec$LongBytesPerSecondBound.<init>(DataRateSpec.java:232)
      Apr 23 23:12:01 cassandra0 cassandra[3424]:         ... 27 common frames omitted
      

      We should allow 0 without a unit attached for data, duration, and data spec config parameters, as 0 is always 0 no matter the unit.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            arkn98 Arun Ganesh Assign to me
            rustyrazorblade Jon Haddad
            Arun Ganesh

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m

                Slack

                  Issue deployment