HBASE-11687 No need to abort on postOpenDeployTasks exception if region opening is cancelled
This commit is contained in:
parent
4bd2da4783
commit
ce6c204078
|
@ -319,13 +319,16 @@ public class OpenRegionHandler extends EventHandler {
|
|||
public void run() {
|
||||
try {
|
||||
this.services.postOpenDeployTasks(this.region);
|
||||
} catch (IOException e) {
|
||||
server.abort("Exception running postOpenDeployTasks; region=" +
|
||||
this.region.getRegionInfo().getEncodedName(), e);
|
||||
} catch (Throwable e) {
|
||||
LOG.warn("Exception running postOpenDeployTasks; region=" +
|
||||
this.region.getRegionInfo().getEncodedName(), e);
|
||||
String msg = "Exception running postOpenDeployTasks; region=" +
|
||||
this.region.getRegionInfo().getEncodedName();
|
||||
this.exception = e;
|
||||
if (e instanceof IOException
|
||||
&& isRegionStillOpening(region.getRegionInfo(), services)) {
|
||||
server.abort(msg, e);
|
||||
} else {
|
||||
LOG.warn(msg, e);
|
||||
}
|
||||
}
|
||||
// We're done. Set flag then wake up anyone waiting on thread to complete.
|
||||
this.signaller.set(true);
|
||||
|
@ -394,9 +397,14 @@ public class OpenRegionHandler extends EventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isRegionStillOpening() {
|
||||
private static boolean isRegionStillOpening(
|
||||
HRegionInfo regionInfo, RegionServerServices rsServices) {
|
||||
byte[] encodedName = regionInfo.getEncodedNameAsBytes();
|
||||
Boolean action = rsServices.getRegionsInTransitionInRS().get(encodedName);
|
||||
return Boolean.TRUE.equals(action); // true means opening for RIT
|
||||
}
|
||||
|
||||
private boolean isRegionStillOpening() {
|
||||
return isRegionStillOpening(regionInfo, rsServices);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue