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

for DateTieredCompactionStrategy, TIMESTAMP_RESOLUTION_KEY sets wrong msxSSTableAge value if RESOLUTION is other than MILLISECONDS

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Not A Problem
    • Fix Version/s: 2.0.15
    • Component/s: None
    • Labels:
    • Environment:

      Linux/CentOS

    • Severity:
      Normal

      Description

      I was trying to set 'timestamp_resolution' to MINUTES/HOURS/DAYS. it turned out maxSSTableAge was set as wrong value. In the code,

          public DateTieredCompactionStrategyOptions(Map<String, String> options)
          {
              String optionValue = options.get(TIMESTAMP_RESOLUTION_KEY);
              TimeUnit timestampResolution = optionValue == null ? DEFAULT_TIMESTAMP_RESOLUTION : TimeUnit.valueOf(optionValue);
              optionValue = options.get(MAX_SSTABLE_AGE_KEY);
              double fractionalDays = optionValue == null ? DEFAULT_MAX_SSTABLE_AGE_DAYS : Double.parseDouble(optionValue);
              maxSSTableAge = Math.round(fractionalDays * timestampResolution.convert(1, TimeUnit.DAYS));
       ...   }

      maxSSTableAge will be set as the value in "timestamp_resolution" unit, such as , with the following settings,
      'timestamp_resolution':'HOURS',
      'max_sstable_age_days':'7',
      'base_time_seconds':'3600'
      and I get:
      maxSSTableAge=168, baseTime=1

      while in the following routine, it expect maxSSTableAge as milliseconds
      static Iterable<SSTableReader> filterOldSSTables(List<SSTableReader> sstables, long maxSSTableAge, long now)

        Attachments

          Activity

            People

            • Assignee:
              marcuse Marcus Eriksson
              Reporter:
              mike_peng mike
              Authors:
              Marcus Eriksson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: