Skip to content

Remove dynamic objects from security index #40499

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

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

tvernum
Copy link
Contributor

@tvernum tvernum commented Mar 27, 2019

The security index had a few "object" types with

"dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Closes: #35460

The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

@tvernum
Copy link
Contributor Author

tvernum commented Mar 27, 2019

@jaymode Do you remember why we set dynamic: true on the metadata objects?
I know "rules" has it because I unthinkingly copied the metadata, but I think both are wrong.

@tvernum
Copy link
Contributor Author

tvernum commented Mar 27, 2019

This ends up being a trivial change because it's safe to change an index mapping to setdynamic to false on an existing object field.
That won't remove the mappings that were created while it was dynamic, but it will drop new ones from being created.

So this change doesn't fix the problem 100% because existing security indices might have some incorrect dynamic mappings, but it stops the problem from getting worse.

Copy link
Contributor

@albertzaharovits albertzaharovits left a comment

Choose a reason for hiding this comment

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

LGTM

@jaymode
Copy link
Member

jaymode commented Mar 27, 2019

Do you remember why we set dynamic: true on the metadata objects?

I do not recall the reasoning.

@colings86 colings86 added v6.7.2 and removed v6.7.1 labels Mar 30, 2019
@tvernum tvernum merged commit 3fcb5a8 into elastic:master Apr 1, 2019
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Apr 2, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: elastic#40499
tvernum added a commit that referenced this pull request Apr 5, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: #40499
tvernum added a commit to tvernum/elasticsearch that referenced this pull request Apr 5, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: elastic#40499
tvernum added a commit that referenced this pull request Apr 15, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: #40499
@tvernum tvernum added v7.0.1 and removed v7.0.0-rc2 labels Apr 29, 2019
@tvernum tvernum added v6.8.0 and removed v6.7.2 labels May 7, 2019
tvernum added a commit to tvernum/elasticsearch that referenced this pull request May 7, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: elastic#40499
tvernum added a commit that referenced this pull request May 7, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.

Backport of: #40499
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
The security index had a few "object" types with

   "dynamic": true

However, this automatically creates a mapping for each field that is
created within those objects. This means that types are dynamically
inferred and "locked in" for future updates.

Instead we want "dynamic": false which will allow us to store a range
of fields in these nested objects and retrieve them from the source,
without creating mapping types for those fields.
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.

.security index has dynamic mappings which can lead to errors
6 participants