You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Eshcar Hillel (JIRA)" <ji...@apache.org> on 2015/08/01 22:20:06 UTC

[jira] [Commented] (HBASE-13408) HBase In-Memory Memstore Compaction

    [ https://issues.apache.org/jira/browse/HBASE-13408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14650518#comment-14650518 ] 

Eshcar Hillel commented on HBASE-13408:
---------------------------------------

Then how about we’ll make use of the FlushPolicy abstraction that is written so nicely and is easy to extend ;-).
We can add to it a method selectStoresToCompact(), so that a flush process manages 2 sets to reduce memory usage (1) stores to flush (2) stores to be compacted. A store is in either of the two sets or in none, but not in both of them. The decision whether reducing the memory usage is done by a flush or a compaction depends on the store type and state.
In addition, we’ll add a method to the MemStore interface doInmemoryCompaction(). In compacted memstore the implementation of this method would be to push the active set into the compaction pipeline and invoke a compaction.

With this solution the semantics of prepare-to-flush remains the same.

> HBase In-Memory Memstore Compaction
> -----------------------------------
>
>                 Key: HBASE-13408
>                 URL: https://issues.apache.org/jira/browse/HBASE-13408
>             Project: HBase
>          Issue Type: New Feature
>            Reporter: Eshcar Hillel
>         Attachments: HBaseIn-MemoryMemstoreCompactionDesignDocument-ver02.pdf, HBaseIn-MemoryMemstoreCompactionDesignDocument.pdf, InMemoryMemstoreCompactionEvaluationResults.pdf
>
>
> A store unit holds a column family in a region, where the memstore is its in-memory component. The memstore absorbs all updates to the store; from time to time these updates are flushed to a file on disk, where they are compacted. Unlike disk components, the memstore is not compacted until it is written to the filesystem and optionally to block-cache. This may result in underutilization of the memory due to duplicate entries per row, for example, when hot data is continuously updated. 
> Generally, the faster the data is accumulated in memory, more flushes are triggered, the data sinks to disk more frequently, slowing down retrieval of data, even if very recent.
> In high-churn workloads, compacting the memstore can help maintain the data in memory, and thereby speed up data retrieval. 
> We suggest a new compacted memstore with the following principles:
> 1.	The data is kept in memory for as long as possible
> 2.	Memstore data is either compacted or in process of being compacted 
> 3.	Allow a panic mode, which may interrupt an in-progress compaction and force a flush of part of the memstore.
> We suggest applying this optimization only to in-memory column families.
> A design document is attached.
> This feature was previously discussed in HBASE-5311.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)