-
Notifications
You must be signed in to change notification settings - Fork 216
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
Reduce SA bloat on GetVersion #1056
Reduce SA bloat on GetVersion #1056
Conversation
af7b0cf
to
08fa4c4
Compare
resolves: #1052 |
internal/internal_event_handlers.go
Outdated
// Server has a limit for the max size of a single search attribute value. If we exceed the default limit | ||
// do not try to upsert as it will cause the workflow to fail. | ||
updateSearchAttribute := true | ||
if wc.sdkFlags.tryUse(LimitChangeVersionSASize, !wc.isReplay) && len(attr.IndexedFields[TemporalChangeVersion].GetData()) >= changeVersionSearchAttrSizeLimit { |
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'll note this will change the behavior for new WFT not new workflows
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.
LGTM, but would like either @Sushisource or @bergundy to review the SDK flag behavior just in case.
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.
Looking good
// If a flag is not recognized (value is too high or not defined), it must fail the workflow task | ||
return false, "", nil, errors.New("could not recognize SDK flag") |
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.
Hmm, I'm actually not doing this currently and probably should.
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.
oh that reminds me I wanted to add a test for this case, I'll do that quickly
// TODO(maxim): Refactor to return a struct instead of multiple parameters | ||
func (eh *history) NextCommandEvents() (result []*historypb.HistoryEvent, markers []*historypb.HistoryEvent, binaryChecksum string, err error) { | ||
func (eh *history) NextCommandEvents() (result []*historypb.HistoryEvent, markers []*historypb.HistoryEvent, binaryChecksum string, sdkFlags []sdkFlag, err error) { |
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.
Might be a good time to do this TODO
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 did try this and didn't find it to much cleaner because this code uses named return values heavily
Reduce SA bloat on GetVersion. This PR implements 3 new features to the Go SDK.
GetVersion
if that search attribute would exceed the default size limit