-
Notifications
You must be signed in to change notification settings - Fork 25.2k
update fails silently if script and doc update are both in one line #34069
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
Comments
The bulk api uses a hand rolled parser that is quite complex. Only the main actions (delete, create, index, update) are looked for. My hunch is the success you got is not silently ignore script failure, but never even parsing the script portion, likely due to the scope of the slice parser used to parse the update portion (see BulkRequest line ~419). |
Pinging @elastic/es-distributed |
#29293 changed behaviour in 7.0 - it is not possible to specify bulk request as
unnecessary for 7.0 both following cases throw validation exception like you've got
and
|
@rjernst problem in UpdateRequest#fromXContent and how it parses |
Elasticsearch version (
bin/elasticsearch --version
): 6.4.1Plugins installed: []
JVM version (
java -version
): OpenJDK 64-bit Server VM 10.0.2OS version (
uname -a
if on a Unix-like system): Linux 4.15.0-34-generic #37-Ubuntu SMPDescription of the problem including expected versus actual behavior:
If you (accidentally) include both a
script
and anupdate:doc
action in a bulk update, it does not always return the appropriate error and can fail to execute a script silently.Steps to reproduce:
Setup:
The expected behaviour - when both
script
andupdate:doc
actions are used in this order:Elasticsearch correctly responds with the error:
But if you switch the order putting
update:doc
first, thenscript
:It returns successfully:
But only the update has been done, and the
script
section has been silently ignored:It would be good to
update:doc
andscript
are provided regardless of orderThe text was updated successfully, but these errors were encountered: