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

Fail starting when the same parameter exists more than once in cassandra.yaml

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 4.1-alpha1, 4.1
    • Local/Config
    • None

    Description

      The way that SnakeYAML works, if someone has added the same parameter more than once - the last occurrence will be the one that will take precedence. 

      Now after CASSANDRA-15234 we can even add the parameter with the old name and with the new name and the occurrences will replace each other. Again, whatever is last in cassandra.yaml will take precedence. Example:

      If you add the following in cassandra.yaml

      hinted_handoff_enabled: true
      enabled_hinted_handolff: false
      

      you will get loaded in Config - 

      hinted_handoff_enabled: false

       //there is backward compatibility from the old name to load into the new one

      Currently Cassandra prints in the logs what config was loaded but it is good also to detect the case mentioned and emit a warning for the user so they can verify that the value they wanted was loaded in config.

      To do that you might want to look at the PropertiesChecker and the way we emit other warnings in check() in YamlConfigurationLoader. 

      Attachments

        Issue Links

          Activity

            People

              marcuse Marcus Eriksson
              e.dimitrova Ekaterina Dimitrova
              Marcus Eriksson
              David Capwell, Ekaterina Dimitrova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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