Skip to content
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

Expose workflow history size and count to client #5392

Merged
merged 18 commits into from
Sep 12, 2023

Conversation

timl3136
Copy link
Contributor

What changed?
Added fields regarding workflow history size and count in PollForDecisionResponse to be exposed to cadence-client.
History size will be exposed in unit of bytes and history count will be the number of completed events.
Added fields sending history data from cadence-history to cadence-matching when matching service calls the persistence layer.
Updated dependency for cadence-idl to include new fields in idl in sync with cadence-client.

Why?
There have been requests from customers wanting history information regarding workflow to be exposed in client so that they can optimize their workflow through methods like continueAsNew when approaching the history size limit.
Resolved cadence-client issue #917

How did you test it?
Standard unit test as well as tested in development environment.

Potential risks
Since we have added new fields to thrift and proto layer, there should not be any breaking change since new fields will be defaulted to 0. However, there remains the possibility that the change will result in thrift/proto field mismatch between serve and client hence result in information loss.

Release notes

Documentation Changes

Add mapper function

sync idl change of adding js

Remove logger and modify test due to thrift file change

Refractor HistorySize to TotalSizeBytes

sync cadence-idl
client/history/client.go Outdated Show resolved Hide resolved
common/types/matching.go Outdated Show resolved Hide resolved
common/types/history.go Outdated Show resolved Hide resolved
@@ -413,6 +413,7 @@ func CreateMatchingPollForDecisionTaskResponse(historyResponse *types.RecordDeci
ScheduledTimestamp: historyResponse.ScheduledTimestamp,
StartedTimestamp: historyResponse.StartedTimestamp,
Queries: historyResponse.Queries,
TotalHistoryBytes: historyResponse.HistorySize,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we expose historyCount?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the historyCount is equivalent to NextEventID - 1

@timl3136 timl3136 merged commit 9224e5d into uber:master Sep 12, 2023
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.

2 participants