HBASE-11380 HRegion lock object is not being released properly, leading to snapshot failure

This commit is contained in:
Ted Yu 2014-06-24 03:06:40 +00:00
parent 092fc71b18
commit af9e519e00
2 changed files with 16 additions and 8 deletions

View File

@ -176,12 +176,16 @@ public class TableSnapshotScanner extends AbstractClientScanner {
}
}
result = currentRegionScanner.next();
if (result != null) {
return result;
} else {
currentRegionScanner.close();
currentRegionScanner = null;
try {
result = currentRegionScanner.next();
if (result != null) {
return result;
}
} finally {
if (result == null) {
currentRegionScanner.close();
currentRegionScanner = null;
}
}
}
}

View File

@ -4841,8 +4841,12 @@ public class HRegion implements HeapSize { // , Writable{
WALEdit walEdit = new WALEdit();
// 1. Run pre-process hook
processor.preProcess(this, walEdit);
try {
processor.preProcess(this, walEdit);
} catch (IOException e) {
closeRegionOperation();
throw e;
}
// Short circuit the read only case
if (processor.readOnly()) {
try {