[ 
https://issues.apache.org/jira/browse/CASSANDRA-17379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17523894#comment-17523894
 ] 

Ekaterina Dimitrova edited comment on CASSANDRA-17379 at 4/18/22 8:47 PM:
--------------------------------------------------------------------------

I left small comments and overall looks good. I have one question - currently 
it fails to start also if we provide _same_ value to old and new config. I 
don't think this was wanted? I think this is a bug because the value needs 
conversion if we want to compare those. I think this case will be a bit more 
involved probably.

Example:
{code:java}
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered 
during startup: Config contains conflicting values for old and new 
configuration parameters:
old: [commitlog_sync_period_in_ms: 15000], new: [commitlog_sync_period: 15000ms]
org.apache.cassandra.exceptions.ConfigurationException: Config contains 
conflicting values for old and new configuration parameters:
old: [commitlog_sync_period_in_ms: 15000], new: [commitlog_sync_period: 15000ms]
{code}
 


was (Author: e.dimitrova):
I left small comments and overall looks good. I have one question - currently 
it fails to start also if we provide _same_ value to old and new config. I 
don't think this was wanted? I think this is a bug because the value needs 
conversion if we want to compare those. I think this case will be a bit more 
involved probably.

Example:

 
{code:java}
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered 
during startup: Config contains conflicting values for old and new 
configuration parameters:
old: [commitlog_sync_period_in_ms: 15000], new: [commitlog_sync_period: 15000ms]
org.apache.cassandra.exceptions.ConfigurationException: Config contains 
conflicting values for old and new configuration parameters:
old: [commitlog_sync_period_in_ms: 15000], new: [commitlog_sync_period: 15000ms]
{code}
 

> Fail starting when the same parameter exists more than once with different 
> values in cassandra.yaml 
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17379
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17379
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Config
>            Reporter: Ekaterina Dimitrova
>            Assignee: Marcus Eriksson
>            Priority: Low
>             Fix For: 4.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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
> {code:java}
> hinted_handoff_enabled: true
> enabled_hinted_handolff: false
> {code}
> you will get loaded in Config - 
> {code:java}
> hinted_handoff_enabled: false{code}
>  //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()|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java#L376]
>  in YamlConfigurationLoader. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to