Skip to content

Conversation

@xwduan
Copy link
Contributor

@xwduan xwduan commented Dec 2, 2025

  • init
  • fix tests

What changed?

Add workflowId parameter to namespace.ActiveClusterName api

Why?

So we can have different replication config for different workflowId.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

No risk.

@xwduan xwduan changed the title will/replace active cluster name Add workflowId parameter to namespace.ActiveClusterName api. Dec 2, 2025
Comment on lines 371 to +373
if ns.IsGlobalNamespace() &&
ns.ReplicationPolicy() == namespace.ReplicationPolicyMultiCluster &&
ns.ActiveClusterName() == e.currentClusterName {
ns.ActiveInCluster(e.currentClusterName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to think more about this. I am not sure if this is correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From code semantic, it is correct, because ActiveInCluster underlying calling ns.ActiveClusterName api. From logic perspective, you are right to question this. This is to detect the when the current cluster become active. We will introduce ns.StateChanged API to handle this case instead of using ns.ActiveClusterName.

}

return namespaceEntry.ActiveClusterName(), true
return namespaceEntry.ActiveClusterName(""), true
Copy link
Contributor

Choose a reason for hiding this comment

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

emptyWorkflowId here?

@xwduan xwduan marked this pull request as ready for review December 5, 2025 17:52
@xwduan xwduan requested review from a team as code owners December 5, 2025 17:52
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.

4 participants