I have a 3 node cluster and i have workflow we i create or update the document . I using the groovy script for both create and update . In the update request i set scripted_upsert = true.
My understanding is if the document does not exists script will create it as (scripted_upsert is set to true) . If the document exists it will update it .
I my case , two nodes tried to send the update request concurrently to with scripted_upsert set to true for same document id . One update request seems to have overwritten the other. In this should't the one request create the document and second one update it (with loosing any data) . I am passing retry_on_conflicts as 3 in the update request.