-
Notifications
You must be signed in to change notification settings - Fork 917
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
Mark state transition & completion metrics with namespace activeness #3831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change make metrics have a dip or spike during failover? When ns is active/passive in both clusters?
).Record( | ||
mutableState.GetExecutionInfo().StateTransitionCount, | ||
metrics.NamespaceTag(namespaceEntry.Name().String()), | ||
metrics.NamespaceStateTag(namespaceState(clusterMetadata, convert.Int64Ptr(mutableState.GetCurrentVersion()))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: MutableStateFailoverVersion(mutableState)?
} | ||
|
||
// default value, need to special handle | ||
if *mutableStateCurrentVersion == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think logic can be shorten as
if (*mutableStateCurrentVersion == 0) || clusterMetadata.IsVersionFromSameCluster(...) {
return namespaceStateActive
}
any reason to pass mutableStateCurrentVersion
as a pointer instead of just scalar value?
newWorkflowSnapshot *persistence.WorkflowSnapshot, | ||
newWorkflowEventsSeq []*persistence.WorkflowEvents, | ||
) (int64, error) | ||
|
||
ConflictResolveWorkflowExecution( | ||
ctx context.Context, | ||
conflictResolveMode persistence.ConflictResolveWorkflowMode, | ||
resetWorkflowFailoverVersion int64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just pass all FailoverVersions as int64 to be consistent here?
namespaceStateUnknown = "_unknown_" | ||
) | ||
|
||
func namespaceState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to something like getNamespaceState
What changed?
Why?
Better metrics
How did you test it?
Existing tests
Potential risks
N/A
Is hotfix candidate?
N/A