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

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

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

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • 2.0.15
    • None
    • Linux/CentOS

    • 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

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

          People

            marcuse Marcus Eriksson Assign to me
            mike_peng mike
            Marcus Eriksson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment