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

Move search attribute validator and mapper calls to frontend service #2476

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Feb 8, 2022

What changed?
Move search attribute validator and mapper calls to frontend service.

Why?
Calling search attributes mapper from history engine cause them to be mapped twice in case if workflow is started from command (child workflow and continue as new).

How did you test it?
Existing tests.

Potential risks
No risks.

Is hotfix candidate?
Maybe.

@alexshtin alexshtin requested a review from a team as a code owner February 8, 2022 03:02
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 verify that the start child event recorded in parent shows its alias (user visible) search attribute and not the actual field name (user invisible). And also the child's start workflow event.

@alexshtin
Copy link
Member Author

alexshtin commented Feb 8, 2022

It doesn't. The design is to map alias to field name right away and use actual field name everywhere down the road. History events and mutable state, both store search attributes using actual field name. On the way out (GetWorkflowExecutionHistory or Poll* API) they get substituted back to aliases.

@@ -423,6 +423,8 @@ func (c *temporalImpl) startFrontend(hosts map[string][]string, startWG *sync.Wa
fx.Provide(func() authorization.JWTAudienceMapper { return nil }),
fx.Provide(func() client.FactoryProvider { return client.NewFactoryProvider() }),
fx.Provide(func() searchattribute.Mapper { return nil }),
// Comment the line above and uncomment the line bellow to test with search attributes mapper.
// fx.Provide(func() searchattribute.Mapper { return NewSearchAttributeTestMapper() }),
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason it cannot test the sa mapper by default?

Copy link
Member Author

Choose a reason for hiding this comment

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

This will require rewrite of all tests to use aliases instead of actual search attribute field names. Ideally, I would create another test suite and setup another cluster there but this requires massive integration tests refactoring.

@yiminc yiminc closed this Feb 9, 2022
@yiminc yiminc reopened this Feb 9, 2022
@alexshtin alexshtin merged commit 670d99c into temporalio:master Feb 9, 2022
@alexshtin alexshtin deleted the feature/move-sa-mapper-to-fe branch February 9, 2022 03:49
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.

3 participants