Class DecommissionService
java.lang.Object
org.opensearch.cluster.decommission.DecommissionService
Service responsible for entire lifecycle of decommissioning and recommissioning an awareness attribute.
Whenever a cluster manager initiates operation to decommission an awareness attribute, the service makes the best attempt to perform the following task -
- Initiates nodes decommissioning by adding custom metadata with the attribute and state as
DecommissionStatus.INIT
- Remove to-be-decommissioned cluster-manager eligible nodes from voting config and wait for its abdication if it is active leader
- After the draining timeout, the service triggers nodes decommission. This marks the decommission status as
DecommissionStatus.IN_PROGRESS
- Once the decommission is successful, the service clears the voting config and marks the status as
DecommissionStatus.SUCCESSFUL
- If service fails at any step, it makes best attempt to mark the status as
DecommissionStatus.FAILED
and to clear voting config exclusion
- Opensearch.internal:
-
Constructor Summary
ConstructorsConstructorDescriptionDecommissionService
(Settings settings, ClusterSettings clusterSettings, ClusterService clusterService, TransportService transportService, ThreadPool threadPool, AllocationService allocationService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
startDecommissionAction
(DecommissionRequest decommissionRequest, org.opensearch.core.action.ActionListener<DecommissionResponse> listener) Starts the new decommission request and registers the metadata with status asDecommissionStatus.INIT
Once the status is updated, it tries to exclude to-be-decommissioned cluster manager eligible nodes from Voting Configurationvoid
startRecommissionAction
(org.opensearch.core.action.ActionListener<DeleteDecommissionStateResponse> listener)
-
Constructor Details
-
DecommissionService
@Inject public DecommissionService(Settings settings, ClusterSettings clusterSettings, ClusterService clusterService, TransportService transportService, ThreadPool threadPool, AllocationService allocationService)
-
-
Method Details
-
startDecommissionAction
public void startDecommissionAction(DecommissionRequest decommissionRequest, org.opensearch.core.action.ActionListener<DecommissionResponse> listener) Starts the new decommission request and registers the metadata with status asDecommissionStatus.INIT
Once the status is updated, it tries to exclude to-be-decommissioned cluster manager eligible nodes from Voting Configuration- Parameters:
decommissionRequest
- request for decommission actionlistener
- register decommission listener
-
startRecommissionAction
public void startRecommissionAction(org.opensearch.core.action.ActionListener<DeleteDecommissionStateResponse> listener)
-