-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Track external payloads stats for workflow execution #8775
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
Track external payloads stats for workflow execution #8775
Conversation
9390400 to
c7d356a
Compare
c6237a3 to
dc31bb8
Compare
dc31bb8 to
ac1098d
Compare
| paginateItems = append(paginateItems, nextBatch) | ||
|
|
||
| // Calculate and accumulate external payload size and count for this batch of history events | ||
| if r.shard.GetConfig().ExternalPayloadsEnabled(namespaceName) { |
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: feel like checking the flag once per page/request is also good enough. no strong opinion.
| ms.executionInfo.LastFirstEventTxnId = historyNodeTxnIDs[index] | ||
|
|
||
| // Calculate and add the external payload size and count for this batch | ||
| if ms.config.ExternalPayloadsEnabled(ms.GetNamespaceEntry().Name().String()) { |
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.
I wonder if we should reset the size & count if the feature flag is disabled.
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.
We can exclude it from the results of DescribeWorkflowExecution, but not sure if resetting would make this better. We still need to explicitly retrigger the recomputation of it, if it somehow gets computed incorrectly.
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.
We still need to explicitly retrigger the recomputation of it
How do we know if recomputation is needed for an execution if the feature flag get disabled and then enabled?
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.
But having those fields set tot 0, is also not a good indicator that the recomputation is necessary.
93fe315 to
2f2c759
Compare
2f2c759 to
b67ab26
Compare
## What changed? Added external payload stats (size and count) to DescribeWorkflowExecution. Also change and add functional tests. **This PR depends on Server PR #8775 and API PR temporalio/api#689 ## Why? We'd like to surface the external payload stats when DescribeWorkflowExecution is called to see how many and what size of external payloads the workflow is referencing. Numbers are coming from the workflow mutable state. This is similar to how the HistorySize is kept. ## How did you test it? - [X] built - [ ] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [X] added new functional test(s)
What changed?
Keep the total number and the size of the external payloads per the workflow execution
Why?
We are working on building the support for external payloads in SDK, which are stored outside of Temporal. We'd like to be able to show the total size and the number of external payloads in the given workflow execution.
How did you test it?
Potential risks
N/A