Class DecommissionService

java.lang.Object
org.opensearch.cluster.decommission.DecommissionService

public class DecommissionService extends Object
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 Details

  • 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 as DecommissionStatus.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 action
      listener - register decommission listener
    • startRecommissionAction

      public void startRecommissionAction(org.opensearch.core.action.ActionListener<DeleteDecommissionStateResponse> listener)