Add search attribute alias to field mapping to Namespace Detail for ElasticSearch #8634
+766
−216
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.
Add search attribute alias to field mapping to Namespace Detail for ElasticSearch.
Why?
Currently, when a Cluster is configured with ElasticSearch, search attribute registration via the Operator API
AddSearchAttributespersist the user aliased search attributes in the ClusterMetadata without writing to the Namespace Detail.ClusterMetadata is meant to list all pre-allocated custom search attribute column names and their types.
Search attributes are namespace scoped, registering at the ClusterMetadata level leads unexpected behavior.
What changed?
To support backwards compatibility with existing Clusters, existing search attributes in the ClusterMetadata must be replicated to each NamespaceDetail at startup.
All pre-allocated fields must be added to the ClusterMetadata, similar to existing SQL implementations.
How did you test it?