4. Decentralized Execution of Distributed Adaptations
4.4. The Decentralized Coordination Protocol
4.4.1. Protocol Messages
The protocol messages used for the execution of an adaptation transaction can be sep- arated into two categories: Transaction Control Messages and Execution Control Mes- sages. The first category is used for the distribution of general progress information, i.e., if an adaptation transaction’s execution failed or if it could be finished successfully. Exe- cution Control Messages are used explicitly for the coordination of adaptation groups and adaptation operations. All messages are solely exchanged between adaptation managers during the distribution and execution of an adaptation transaction and are introduced
4.4. The Decentralized Coordination Protocol here to relief further discussions of the protocol behavior from the discussion of used pro- tocol messages. The parameters and information transmitted via each transaction control message and execution control message is illustrated in Appendix B.1 and Appendix B.2, respectively.
Transaction Control Messages
Transaction control messages are used to distribute adaptation transactions within the group of nodes affected by the adaptation process and to indicate a successful or failed execution of the adaptation transaction. Four message types serving that purpose can be distinguished:
Transaction Message This message is used to distribute the adaptation transaction that is supposed to be executed among the adaptation managers of the self-adaptive software system required to perform adaptation operations. The message, therefore, contains only one adaptation transaction, which includes the unique identifier for the adaptation transaction used by all other messages to relate them to a specific adaptation transaction.
TransactionAcknowledgement Message This message contains the identifier of the trans- action and indicates that the transmitted adaptation transaction was received suc- cessfully.
TransactionRollback Message This message is used to indicate that the execution of the adaptation transaction has failed and that preliminary pre-activation-phase adaptations have to be rolled back in order to maintain a consistent configuration of the managed application, which is the source configuration. Besides the identifier of the adaptation transaction, the unique identifier of the adaptation operation that caused the rollback is transmitted as well.
TransactionActivation Message This message is used by the adaptation managers to in- dicate that all adaptation operations involving the respective adaptation manager’s collaboration were executed successfully and that expected remote progress infor- mation, i.e., Report messages, which will be discussed subsequently, was received. Thus, the execution of the adaptation transaction was evaluated to be performed successfully, which is indicated by that message. Evidently, the identifier of the adaptation transaction that is acknowledged to be successfully executed is the sole parameter of this message.
Execution Control Messages
The execution control messages are most important for the coordination protocol with respect to the management of the adaptation transaction’s decentralized execution. Dif- ferent types of messages are used to disseminate progress and status information among adaptation managers as well as internal state information of roles to ensure the con- sistent execution of single adaptation operations. Additionally, a third message type is required to cope with cases in which one of the aforementioned messages was lost during the transmission.
Report Adaptation managers rely on this message to exchange progress information on the execution of distributed adaptation operations, i.e., the message is used by adaptation managers responsible for adaptations denoted by the source and target node, respectively. Furthermore, the Report message is used to distribute progress information on the successful execution of adaptation operations within the execu- tion of an adaptation group. A Report message contains the unique identifier of the adaptation operation about which status information is exchanged or propagated as well as the identifier of the adaptation transaction, the respective adaptation op- eration belongs to. For the transmitted status information within the report, three mutually exclusive flags are required that indicate when set whether the respective adaptation operation could be successfully performed or not or if the operation is still being executed. The third flag is required especially if pre-activation-phase operations such as the passivation of a role, consume a larger amount of time that extends beyond the timeout period of the adaptation manager’s execution behavior. In that case, the status value contains a manifestation representing the operation to be still going on.
StateTransfer The distributed operations allow to transfer state information of the role from the source to the target configuration. A StateTransfer message contains the identifiers of the adaptation operation and of the adaptation transaction in which it is executed as well as internal state information of the source node’s role instance. We assume the state information of a role to be obtainable only when the role is in a passive state, i.e., no computations are being performed that may alter the role’s internal state. Therefore, the StateTransfer message can be used as a replacement for the report message to reduce the number of messages an adaptation manager on the source node has to transmit to its peer on the target node. For example, transmitting a StateTransfer message from the source node of a migrate operation immediately means that the steps of the adaptation on the source side
4.4. The Decentralized Coordination Protocol could successfully be performed. Otherwise, a negative report message would be used.
RequestReportMessage During the execution of distributed operations and adaptation groups, Report and StateTransfer messages are exchanged to coordinate the adap- tation progress among adaptation managers. In case of link or stopping failures, adaptation managers may not receive sent coordination messages or may not be able to send coordination messages, respectively. In that case, adaptation managers make use of the RequestReport message to request progress information on adapta- tion operations of which respective reports are missing. Depending on the concrete type of the adaptation operation a report is requested for, the peer answers with either StateTransfer or Report messages. A RequestReport message takes the iden- tifier of the adaptation transaction as input and a number of adaptation operation identifiers for which reports are requested to be retransmitted.