hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-17131) Avoid livelock caused by HRegion#processRowsWithLocks
Date Fri, 28 Jul 2017 06:25:06 GMT

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

Hudson commented on HBASE-17131:
--------------------------------

SUCCESS: Integrated in Jenkins build HBase-1.2-IT #909 (See [https://builds.apache.org/job/HBase-1.2-IT/909/])
HBASE-17131 Avoid livelock caused by HRegion#processRowsWithLocks (chia7712: rev 670e9431d40d35df4802bc0445012271ee904efc)
* (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide3.java
* (edit) hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java


> Avoid livelock caused by HRegion#processRowsWithLocks
> -----------------------------------------------------
>
>                 Key: HBASE-17131
>                 URL: https://issues.apache.org/jira/browse/HBASE-17131
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 2.0.0, 1.4.0, 1.3.1, 1.2.6
>            Reporter: Chia-Ping Tsai
>            Assignee: Chia-Ping Tsai
>             Fix For: 2.0.0, 1.4.0, 1.3.2, 1.2.7
>
>         Attachments: HBASE-17131.branch-1.2.v0.patch, HBASE-17131.branch-1.3.v0.patch,
HBASE-17131.branch-1.v0.patch, HBASE-17131.v0.patch
>
>
> {code:title=HRegion.java|borderStyle=solid}
> try {
>       // STEP 2. Acquire the row lock(s)
>       acquiredRowLocks = new ArrayList<RowLock>(rowsToLock.size());
>       for (byte[] row : rowsToLock) {
>         // Attempt to lock all involved rows, throw if any lock times out
>         // use a writer lock for mixed reads and writes
>         acquiredRowLocks.add(getRowLockInternal(row, false));
>       }
>       // STEP 3. Region lock
>       lock(this.updatesLock.readLock(), acquiredRowLocks.size() == 0 ? 1 : acquiredRowLocks.size());
>       locked = true;
>       boolean success = false;
>       long now = EnvironmentEdgeManager.currentTime();
>       try {
> {code}
> We should lock all involved rows in the second try-finally. Otherwise, we won’t release
the previous locks if any subsequent lock times out.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message