- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
Allow dynamic defaults in mappings of managed system indices #133262
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
Conversation
| 
           Pinging @elastic/es-data-management (Team:Data Management)  | 
    
| 
           Hi @jimczi, I've created a changelog YAML for you.  | 
    
| 
           Pinging @elastic/es-core-infra (Team:Core/Infra)  | 
    
System indices with non-dynamic mappings normally reject `put mapping` requests that attempt to modify the mapping of a managed index. However, for fields like `dense_vector` and `semantic_text`, some mapping options depend on the shape of the ingested data. The first ingestion often requires a dynamic update to set these defaults. To support this for system indices, this change marks the relevant `put mapping` requests as originating from bulk ingestion, which bypasses the system index mapping check. This is safe because: * such updates are already validated against invalid dynamic updates, and * an error would be raised earlier if a new field is added when `dynamic` is disabled. Fixes elastic#133171 naming
fa20dc3    to
    9705810      
    Compare
  
    | 
           A couple of questions to clarify: 
  | 
    
          
 It is, see below. 
 Yes, see elasticsearch/server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java Line 185 in 515e680 
 It is called as part of the bulk action if a dynamic update is needed. For the check, see Line 228 in 515e680 
 The idea is that put mapping requests are not checked for system index violations if they are generated by the system indirectly.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM
System indices with non-dynamic mappings normally reject
put mappingrequests that attempt to modify the mapping of a managed index.However, for fields like
dense_vectorandsemantic_text, some mapping options depend on the shape of the ingested data. The first ingestion often requires a dynamic update to set these defaults.To support this for system indices, this change marks the relevant
put mappingrequests as originating from bulk ingestion, which bypasses the system index mapping check. This is safe because:dynamicis disabled.Fixes #133171