Support Questions
Find answers, ask questions, and share your expertise

Is there any way to stop an HBase major compaction?

Is there any way to stop an HBase major compaction?

I would need to stop an hbase major compaction since it is affecting the performance of reads/writes

4 REPLIES 4

Re: Is there any way to stop an HBase major compaction?

Expert Contributor

Please set the value for hbase.hregion.majorcompaction to "0"

<property>  

  <name>hbase.hregion.majorcompaction</name> 

   <value>0</value>  

 </property>

This will disable the major compactions and you can trigger it manually during the off peak hours. Make sure we restart hbase services for this to take effect.

Re: Is there any way to stop an HBase major compaction?

This is for disabling future major compactions, but is there any way to stop a running major compaction?

Re: Is there any way to stop an HBase major compaction?

Expert Contributor

@Joan Viladrosa

No .. I don't think we can do that .

Re: Is there any way to stop an HBase major compaction?

Mentor

@Joan Viladrosa there was a JIRA https://issues.apache.org/jira/browse/HBASE-5147 that proposed such functionality but since major compaction is part of normal operations for HBASE, it was marked as resolved. I don't know of any way of stopping compaction in flight in a gracious manner. Perhaps you'd want to open a JIRA again and try your luck? In general, you are better off turning off future compactions and manage schedule via cron. Seems to me this is a minor inconvenience and you won't get much luck getting it through.