-
Notifications
You must be signed in to change notification settings - Fork 132
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
Calculate workflow history size and count and expose that to client #1270
Conversation
d838f8d
to
c2a5c26
Compare
Add logger to get whole history sync js change in idl and remove logger add history size and logger into task handlers Update reference to cadence-idl, sync field name with idl repo update idl ref
c2a5c26
to
a6034c9
Compare
…y size after processing every history event
…ratio for monitoring
e91c244
to
dc6dac5
Compare
internal/internal_event_handlers.go
Outdated
@@ -1379,3 +1384,139 @@ func (weh *workflowExecutionEventHandlerImpl) handleSignalExternalWorkflowExecut | |||
|
|||
return nil | |||
} | |||
|
|||
func (weh *workflowExecutionEventHandlerImpl) estimateHistorySize(event *m.HistoryEvent) int { |
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.
This function doesn't need to be attached to *workflowExecutionEventHandlerImpl
. it only uses weh.logger
which can be passed as argument. So please make this a standalone function and move to internal_utils.go as well as other helper functions you added below. This file is already huge (like many others in internal package unfortunately) and we will slowly refactor each type into its own file.
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.
Moved in latest commit
…ber-go#1270) Enable client side estimated history size exposure via API
Hi, after upgrading to
Similarly for
Is this just a case of the added |
That's right. It's being addressed in #1300 |
What changed?
Add fields exposing workflow history size and count to client in form of api calls. Client side now will calculate the history size of a workflow while processing events using size of the immutable fields and a constant buffer to account for smaller fields that might change to avoid non-determinism.
Combined with server change that emits history data to client #5392 that will be used to compare against. now customers can access their workflow history data and decide whether creating a ContinueAsNew workflow base on that information.
Why?
Due to Cadence history limit, many customers find their workflow being terminated and there is currently no mechanisms for customer to know their workflow's history usage.
Resolves issues #917
How did you test it?
The code is tested pairing with server code implementation on development environment
Potential risks
In the worst case, the server might not have the latest update with transmitting the history data to client. In that case, the sanity check (not yet implemented) might failed.