Skip to content

Conversation

@rodrigozhou
Copy link
Contributor

@rodrigozhou rodrigozhou commented May 3, 2023

What changed?
Fix adding multiple search attributes of same type at once.
Synched AdminHandler's code to add search attributes.
Added unit tests to operator handler.

Why?
#4160

When adding multiple search attributes of same type, it's missing a check to not use new mappings when trying to map a new search attribute. Eg: initially it maps Key1 to Field1 and then Key2 to Field1 again because it didn't check that Field1 is unavailable after Key1 was mapped.

How did you test it?
Added multiple search attributes with same type using Temporal CLI and tctl.
Added unit test.

Potential risks
No.

Is hotfix candidate?
No.

Copy link
Member

@yiminc yiminc left a comment

Choose a reason for hiding this comment

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

Could you add a unit test for this


customSearchAttributes := currentSearchAttributes.Custom()
dbCustomSearchAttributes := searchattribute.GetSqlDbIndexSearchAttributes().CustomSearchAttributes
cmCustomSearchAttributes := currentSearchAttributes.Custom()
Copy link
Contributor

Choose a reason for hiding this comment

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

What does cm stands for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cm = ClusterMetadata

@alexshtin
Copy link
Contributor

and yes, please add unit test.

@rodrigozhou rodrigozhou force-pushed the fix-add-search-attributes branch from c82656c to f35ae93 Compare May 10, 2023 22:21
@rodrigozhou rodrigozhou merged commit 2339531 into temporalio:master May 10, 2023
@rodrigozhou rodrigozhou deleted the fix-add-search-attributes branch May 10, 2023 23:01
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.

3 participants