[
https://issues.apache.org/jira/browse/HBASE-16989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15632089#comment-15632089
]
ChiaPing Tsai commented on HBASE-16989:
---------------------------------------
[~anoop.hbase]
We are trying to build a pre-process flow that fetch and mark the important
data when executing the preBatchMutate(), and then generate and cache the
“essence” when executing the postBatchMutate().
We use the postBatchMutate() for two reasons outlined follow.
# The “essence” should be generated and cached if the data is stored safely,
because it is expensive to generate the “essence”.
# The “essence” should be visible if the data is visible to readers, because we
modify the returned result based on the “essence”.
In short, it is convenient if the postBatchMutate() is executed before the
MVCC transaction completion; else we need to introduce some synchronization for
dealing with the consistency between data and “essence”.
> RowProcess#postBatchMutate doesn’t be executed before the mvcc transaction
> completion
> -------------------------------------------------------------------------------------
>
> Key: HBASE-16989
> URL: https://issues.apache.org/jira/browse/HBASE-16989
> Project: HBase
> Issue Type: Bug
> Reporter: ChiaPing Tsai
>
> After the [HBASE-15158|https://issues.apache.org/jira/browse/HBASE-15158],
> RowProcess#postBatchMutate will be executed “after” the mvcc transaction
> completion.
> {code:title=HRegion#processRowsWithLocks}
> // STEP 8. Complete mvcc.
> mvcc.completeAndWait(writeEntry);
> writeEntry = null;
>
> // STEP 9. Release region lock
> if (locked) {
> this.updatesLock.readLock().unlock();
> locked = false;
> }
>
> // STEP 10. Release row lock(s)
> releaseRowLocks(acquiredRowLocks);
>
> // STEP 11. call postBatchMutate hook
> processor.postBatchMutate(this);
> {code}
> {code:title=RowProcess#postBatchMutate}
> /**
> * The hook to be executed after the process() and applying the Mutations
> to region. The
> * difference of this one with {@link #postProcess(HRegion, WALEdit,
> boolean)} is this hook will
> * be executed before the mvcc transaction completion.
> */
> void postBatchMutate(HRegion region) throws IOException;
> {code}
> Do we ought to revamp the comment of RowProcess#postBatchMutate or change the
> call order?
> I prefer the former, because the HRegion#doMiniBatchMutate() also call
> postBatchMutate() after the mvcc transaction completion.
> Any comment? Thanks.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)