[
https://issues.apache.org/jira/browse/HBASE-12565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14235281#comment-14235281
]
Hadoop QA commented on HBASE-12565:
-----------------------------------
{color:green}+1 overall{color}. Here are the results of testing the latest
attachment
http://issues.apache.org/jira/secure/attachment/12685261/hbase-12565-v1.patch
against master branch at commit 08754f2c431b829b0d6269bdb23284dd679ed8ca.
ATTACHMENT ID: 12685261
{color:green}+1 @author{color}. The patch does not contain any @author
tags.
{color:green}+1 tests included{color}. The patch appears to include 8 new
or modified tests.
{color:green}+1 javac{color}. The applied patch does not increase the
total number of javac compiler warnings.
{color:green}+1 javac{color}. The applied patch does not increase the
total number of javac compiler warnings.
{color:green}+1 javadoc{color}. The javadoc tool did not generate any
warning messages.
{color:green}+1 checkstyle{color}. The applied patch does not increase the
total number of checkstyle errors
{color:green}+1 findbugs{color}. The patch does not introduce any new
Findbugs (version 2.0.3) warnings.
{color:green}+1 release audit{color}. The applied patch does not increase
the total number of release audit warnings.
{color:green}+1 lineLengths{color}. The patch does not introduce lines
longer than 100
{color:green}+1 site{color}. The mvn site goal succeeds with this patch.
{color:green}+1 core tests{color}. The patch passed unit tests in .
Test results:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//testReport/
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-rest.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-client.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-examples.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-protocol.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-server.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-thrift.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
Findbugs warnings:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/newPatchFindbugsWarningshbase-annotations.html
Checkstyle Errors:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//artifact/patchprocess/checkstyle-aggregate.html
Console output:
https://builds.apache.org/job/PreCommit-HBASE-Build/11948//console
This message is automatically generated.
> Race condition in HRegion.batchMutate() causes partial data to be written
> when region closes
> ---------------------------------------------------------------------------------------------
>
> Key: HBASE-12565
> URL: https://issues.apache.org/jira/browse/HBASE-12565
> Project: HBase
> Issue Type: Bug
> Components: Performance, regionserver
> Affects Versions: 2.0.0, 0.98.6
> Reporter: Scott Fines
> Attachments: hbase-12565-v1.patch, hbase-12565-v1.patch,
> hbase-12565.patch
>
>
> The following sequence of events is possible to occur in HRegion's
> batchMutate() call:
> 1. caller attempts to call HRegion.batchMutate() with a batch of N>1 records
> 2. batchMutate acquires region lock in startRegionOperation, then calls
> doMiniBatchMutation()
> 3. doMiniBatchMutation acquires one row lock
> 4. Region closes
> 5. doMiniBatchMutation attempts to acquire second row lock.
> When this happens, the lock acquisition will also attempt to acquire the
> region lock, which fails (because the region is closing). At this stage,
> doMiniBatchMutation will stop writing further, BUT it WILL write data for the
> rows whose locks have already been acquired, and advance the index in
> MiniBatchOperationInProgress. Then, after it terminates successfully,
> batchMutate() will loop around a second time, and attempt AGAIN to acquire
> the region closing lock. When that happens, a NotServingRegionException is
> thrown back to the caller.
> Thus, we have a race condition where partial data can be written when a
> region server is closing.
> The main problem stems from the location of startRegionOperation() calls in
> batchMutate and doMiniBatchMutation():
> 1. batchMutate() reacquires the region lock with each iteration of the loop,
> which can cause some successful writes to occur, but then fail on others
> 2. getRowLock() attempts to acquire the region lock once for each row, which
> allows doMiniBatchMutation to terminate early; this forces batchMutate() to
> use multiple iterations and results in condition 1 being hit.
> There appears to be two parts to the solution as well:
> 1. open an internal path so that doMiniBatchMutation() can acquire row locks
> without checking for region closure. This will have the added benefit of a
> significant performance improvement during large batch mutations.
> 2. move the startRegionOperation() out of the loop in batchMutate() so that
> multiple iterations of doMiniBatchMutation will not cause the operation to
> fail.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)