A computer program product in a non-transitory computer readable medium for use in a data processing system for managing a state machine comprising a main component, and one or more sub-components, wherein the main component maintains, for each sub-component, a log of events associated with transitions in states of the main component and the one or more sub-components, the computer program product holding computer program instructions executed by the data processing system and operative to:
- for each sub-component, and in response to occurrence of an event that causes the sub-component to transition state, determine whether the event supersedes or reverses a prior event previously logged in association with a state transition of the sub-component;
- upon determining that the event supersedes or reverses the prior event previously logged in association with a state transition, prune the prior event from the log to generate a pruned log;
- upon joinder or re-joinder to the state machine of a given sub-component, and prior to the main component initiating a replay operation for the given sub-component, the replay operation replaying one or more events recorded by the main component while the given sub-component is not connected to the state machine, force the given sub-component into an initial state;
- and
- thereafter, and during the replay operation, use the pruned log to transition the given sub-component from its initial state to a time-consistent state associated with the main component.