HBASE-21349 Do not run CatalogJanitor or Nomalizer when cluster is shutting down
Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
parent
390c3227e2
commit
f3da04a552
|
@ -111,14 +111,16 @@ public class CatalogJanitor extends ScheduledChore {
|
||||||
protected void chore() {
|
protected void chore() {
|
||||||
try {
|
try {
|
||||||
AssignmentManager am = this.services.getAssignmentManager();
|
AssignmentManager am = this.services.getAssignmentManager();
|
||||||
if (this.enabled.get() && !this.services.isInMaintenanceMode() && am != null &&
|
if (this.enabled.get() && !this.services.isInMaintenanceMode() &&
|
||||||
|
!this.services.getServerManager().isClusterShutdown() && am != null &&
|
||||||
am.isMetaLoaded() && !am.hasRegionsInTransition()) {
|
am.isMetaLoaded() && !am.hasRegionsInTransition()) {
|
||||||
scan();
|
scan();
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("CatalogJanitor is disabled! Enabled=" + this.enabled.get() +
|
LOG.warn("CatalogJanitor is disabled! Enabled=" + this.enabled.get() +
|
||||||
", maintenanceMode=" + this.services.isInMaintenanceMode() + ", am=" + am +
|
", maintenanceMode=" + this.services.isInMaintenanceMode() + ", am=" + am +
|
||||||
", metaLoaded=" + (am != null && am.isMetaLoaded()) + ", hasRIT=" +
|
", metaLoaded=" + (am != null && am.isMetaLoaded()) + ", hasRIT=" +
|
||||||
(am != null && am.hasRegionsInTransition()));
|
(am != null && am.hasRegionsInTransition()) + " clusterShutDown=" + this.services
|
||||||
|
.getServerManager().isClusterShutdown());
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn("Failed scan of catalog table", e);
|
LOG.warn("Failed scan of catalog table", e);
|
||||||
|
|
|
@ -1767,12 +1767,14 @@ public class HMaster extends HRegionServer implements MasterServices {
|
||||||
LOG.debug("Master has not been initialized, don't run region normalizer.");
|
LOG.debug("Master has not been initialized, don't run region normalizer.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this.getServerManager().isClusterShutdown()) {
|
||||||
|
LOG.info("Cluster is shutting down, don't run region normalizer.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (isInMaintenanceMode()) {
|
if (isInMaintenanceMode()) {
|
||||||
LOG.info("Master is in maintenance mode, don't run region normalizer.");
|
LOG.info("Master is in maintenance mode, don't run region normalizer.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.regionNormalizerTracker.isNormalizerOn()) {
|
if (!this.regionNormalizerTracker.isNormalizerOn()) {
|
||||||
LOG.debug("Region normalization is disabled, don't run region normalizer.");
|
LOG.debug("Region normalization is disabled, don't run region normalizer.");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue