Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow stage dedup #545

Open
RemindD opened this issue Nov 4, 2024 · 3 comments
Open

Workflow stage dedup #545

RemindD opened this issue Nov 4, 2024 · 3 comments
Labels
bug Something isn't working P0

Comments

@RemindD
Copy link
Contributor

RemindD commented Nov 4, 2024

In my opinion, the same stage for an activation should only be executed once.
However, there could be situations that the trigger event for the next stage is published but the trigger event for the current stage fails which could makes the trigger events for the next stage published twice. So we need a way to identity whether the stage has been processed and skip duplication.
A single idea is to track a number for stage index in an activation. And when saving stage status in stageHistory, symphony will check if a stage is already running or ran.

@msftcoderdjw
Copy link
Contributor

@msftcoderdjw msftcoderdjw added bug Something isn't working P0 labels Nov 28, 2024
@msftcoderdjw
Copy link
Contributor

@RemindD , let's discuss in details after you come back.

@RemindD
Copy link
Contributor Author

RemindD commented Dec 5, 2024

  • In current workflow, trigger event will
    1. persist running stage history in activation status
    2. run stage provider
    3. persist terminated stage history in activation status
    4. publish trigger event for the next stage if needed.
  • Add an index in the stageSpec as well as activationData indicating the number of the stage in the activation running history
    • used for stage dedup
    • used for indication of stage history truncation
  • Check the latest record in the stage history when persist stage history
    • If the latest record with a higher index, return badrequest
    • If the latest record with the same index, check if the status in stage history is running or terminated. If terminated, return badrequest as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0
Projects
None yet
Development

No branches or pull requests

2 participants