riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

Inconsistent ccm <node> updateconf behaviour #615

Closed rzvoncek closed 7 years ago

rzvoncek commented 7 years ago

Hello,

I'm using brew-installed ccm 2.1.6, and I've been running into some issues with updateconf. First, in a context of a rather old version:

ccm create handoff_test -v 2.1.15
ccm populate -n 1
ccm updateconf 'hinted_handoff_enabled: false'
ccm start
grep handoff_enabled ~/.ccm/handoff_test/node1/conf/cassandra.yaml
ccm node1 nodetool statushandoff

Doesn't seem to be effective at all:

grep handoff_enabled ~/.ccm/handoff_test/node1/conf/cassandra.yaml
> hinted_handoff_enabled: true
ccm node1 nodetool statushandoff
> running

Using a recent Cassandra version, 3.11.0, the produced yaml is somehow corrupted and the node fails to start:

Invalid yaml: file:~/.ccm/handoff_test/node1/conf/cassandra.yaml 
    Error: null; 
    Can't construct a java object for tag: yaml.org,2002:org.apache.cassandra.config.Config; 
    exception=Cannot create property=commitlog_sync_batch_window_in_ms for
    JavaBean=org.apache.cassandra.config.Config@491666ad; 
    Can not set double field
    org.apache.cassandra.config.Config.commitlog_sync_batch_window_in_ms to null value;  
    in 'reader', line 1, column 1:
        authenticator: AllowAllAuthenticator
        ^

Which seems to be happening just because

commitlog_sync_batch_window_in_ms: null

Setting it to a number actually fixes things.

To conclude, there are two questions answering which would help me greatly:

ptnapoleon commented 7 years ago

I couldn't see anything wrong with how you're using updateconf. As a workaround, I was going to suggest you could use ccm updateconf --no-hh. However, I see now that because of a bug in the implementation of the --no-hh shorthand, you in fact have to use it to disable hinted handoff.

As far as the corrupted yaml bug, I don't see an immediate cause for that. This is happening when you follow the same steps as you were on 2.1.15?

rzvoncek commented 7 years ago

Yeah, it was the exact same steps, just the version was different.

ptnapoleon commented 7 years ago

Following your exact steps (and a few variations), I am not seeing that error. Are you on ccm master?

rzvoncek commented 7 years ago

Oh sorry, this completely went off my radar. I'm on ccm 2.1.6 installed using homebrew.

ptnapoleon commented 7 years ago

Oh sorry, I missed that in your original comment. Can you try with the latest ccm master, to see if it resolves your issue? I cannot reproduce it, so it may have been inadvertently resolved.

rzvoncek commented 7 years ago

I tried this on master and couldn't reproduce the issue. It looks like we can conclude it's been fixed and close this issue.