hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Yuan Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14017) Procedure v2 - MasterProcedureQueue fix concurrency issue on table queue deletion
Date Fri, 03 Jul 2015 01:37:04 GMT

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

Stephen Yuan Jiang commented on HBASE-14017:
--------------------------------------------

We should move the tryExclusiveLock() up:

{code}
    public synchronized boolean tryExclusiveLock(final TableLockManager lockManager,
        final TableName tableName, final String purpose) {
      if (tryExclusiveLock()) return false;  //<==
      // Take zk-write-lock
      tableLock = lockManager.writeLock(tableName, purpose);
      try {
        tableLock.acquire();
      } catch (IOException e) {
        LOG.error("failed acquire write lock on " + tableName, e);
        tableLock = null;
        releaseExclusiveLock(); // <==
        return false;
      }
      return true;
    }

> Procedure v2 - MasterProcedureQueue fix concurrency issue on table queue deletion
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-14017
>                 URL: https://issues.apache.org/jira/browse/HBASE-14017
>             Project: HBase
>          Issue Type: Sub-task
>          Components: proc-v2
>    Affects Versions: 2.0.0, 1.2.0, 1.1.0.1
>            Reporter: Matteo Bertozzi
>            Assignee: Matteo Bertozzi
>            Priority: Blocker
>             Fix For: 2.0.0, 1.2.0, 1.1.2
>
>         Attachments: HBASE-14017-v0.patch
>
>
> [~syuanjiang] found a concurrecy issue in the procedure queue delete where we don't have
an exclusive lock before deleting the table
> {noformat}
> Thread 1: Create table is running - tryWrite() acquire the lock, before set wlock=true;
> Thread 2: markTableAsDeleted see the queue empty and wlock= false
> Thread 1: set wlock=true; too late
> Thread 2: delete the queue
> Thread 1: never able to release the lock
> {noformat}



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

Mime
View raw message