Skip to content

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented Oct 20, 2025

What changed?

  • Update active cluster manager with a new method to get current workflow state and active cluster selection policy
  • Fix auto-forwarding for active-active domains
  • Add new test case to simulation tests

Why?
Bug fix

How did you test it?
unit tests && simulation tests

Potential risks

Release notes

Documentation Changes

if actClSelPolicyForNewWF != nil {
policy.logger.Debug("Active cluster selection policy for new workflow", tag.WorkflowDomainName(domainEntry.GetInfo().Name), tag.OperationName(apiName), tag.Dynamic("policy", actClSelPolicyForNewWF))
activeClusterInfo, err := policy.activeClusterManager.GetActiveClusterInfoByClusterAttribute(ctx, domainEntry.GetInfo().ID, actClSelPolicyForNewWF.GetClusterAttribute())
if apiName == "SignalWithStartWorkflowExecution" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching on API name/string raises some red flags for me. I know they should be static and shouldn't change - but a change to the way we generate our APIs would cause a breaking change here.

Is there a way we could implement the logic without knowing which API is calling it? Perhaps just from the information we have in the non-api name parameters? Previously it was only used for logging tags.

e.g if the actClSelPolicyForNewWF is not nil we could always check for an an existing policy (as that covers the signalwithstart case as well).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a switch block which panics on fallthrough / default to ensure that we catch these failures noisily on refactor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would make it easier to track, but I'm not concerned about the refactor as much as I am maintaining this in a couple years when we try to change our proto gen, or someone copying this pattern elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to know the API name, because actClSelPolicyForNewWF can be empty for StartWorkflow and SignalWithStartWorkflow API. And the forwarding rules are API-based. The function needs to need the APIs directly or indirectly.

@Shaddoll Shaddoll merged commit b69dd78 into cadence-workflow:master Oct 21, 2025
41 checks passed
@Shaddoll Shaddoll deleted the aa branch October 21, 2025 21:13
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

Successfully merging this pull request may close these issues.

3 participants