Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example of user’s service deployment request according to unified flow:

  1. Initiator sends DynamicServicesChangeRequestBatchMessage ServiceChangeBatchRequest request using discovery spi to change service state [deploy, undeploy]. The request will be stored by all nodes in own queue to be processed, event if the coordinator failed;
  2. All nodes process tasks from queue, when deployment request received each node calculates a new service’s assignments independently using deterministic assignments function and apply actions (deploy, undeploy) if needed, then node builds single deployments message ServicesSingleMapMessage ServiceSingleNodeDeploymentResult that contains services id and amount of instances were deployed on this single node and sends the message to coordinator (p2p);
  3. Once the coordinator receives all single deployments messages then it builds ServicesFullMapMessage that ServiceClusterDeploymentResult that contains services deployments across the cluster and sends the message through disco-spi to be processed by all nodes;

Messages

class DynamicServicesChangeRequestBatchMessage {

          Collection<DynamicServiceChangeRequest> reqs;

}

class DynamicServiceChangeRequest {

          IgniteUuid srvcId; // Unique service id (generates to deploy, existing used to undeploy)

          ServiceConfiguration cfg; // Empty in case of undeploy

          byte flags; // Change’s types flags [deploy, undeploy, etc.]

}

class ServicesSingleDeploymentsMessage {

...

  1. ;

...

          Map<IgniteUuid, ServiceSingleDeploymentsResults> results;

}

class ServiceSingleDeploymentsResults {

          int cnt; // Deployed instances count, 0 in case of undeploy

          Collection<byte[]> errors; // Serialized exceptions to avoid issues at spi-level

}

class ServicesFullDeploymentsMessage  {

          ServicesDeploymentProcessId depId;

          Collection<ServiceFullDeploymentsResults> results;

}

class ServiceFullDeploymentsResults {

          IgniteUuid srvcId;

          Map<UUID, ServiceSingleDeploymentsResults> results; // Per node

}

class ServicesDeploymentProcessId {

          AffinityTopologyVersion topVer;

          IgniteUuid reqId; // Unique id of custom discovery message

...

Coordinator change

All nodes handle requests of service’s state changes and put them into deployment queue, but only the coordinator aggregates single deployments messages received from nodes and builds a full deployments to finish exchange. If coordinator left or fail during deployment exchange another server node will become the coordinator and continue the process.

...