Idempotent Workflow Generation via Function Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed code executed across multiple computing devices often returns different output values due to varying device states, leading to unreliable results when restarted or executed multiple times, as existing methods fail to ensure consistency and idempotence.
Innovation Solution
The method involves detecting distributed code, separating boundary functions into transition, non-idempotent, and reversion functions, transforming non-idempotent functions into idempotent ones by generating flags, and combining these to form an idempotent workflow that can be executed multiple times without changing output values, even after errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If distributed code is executed multiple times or restarted, then the code can be re-executed after errors, but the output values become unreliable and inconsistent due to varying device states
Solution Approach 1:
The patent segments the distributed code execution into distinct phases: setup phase (executed once to initialize device states) and operation phase (can be re-executed). By separating the initialization operations from the main workflow operations, the system ensures that re-execution only affects the operation phase while maintaining consistent device states from the setup phase, thus achieving reliable and consistent output values across multiple executions.
Solution Approach 2:
The patent applies preliminary action by executing setup operations before the main workflow to establish consistent initial device states. These preliminary setup operations configure the computing devices in a known state before the actual workflow begins, ensuring that when the workflow is restarted or re-executed, the devices start from the same consistent state, thereby guaranteeing reliable and repeatable output values.
2Reliability
If operations are executed multiple times to handle errors, then error recovery is possible, but different return values are produced due to varying computing device states
Solution Approach 1:
The patent segments the workflow into setup operations that establish device states and subsequent operation that performs the actual work. When errors occur, only the operation phase needs to be re-executed while the setup phase results remain valid, ensuring that error recovery does not produce different return values as long as the device states established in the setup phase remain consistent.
Solution Approach 2:
The patent captures and stores the device states established during the setup phase as a reference configuration. When the workflow is restarted after errors, the system copies or restores these device states rather than re-initializing them, ensuring that the computing devices return to the exact same state as during the original successful execution, thereby guaranteeing identical return values upon successful completion.
Data Source
AI summary
Various methods and systems for generating an idempotent workflow are described herein. In one example, a method includes detecting distributed code and identifying a boundary function in the distributed code. The method can also include separating the boundary function into a transition function, a non-idempotent function, and a reversion function. Additionally, the method can include transforming the non-idempotent function into an idempotent function by generating a flag corresponding to the non-idempotent function, wherein the flag indicates if the non-idempotent function has been executed. Furthermore, the method can include combining the transition function, the idempotent function, and the reversion function to form the idempotent workflow.


