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

Why does worker not support uninstalling or updating WorkflowType? #5425

Open
1059915154 opened this issue Oct 19, 2023 · 3 comments
Open

Why does worker not support uninstalling or updating WorkflowType? #5425

1059915154 opened this issue Oct 19, 2023 · 3 comments

Comments

@1059915154
Copy link

Is your feature request related to a problem? Please describe.
My requirement requires work support for uninstalling or updating workflowType, and I need to check if they are registered through workflow name.

Proposed Solution

  1. Provide an API for uninstalling workflowType.
  2. Provide APIs for updating workflow types.
  3. Provide an API for querying whether registered through workflow name.

Additional context
I have implemented these locally.

@1059915154
Copy link
Author

I implement these functions based on the registry structure cache mapping.

@3vilhamster
Copy link
Contributor

3vilhamster commented Oct 19, 2023

Hey. Could you elaborate what is your usecase?
I'm not sure I understand.

  1. Cadence provide a way to schedule workflow executions and is meant to tolerate a single server outage with a retry. I don't think deregistering is an intended behaviour. How would Cadence react if the workflow started and you decided to uninstall workflowType?
  2. All workflows should be idempotent, so running them again with the same arguments should lead to the same result, for any changes your code should use versioning to ensure replayability. How can Cadence ensure the replayability of workflows if you update workflowType?
  3. This could make sense, though I'm not sure I understand the usecase.

@1059915154
Copy link
Author

@3vilhamster Thanks.
My scenario is to combine multiple HTTP interfaces into a workflow, including registering, uninstalling, or updating workflows. I require the entire process to be dynamic, rather than sending new versions every time changes are made.
I have already implemented the corresponding requirements locally. The general processing process is as follows:

  1. Dynamically generate corresponding functions based on GO plugins, where each plugin corresponds to a complete workflow processing logic.
  2. Dynamically register, uninstall, or update workflows based on the above functions, although cadence currently does not support uninstallation or update workflows. So I implemented it by modifying the cadence source code, first defining three interfaces in the cadence/worker that correspond to uninstallation, update, and detecting whether the workflow has been registered through name. Then implement these three interfaces in cadence/internal/registry, mainly based on a series of operations on registry.workflowFuncMap.

I am not sure if dynamic updates or uninstallations are suitable for long-term or scheduled workflows. But in my scenario, it seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants