cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viktor Jevdokimov <>
Subject RE: Safely Disabling Compaction
Date Mon, 21 May 2012 05:36:28 GMT
To temporarily turn off compactions without schema update, use
nodetool –h <node_ip> -p <port> setcompactionthreshold <keyspace> <cfname>
<minthreshold> <maxthreshold>
for every node and every column family you need.

If nodetool throws same exception, do in 2 steps:

1.       nodetool setcompactionthreshold <keyspace> <cfname> 0 32 (32 – use
yours instead)

2.       nodetool setcompactionthreshold <keyspace> <cfname> 0 0
To restore, set your normal values.

Best regards / Pagarbiai
Viktor Jevdokimov
Senior Developer

Phone: +370 5 212 3063, Fax +370 5 261 0453
J. Jasinskio 16C, LT-01112 Vilnius, Lithuania
Follow us on Twitter: @adforminsider<!/adforminsider>
What is Adform: watch this short video<>

[Adform News] <>

Disclaimer: The information contained in this message and attachments is intended solely for
the attention and use of the named addressee and may be confidential. If you are not the intended
recipient, you are reminded that the information remains the property of the sender. You must
not use, disclose, distribute, copy, print or rely on this e-mail. If you have received this
message in error, please contact the sender immediately and irrevocably delete this message
and any copies.

From: Vijay []
Sent: Friday, May 18, 2012 06:09
Subject: Re: Safely Disabling Compaction

I would rather set the Keyspace setting min_compaction_threshold and max_compaction_threshold
to be a higher number and once i am ready i will put the value back... This way i dont need
to restart.
Having said that why not set the compaction throughput to 1 (low enough to not have contention)
and complete the stream?


On Wed, May 16, 2012 at 2:43 PM, sj.climber <<>>

In an effort to minimize IO contention, I'd like to disable compactions
while I'm streaming SSTables to the cluster.  When done streaming, I intend
on forcing a major compaction through nodetool.

Elsewhere in the forums, various folks suggest setting
max_compaction_threshold = 0 to disable compaction.  While this works
sometimes (via 'update column family <family> with
max_compaction_threshold=0'), I've observed a number of serious issues with
this approach:

1) You can't create a column family with max_compaction_threshold = 0.  The
CLI reports that min_compaction_threshold must have a value >= 2, and
max_compaction_threshold can't be lower than it.  Worse yet, trying to
create a column family with max_compaction_threshold = 0 gets the cluster
into a Schema Disagreement Exception (since the node on which you issue the
migration command fails with a fatal error).

2) Cassandra will allow me to update an existing column family with
max_compaction_threshold = 0.  But if I restart the node, it will crash on
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.lang.reflect.Method.invoke(
Caused by: java.lang.RuntimeException:
       ... 14 more
Caused by: java.lang.RuntimeException: The max_compaction_threshold cannot
be smaller than the min.
       at org.apache.

Is there another solution for more safely enabling/disabling compaction?


View this message in context:
Sent from the<>
mailing list archive at

View raw message