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

Use search attribute type map in visibility archival #4304

Merged
merged 2 commits into from
May 9, 2023

Conversation

MichaelSnowden
Copy link
Contributor

What changed?
We now populate search attributes with type information before archiving them.

Why?
This information is not always embedded in the fields themselves, e.g., for schedules. This fixes #4270 .

How did you test it?
I reproduced the linked issue without this change, and then verified that it worked after this change. I repro'd by doing this:

  1. Check out 1.20.2
  2. Start a server pointing at pg12 and s3
  3. Archive a scheduled workflow
  4. Observe that an invalid search attribute type: Unspecified error is thrown before this change.

Potential risks
Unclear.

Is hotfix candidate?
The community should be notified that this bug existed, and that they should upgrade to fix it.


ExpectArchiveHistory bool
ExpectArchiveVisibility bool
ExpectedMetrics []expectedMetric
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed these and the log recorder messages because they're too much of a pain to maintain

if err != nil {
return err
}

// It is safe to pass nil to typeMap here because search attributes type must be embedded by caller.
Copy link
Member

Choose a reason for hiding this comment

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

comment should change since we're not passing nil anymore

Comment on lines 47 to 48
"go.uber.org/fx"
"go.uber.org/multierr"
Copy link
Member

Choose a reason for hiding this comment

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

put these imports up higher in the third party section

@@ -212,8 +219,13 @@ func (a *archiver) archiveVisibility(ctx context.Context, request *Request, logg
return err
}

saTypeMap, err := a.searchAttributeProvider.GetSearchAttributes(a.visibilityManager.GetIndexName(), false)
Copy link
Member

Choose a reason for hiding this comment

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

maybe: comment about why we're calling this here? not sure if it's necessary

Copy link
Contributor

@rodrigozhou rodrigozhou left a comment

Choose a reason for hiding this comment

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

Please, address @dnr comments.

@MichaelSnowden MichaelSnowden force-pushed the snowden/archival-fix branch from 07bc8b2 to 153d613 Compare May 9, 2023 23:05
@MichaelSnowden MichaelSnowden enabled auto-merge (squash) May 9, 2023 23:27
@MichaelSnowden MichaelSnowden merged commit 9f66510 into master May 9, 2023
@MichaelSnowden MichaelSnowden deleted the snowden/archival-fix branch May 9, 2023 23:32
rodrigozhou pushed a commit that referenced this pull request May 13, 2023
* Use search attribute type map in visibility archival

* pr comments
rodrigozhou pushed a commit that referenced this pull request May 16, 2023
* Use search attribute type map in visibility archival

* pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

archival + task error after migration from 1.19.1 to 1.20.0
3 participants