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

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

    XMLWordPrintableJSON

Details

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

      Added unit tests

      Show
      Added unit tests

    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

        Issue Links

          Activity

            People

              arkn98 Arun Ganesh
              rustyrazorblade Jon Haddad
              Arun Ganesh
              Brandon Williams
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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