-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Handle missing content in incremental bulk #133685
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-distributed-indexing (Team:Distributed Indexing) |
test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java
Show resolved
Hide resolved
DaveCTurner
left a comment
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.
LGTM
|
|
||
| public void testIncrementalBulkMissingContent() { | ||
| assertThrows( | ||
| ElasticsearchParseException.class, |
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.
nit: could we also assert the exception message here? We're catching the empty body, not the lack of a content-type.
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.
Sorry, pressed merge button too soon. Addressed in new PR #133855
💔 Some backports could not be created
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
(cherry picked from commit 36de99b)
|
@DaveCTurner, I'm backporting to 9.1, should I backport to 8.19? |
Yes I think so, we want to reinstate the old behaviour in 8.19 too. |
Actually I haven't checked whether this is needed in 8.19, and there were certainly some changes in this area that only landed in 8.19. |
|
Incremental stuff is disabled by default in 8.x, but NPE can happen. The problem is missing machinery for content detection at Rest layer. This part landed together with moving aggregator into Rest layer. 8.x still aggregates by netty. I would fix it if anyone complains about it in 8.x. |
Incremental bulk does not check if content is missing, and can throw NPE on xContentType.
Non-incremental path checks through
ReleasableBytesReference content = request.requiredContent();.This PR adds explicit check for content presence in the incremental processing path.
ES-12591