HBASE-6839 Operations may be executed without rowLock
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1387863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3f81037369
commit
6e3d76183c
|
@ -2181,7 +2181,14 @@ public class HRegion implements HeapSize { // , Writable{
|
||||||
// If we haven't got any rows in our batch, we should block to
|
// If we haven't got any rows in our batch, we should block to
|
||||||
// get the next one.
|
// get the next one.
|
||||||
boolean shouldBlock = numReadyToWrite == 0;
|
boolean shouldBlock = numReadyToWrite == 0;
|
||||||
Integer acquiredLockId = getLock(providedLockId, mutation.getRow(), shouldBlock);
|
Integer acquiredLockId = null;
|
||||||
|
try {
|
||||||
|
acquiredLockId = getLock(providedLockId, mutation.getRow(),
|
||||||
|
shouldBlock);
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
LOG.warn("Failed getting lock in batch put, row="
|
||||||
|
+ Bytes.toStringBinary(mutation.getRow()), ioe);
|
||||||
|
}
|
||||||
if (acquiredLockId == null) {
|
if (acquiredLockId == null) {
|
||||||
// We failed to grab another lock
|
// We failed to grab another lock
|
||||||
assert !shouldBlock : "Should never fail to get lock when blocking";
|
assert !shouldBlock : "Should never fail to get lock when blocking";
|
||||||
|
@ -3223,7 +3230,8 @@ public class HRegion implements HeapSize { // , Writable{
|
||||||
try {
|
try {
|
||||||
if (!existingLatch.await(this.rowLockWaitDuration,
|
if (!existingLatch.await(this.rowLockWaitDuration,
|
||||||
TimeUnit.MILLISECONDS)) {
|
TimeUnit.MILLISECONDS)) {
|
||||||
return null;
|
throw new IOException("Timed out on getting lock for row="
|
||||||
|
+ Bytes.toStringBinary(row));
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
// Empty
|
// Empty
|
||||||
|
|
Loading…
Reference in New Issue