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

Consider to not warn about deprecated properties in logs when the value is not deprecated

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 4.1-beta1, 4.1
    • Local/Config
    • None
    • Operability
    • Low Hanging Fruit
    • All
    • None
    • Hide

      The same patch was added for both 4.1 and trunk.

      I tested manually to see that the warnings are not presented anymore on startup. I can push sanity check CI pre-commit when smiklosovic or any other committer reviewer approves the change. 

      Show
      The same patch was added for both 4.1  and trunk . I tested manually to see that the warnings are not presented anymore on startup. I can push sanity check CI pre-commit when  smiklosovic  or any other committer reviewer approves the change. 

    Description

      When there is an initialisation of database descriptor for tools, for example via "Util.initDatabaseDescriptor()", it will eventually buble up to "YamlConfigurationLoader.check" where this is logged:

      if (!deprecationWarnings.isEmpty())
      logger.warn("{} parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt", deprecationWarnings);
      

      For example, I saw this log:

      WARN  09:07:42,486 [key_cache_save_period, counter_cache_save_period, row_cache_save_period] parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt
      

      The "problems" I see are two:
      1) it pollutes the console for tool commands, when a tool needs to initialise DD, at the very beginning of the output.
      2) When you look closely, for example at key_cache_save_period, by default, in cassandra.yaml, it has value "4h". My question is: why is it necessary to mark that as deprecated when the value is already in new format? In other words, I would log that warning only in case that the expected value of a property is not in the new format. But when it already is, why do we need to inform a user about that?

      I think it would require to take some extra care for cases like these in YamlConfigurationLoader.getProperty to not add deprecated properties if their value is already new.

       

      Attachments

        Activity

          People

            e.dimitrova Ekaterina Dimitrova
            smiklosovic Stefan Miklosovic
            Ekaterina Dimitrova
            Stefan Miklosovic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: