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() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
this.services.postOpenDeployTasks(this.region);
|
this.services.postOpenDeployTasks(this.region);
|
||||||
} catch (IOException e) {
|
|
||||||
server.abort("Exception running postOpenDeployTasks; region=" +
|
|
||||||
this.region.getRegionInfo().getEncodedName(), e);
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
LOG.warn("Exception running postOpenDeployTasks; region=" +
|
String msg = "Exception running postOpenDeployTasks; region=" +
|
||||||
this.region.getRegionInfo().getEncodedName(), e);
|
this.region.getRegionInfo().getEncodedName();
|
||||||
this.exception = e;
|
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.
|
// We're done. Set flag then wake up anyone waiting on thread to complete.
|
||||||
this.signaller.set(true);
|
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();
|
byte[] encodedName = regionInfo.getEncodedNameAsBytes();
|
||||||
Boolean action = rsServices.getRegionsInTransitionInRS().get(encodedName);
|
Boolean action = rsServices.getRegionsInTransitionInRS().get(encodedName);
|
||||||
return Boolean.TRUE.equals(action); // true means opening for RIT
|
return Boolean.TRUE.equals(action); // true means opening for RIT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isRegionStillOpening() {
|
||||||
|
return isRegionStillOpening(regionInfo, rsServices);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue