Fix create custom search attribute with SQL DB #3951
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Iterate over the pre-allocated custom search attributes instead of the map from cluster metadata.
Why?
Cluster metadata might have custom search attributes created by user previously in standard visibility. With current logic, it's possible that an alias will be mapped to those custom search attributes created by the user instead of the pre-allocated ones created by Server.
How did you test it?
Start server with std visibility, create search attribute, restart server with adv visibility, and create search attribute with same type. Checked it does not use the one I created previously.
Potential risks
No risks.
Is hotfix candidate?
No.