Upsert Operation

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.5

Describe the issue:
Are Upsert operations atomic in OpenSearch?
According to this: Elasticsearch Upsert: Performing Upsert Operations, with Examples
under “Benefits of Using Upsert” → #2
" Consistency: By using upserts, you can ensure that your data remains consistent, even if multiple clients are attempting to update or insert the same document simultaneously. Upsert operations are atomic, which means that they are either fully completed or not executed at all, preventing partial updates or inserts"

Using .Net app with OpenSearch.Client

Relevant Logs or Screenshots:

Yeah, it’s atomic, upsert functionality in OpenSearch inherited from Elasticsearch.

I know OpenSearch inherited from Elasticsearch.
How can I make sure this is true? because I didn’t find in OpenSearch’s documentation anything related to that.
Also, every version of OpenSearch contains this atomicity in “upsert” operation? or only in certain versions? Because OpenSearch is a fork of ElasticSearch from a specific version.
I tried to look find that in the code but couldn’t.

Take a look here for OpenSearch documentation of upsert: Update document - OpenSearch documentation

As I mentioned above, there is no mention in the documentation of atomicity regarding the upsert operation… This is the reason I’m asking here

The upsert operation uses the “create” op_type: OpenSearch/server/src/main/java/org/opensearch/action/update/ at 074bc6a91c05a5ed0e3d36cd672c905b0bf023c3 · opensearch-project/OpenSearch · GitHub

I don’t see how this answers my question.
Anyway, I talked to AWS support that contacted OpenSearch development team, and this is their answer was that “upsert” update should be atomic.
Also if 2 different clients try to update the same document at the same time, and only one of t he two requests would run into a version conflict exception. The exception that would be thrown is “version_conflict_engine_exception”.

Thanks to all.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.