Skip to content

Add preflight check to dynamic mapping updates#48867

Merged
DaveCTurner merged 1 commit intoelastic:7.xfrom
DaveCTurner:2019-11-05-preflight-mapping-updates-7x-backport
Nov 5, 2019
Merged

Add preflight check to dynamic mapping updates#48867
DaveCTurner merged 1 commit intoelastic:7.xfrom
DaveCTurner:2019-11-05-preflight-mapping-updates-7x-backport

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

Today if the primary discovers that an indexing request needs a mapping update
then it will send it to the master for validation and processing. If, however,
the put-mapping request is invalid then the master still processes it as a
(no-op) cluster state update. When there are a large number of indexing
operations that result in invalid mapping updates this can overwhelm the
master.

However, the primary already has a reasonably up-to-date mapping against which
it can check the (approximate) validity of the put-mapping request before
sending it to the master. For instance it is not possible to remove fields in a
mapping update, so if the primary detects that a mapping update will exceed the
fields limit then it can reject it itself and avoid bothering the master.

This commit adds a pre-flight check to the mapping update path so that the
primary can discard obviously-invalid put-mapping requests itself.

Fixes #35564
Backport of #48817

Today if the primary discovers that an indexing request needs a mapping update
then it will send it to the master for validation and processing. If, however,
the put-mapping request is invalid then the master still processes it as a
(no-op) cluster state update. When there are a large number of indexing
operations that result in invalid mapping updates this can overwhelm the
master.

However, the primary already has a reasonably up-to-date mapping against which
it can check the (approximate) validity of the put-mapping request before
sending it to the master. For instance it is not possible to remove fields in a
mapping update, so if the primary detects that a mapping update will exceed the
fields limit then it can reject it itself and avoid bothering the master.

This commit adds a pre-flight check to the mapping update path so that the
primary can discard obviously-invalid put-mapping requests itself.

Fixes elastic#35564
@DaveCTurner DaveCTurner added >enhancement :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. backport v7.6.0 labels Nov 5, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (:Distributed/CRUD)

@DaveCTurner
Copy link
Copy Markdown
Member Author

Build failed due to #48700

@elasticmachine run elasticsearch-ci/1

@DaveCTurner DaveCTurner merged commit bd5c6c4 into elastic:7.x Nov 5, 2019
@DaveCTurner DaveCTurner deleted the 2019-11-05-preflight-mapping-updates-7x-backport branch November 5, 2019 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement v7.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants