PR: Added update support to bulk api.#2983
Closed
martijnvg wants to merge 4 commits intoelastic:masterfrom
Closed
Conversation
Update requests can now be put in the bulk api. All update request options are supported.
Example usage:
```
curl -XPOST 'localhost:9200/_bulk' --date-binary @bulk.json
```
Contents of bulk.json that contains two update request items:
```
{ "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} }
{ "doc" : {"field" : "value"} }
{ "update" : { "_id" : "0", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} }
{ "script" : "counter += param1", "lang" : "js", "params" : {"param1" : 1}, "upsert" : {"counter" : 1}}
```
The `doc`, `upsert` and all script related options are part of the payload. The `retry_on_conflict` option is part of the header.
Closes elastic#2982
Give estimated size in bytes for update requests
…is used in a bulk update item.
Added more tests
Member
|
Awesome, really looking forward to this; thanks @martijnvg! |
breskeby
pushed a commit
to breskeby/elasticsearch
that referenced
this pull request
Feb 11, 2026
…osing (elastic#2983) This PR makes the Stateless#close method to first wait for IndicesService to finish closing before proceed. This change ensures the cache service remains available until all shard level activities are stopped. Previously it can lead to innocuous but verbose stacktraces in production. The PR also adds a test to demonstrate that a background merge no longer throws exceptions such as ClosedChannelException when the node is shutting down. Resolves: Relates: elastic#2646 Co-authored-by: Artem Prigoda <artem.prigoda@elastic.co>
breskeby
pushed a commit
to breskeby/elasticsearch
that referenced
this pull request
Feb 11, 2026
There are a few edge cases where closing a node can causes test failures: Closing the handling node when looking up master node name. Closing the coordinating node when a search is ongoing. This can lead to leaking search context in MockSearchService on the data nodes. Closing the data node when a search is ongoing. This can lead to leaking resource on the coordinating node. This PR fixes 1 by avoiding lookup since the master node does not change and is already known. It fixes 2 by always uses master node as the coordinating node. It fixes 3 by avoid restarting search node. With these changes in place (along with elastic#2790, elastic#2966, elastic#2983, elastic#112748, elastic#114375) the test is stable enough (running in a loop for 40+ hours without failure) to be unmuted. Resolves: elastic#2327 Resolves:
breskeby
pushed a commit
to breskeby/elasticsearch
that referenced
this pull request
Feb 11, 2026
…osing (elastic#2983) This PR makes the Stateless#close method to first wait for IndicesService to finish closing before proceed. This change ensures the cache service remains available until all shard level activities are stopped. Previously it can lead to innocuous but verbose stacktraces in production. The PR also adds a test to demonstrate that a background merge no longer throws exceptions such as ClosedChannelException when the node is shutting down. Resolves: Relates: elastic#2646 Co-authored-by: Artem Prigoda <artem.prigoda@elastic.co>
breskeby
pushed a commit
to breskeby/elasticsearch
that referenced
this pull request
Feb 11, 2026
There are a few edge cases where closing a node can causes test failures: Closing the handling node when looking up master node name. Closing the coordinating node when a search is ongoing. This can lead to leaking search context in MockSearchService on the data nodes. Closing the data node when a search is ongoing. This can lead to leaking resource on the coordinating node. This PR fixes 1 by avoiding lookup since the master node does not change and is already known. It fixes 2 by always uses master node as the coordinating node. It fixes 3 by avoid restarting search node. With these changes in place (along with elastic#2790, elastic#2966, elastic#2983, elastic#112748, elastic#114375) the test is stable enough (running in a loop for 40+ hours without failure) to be unmuted. Resolves: elastic#2327 Resolves:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR for #2982
Added support for the update operation in the bulk api.
Update requests can now be put in the bulk api. All update request options are supported.
Example usage:
Contents of bulk.json that contains two update request items:
The
doc,upsertand all script related options are part of the payload. Theretry_on_conflictoption is part of the header.