Index: src/java/org/apache/hadoop/hbase/regionserver/HRegion.java =================================================================== --- src/java/org/apache/hadoop/hbase/regionserver/HRegion.java (revision 896769) +++ src/java/org/apache/hadoop/hbase/regionserver/HRegion.java (working copy) @@ -1133,9 +1133,9 @@ throws IOException { checkReadOnly(); checkResources(); + Integer lid = null; + newScannerLock.writeLock().lock(); splitsAndClosesLock.readLock().lock(); - newScannerLock.writeLock().lock(); - Integer lid = null; try { byte [] row = delete.getRow(); // If we did not pass an existing row lock, obtain a new one @@ -1162,8 +1162,8 @@ } } finally { if(lockid == null) releaseRowLock(lid); + splitsAndClosesLock.readLock().unlock(); newScannerLock.writeLock().unlock(); - splitsAndClosesLock.readLock().unlock(); } } @@ -1268,8 +1268,8 @@ // read lock, resources may run out. For now, the thought is that this // will be extremely rare; we'll deal with it when it happens. checkResources(); + newScannerLock.writeLock().lock(); splitsAndClosesLock.readLock().lock(); - newScannerLock.writeLock().lock(); try { // We obtain a per-row lock, so other clients will block while one client // performs an update. The read lock is released by the client calling @@ -1294,8 +1294,8 @@ if(lockid == null) releaseRowLock(lid); } } finally { + splitsAndClosesLock.readLock().unlock(); newScannerLock.writeLock().unlock(); - splitsAndClosesLock.readLock().unlock(); } }