cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Dong (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-4479) JMX attribute setters not consistent with cassandra.yaml
Date Wed, 01 Aug 2012 23:50:03 GMT


Eric Dong commented on CASSANDRA-4479:

A quick-and-dirty laundry list of MBean setters:

$ find . -name '*' -exec grep 'void set' {} +
 void setCorePoolSize(int n);
./src/java/org/apache/cassandra/db/    public void setMinimumCompactionThreshold(int
./src/java/org/apache/cassandra/db/    public void setMaximumCompactionThreshold(int
./src/java/org/apache/cassandra/db/    public void setCompactionStrategyClass(String
className) throws ConfigurationException;
./src/java/org/apache/cassandra/db/    public void setCompressionParameters(Map<String,String>
opts) throws ConfigurationException;
./src/java/org/apache/cassandra/gms/    public void setPhiConvictThreshold(int
./src/java/org/apache/cassandra/service/    public void setRowCacheSavePeriodInSeconds(int
./src/java/org/apache/cassandra/service/    public void setKeyCacheSavePeriodInSeconds(int
./src/java/org/apache/cassandra/service/    public void setRowCacheCapacityInMB(long
./src/java/org/apache/cassandra/service/    public void setKeyCacheCapacityInMB(long
./src/java/org/apache/cassandra/service/    public void setHintedHandoffEnabled(boolean
./src/java/org/apache/cassandra/service/    public void setMaxHintWindow(int
./src/java/org/apache/cassandra/service/    public void setMaxHintsInProgress(int
./src/java/org/apache/cassandra/service/    public void setRpcTimeout(Long
./src/java/org/apache/cassandra/service/    public void setLog4jLevel(String
classQualifier, String level);
./src/java/org/apache/cassandra/service/    public void setStreamThroughputMbPerSec(int
./src/java/org/apache/cassandra/service/    public void setCompactionThroughputMbPerSec(int
./src/java/org/apache/cassandra/service/    public void setIncrementalBackupsEnabled(boolean

DatabaseDescriptor setters; according to [ArchitectureInternals|],
all node configuration parameters should be in here:
$ grep 'void set' src/java/org/apache/cassandra/config/ 
    public static void setPartitioner(IPartitioner newPartitioner)
    public static void setEndpointSnitch(IEndpointSnitch eps)
    public static void setRpcTimeout(Long timeOutInMillis)
    public static void setInMemoryCompactionLimit(int sizeInMB)
    public static void setCompactionThroughputMbPerSec(int value)
    public static void setStreamThroughputOutboundMegabitsPerSec(int value)
    public static void setBroadcastAddress(InetAddress broadcastAdd)
    public static void setDynamicUpdateInterval(Integer dynamicUpdateInterval)
    public static void setDynamicResetInterval(Integer dynamicResetInterval)
    public static void setDynamicBadnessThreshold(Double dynamicBadnessThreshold)
    public static void setIncrementalBackupsEnabled(boolean value)
> JMX attribute setters not consistent with cassandra.yaml
> --------------------------------------------------------
>                 Key: CASSANDRA-4479
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.2
>            Reporter: Eric Dong
> If a setting is configurable both via cassandra.yaml and JMX, the two should be consistent.
If that doesn't hold, then the JMX setter can't be trusted. 
> Here I present the example of phi_convict_threshold.
> I'm trying to set phi_convict_threshold via JMX, which sets FailureDetector.phiConvictThreshold_,
but this doesn't update Config.phi_convict_threshold, which gets its value from cassandra.yaml
when starting up.
> Some places, such as FailureDetector.interpret(InetAddress), use FailureDetector.phiConvictThreshold_;
others, such as AntiEntropyService.line 813 in cassandra-1.1.2, use Config.phi_convict_threshold:
> {code}
>             // We want a higher confidence in the failure detection than usual because
failing a repair wrongly has a high cost.
>             if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold())
>                 return;
> {code}
> where DatabaseDescriptor.getPhiConvictThreshold() returns Conf.phi_convict_threshold.
> So, it looks like there are cases where a value is stored in multiple places, and setting
the value via JMX doesn't set all of them. I'd say there should only be a single place where
a configuration parameter is stored, and that single field:
> * should read in the value from cassandra.yaml, optionally falling back to a sane default
> * should be the field that the JMX attribute reads and sets, and
> * any place that needs the current global setting should get it from that field. However,
there could be cases where you read in a global value at the start of a task and keep that
value locally until the end of the task.
> Also, anything settable via JMX should be volatile or set via a synchronized setter,
or else according to the Java memory model other threads may be stuck with the old setting.
> So, I'm requesting the following:
> * Setting up guidelines for how to expose a configuration parameter both via cassandra.yaml
and JMX, based on what I've mentioned above
> * Going through the list of configuration parameters and fixing any that don't match
those guidelines
> I'd also recommend logging any changes to configuration parameters.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message