You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by vito <li...@gmail.com> on 2014/07/14 05:57:27 UTC
Will compaction block memstore flush to disk
Hi ,
Will compaction(minor or major) block memstore flush to disk(or HDFS)?
That's, when region server is doing compaction, is it allowed to flush
memstore to HDFS? Let's base the answer in HBase 0.94.
Here are some info I dig out, but I'm not sure of the anwser:
hbase.hstore.compactionThreshold:(0.89)
If more than this number of HStoreFiles in any one HStore (one
HStoreFile is written per flush of memstore) then a compaction is run to
rewrite all HStoreFiles files as one. Larger numbers put off compaction but
when it runs, it takes longer to complete. *During a compaction, updates
cannot be flushed to disk. * Long compactions require memory sufficient to
carry the logging of all updates across the duration of the compaction. If
too large, clients timeout during compaction.
hbase.hstore.compactionThreshold:(0.94)
If more than this number of HStoreFiles in any one HStore (one HStoreFile is
written per flush of memstore) then a compaction is run to rewrite all
HStoreFiles files as one. Larger numbers put off compaction but when it
runs, it takes longer to complete.
In the source code of 0.94, the comment says new storeFiles can be written
from memstore.
org.apache.hadoop.hbase.regionserver.Store.java:compact()
//////////////////////////////////////////////////////////////////////////////
// Compaction
//////////////////////////////////////////////////////////////////////////////
/**
* Compact the StoreFiles. This method may take some time, so the calling
* thread must be able to block for long periods.
*
* <p>During this time, the Store can work as usual, getting values from
* StoreFiles and writing new StoreFiles from the memstore.
*
* Existing StoreFiles are not destroyed until the new compacted StoreFile
is
* completely written-out to disk.
...
Regards,
Vito Lee
--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302.html
Sent from the HBase User mailing list archive at Nabble.com.
Re: Will compaction block memstore flush to disk
Posted by Bharath Vissapragada <bh...@cloudera.com>.
Your understanding is correct. They are blocked for blockingWaitTime. Also
as you mentioned it makes sure that the memory is not overused by putting
"lowerLimit" and "upperLimit" on the total memory usage. This is mainly for
heavy write scenarios where compactions can't keep up with frequent flushes.
On Mon, Jul 14, 2014 at 12:59 PM, vito <li...@gmail.com> wrote:
>
> >But if the number number of store files are beyond
> hbase.hstore.blockingStoreFiles, updates are blocked.
>
> Updates are blocked for period hbase.hstore.blockingWaitTime? or Updates
> can't be put into memstore?
>
> My understanding is the former.
>
> Certainly, updates can also be blocked by some memstore threshold, eg.,
> hbase.regionserver.global.memstore.upperLimit or
> hbase.hregion.memstore.block.multiplier.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302p4061317.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
--
Bharath Vissapragada
<http://www.cloudera.com>
Re: Will compaction block memstore flush to disk
Posted by vito <li...@gmail.com>.
>But if the number number of store files are beyond
hbase.hstore.blockingStoreFiles, updates are blocked.
Updates are blocked for period hbase.hstore.blockingWaitTime? or Updates
can't be put into memstore?
My understanding is the former.
Certainly, updates can also be blocked by some memstore threshold, eg.,
hbase.regionserver.global.memstore.upperLimit or
hbase.hregion.memstore.block.multiplier.
Thanks.
--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302p4061317.html
Sent from the HBase User mailing list archive at Nabble.com.
Re: Will compaction block memstore flush to disk
Posted by Bharath Vissapragada <bh...@cloudera.com>.
Yes [1]. But if the number number of store files are
beyond hbase.hstore.blockingStoreFiles, updates are blocked. So you should
tune the heap settings properly depending on your load pattern.
https://github.com/apache/hbase/blob/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java#L366
On Mon, Jul 14, 2014 at 11:35 AM, vito <li...@gmail.com> wrote:
> Yes. I've seen it.
> So after hbase.hstore.blockingWaitTime is over, we can still flush memstore
> to disk even when compaction is still ongoing. Right?
>
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302p4061313.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
--
Bharath Vissapragada
<http://www.cloudera.com>
Re: Will compaction block memstore flush to disk
Posted by vito <li...@gmail.com>.
Yes. I've seen it.
So after hbase.hstore.blockingWaitTime is over, we can still flush memstore
to disk even when compaction is still ongoing. Right?
--
View this message in context: http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302p4061313.html
Sent from the HBase User mailing list archive at Nabble.com.
Re: Will compaction block memstore flush to disk
Posted by Bharath Vissapragada <bh...@cloudera.com>.
If there are too many store files, flush will wait till compaction clears
them [1] or hbase.hstore.blockingWaitTime is over! Do you see similar logs?
[1]
https://github.com/apache/hbase/blob/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java#L363
On Mon, Jul 14, 2014 at 9:27 AM, vito <li...@gmail.com> wrote:
> Hi ,
>
> Will compaction(minor or major) block memstore flush to disk(or HDFS)?
> That's, when region server is doing compaction, is it allowed to flush
> memstore to HDFS? Let's base the answer in HBase 0.94.
>
> Here are some info I dig out, but I'm not sure of the anwser:
>
> hbase.hstore.compactionThreshold:(0.89)
>
> If more than this number of HStoreFiles in any one HStore (one
> HStoreFile is written per flush of memstore) then a compaction is run to
> rewrite all HStoreFiles files as one. Larger numbers put off compaction
> but
> when it runs, it takes longer to complete. *During a compaction, updates
> cannot be flushed to disk. * Long compactions require memory sufficient to
> carry the logging of all updates across the duration of the compaction.
> If
> too large, clients timeout during compaction.
>
> hbase.hstore.compactionThreshold:(0.94)
> If more than this number of HStoreFiles in any one HStore (one HStoreFile
> is
> written per flush of memstore) then a compaction is run to rewrite all
> HStoreFiles files as one. Larger numbers put off compaction but when it
> runs, it takes longer to complete.
>
>
> In the source code of 0.94, the comment says new storeFiles can be written
> from memstore.
> org.apache.hadoop.hbase.regionserver.Store.java:compact()
>
>
>
> //////////////////////////////////////////////////////////////////////////////
> // Compaction
>
>
> //////////////////////////////////////////////////////////////////////////////
>
> /**
> * Compact the StoreFiles. This method may take some time, so the
> calling
> * thread must be able to block for long periods.
> *
> * <p>During this time, the Store can work as usual, getting values from
> * StoreFiles and writing new StoreFiles from the memstore.
> *
> * Existing StoreFiles are not destroyed until the new compacted
> StoreFile
> is
> * completely written-out to disk.
> ...
>
>
> Regards,
> Vito Lee
>
>
>
>
> --
> View this message in context:
> http://apache-hbase.679495.n3.nabble.com/Will-compaction-block-memstore-flush-to-disk-tp4061302.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
--
Bharath Vissapragada
<http://www.cloudera.com>