HBASE-25276 Need to throw the original exception in HRegion#openHRegion (#2648)

Signed-off-by: Guanghao Zhang <zghao@apache.org>
This commit is contained in:
niuyulin 2020-11-12 17:40:24 +08:00 committed by Guanghao Zhang
parent ec3f843b23
commit c48f6ebd09
1 changed files with 7 additions and 2 deletions

View File

@ -8085,11 +8085,16 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
RegionReplicaUtil.isDefaultReplica(getRegionInfo())) {
writeRegionOpenMarker(wal, openSeqNum);
}
}catch(Throwable t){
} catch (Throwable t) {
// By coprocessor path wrong region will open failed,
// MetricsRegionWrapperImpl is already init and not close,
// add region close when open failed
this.close();
try {
this.close();
} catch (Throwable e) {
LOG.warn("Open region: {} failed. Try close region but got exception ", this.getRegionInfo(),
e);
}
throw t;
}
return this;