Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-13742 Disabled auto-activation in maintenance mode. #8524

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ public void start(

// Assign discovery manager to context before other processors start so they
// are able to register custom event listener.
GridManager discoMgr = new GridDiscoveryManager(ctx);
GridDiscoveryManager discoMgr = new GridDiscoveryManager(ctx);

ctx.add(discoMgr, false);

Expand All @@ -1210,10 +1210,25 @@ public void start(
startProcessor(mntcProcessor);

if (mntcProcessor.isMaintenanceMode()) {
if (log.isInfoEnabled()) {
log.info(
"Node is being started in maintenance mode. " +
"Starting IsolatedDiscoverySpi instead of configured discovery SPI."
);
}

cfg.setClusterStateOnStart(ClusterState.INACTIVE);

if (log.isInfoEnabled())
log.info("Overriding 'clusterStateOnStart' configuration to 'INACTIVE'.");

ctx.config().setDiscoverySpi(new IsolatedDiscoverySpi());

discoMgr = new GridDiscoveryManager(ctx);

// Reinitialized discovery manager won't have a valid consistentId on creation.
discoMgr.consistentId(ctx.pdsFolderResolver().resolveFolders().consistentId());

ctx.add(discoMgr, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,12 @@ public IgniteInternalFuture<?> changeGlobalState(
boolean forceChangeBaselineTopology,
boolean isAutoAdjust
) {
if (ctx.maintenanceRegistry().isMaintenanceMode()) {
return new GridFinishedFuture<>(
new IgniteCheckedException("Failed to " + prettyStr(state) + " (node is in maintenance mode).")
);
}

BaselineTopology blt = (compatibilityMode && !forceChangeBaselineTopology) ?
null :
calculateNewBaselineTopology(state, baselineNodes, forceChangeBaselineTopology);
Expand Down