Elastic Search Version Conflict

I am using an elastic search for search purpose. But recently I observer that some random error while adding data into elastic search. The error looks like:

version conflict, required seqNo [113789], primary term [19]. current document has seqNo [113797] and primary term [19]

The above type error comes randomly and I am not able to add/update data in elastic search. Can you please help to Understand :

  1. What is the root cause of this issue?
  2. How I can reproduce this issue? as this coming randomly need to know the basic step to reproduce this issue
  3. What is the solution for this? How I can solve this issue?

Kindly help me here

How are you indexing data into Elasticsearch? What is the source of the data?

Can you tell us about the cluster? Which version are you using? How large is it? Where is it deployed? What type of hardware?

Yes, we have indexing data into elastic search. we have cms in which user adding/updating/deleting documents and we are listening this events and adding data into elastic search.
We are using Mongo DB to fetch data in json format and then foramt it as per our elastic search mapping and add it into elastic search.

I am using Elastic search 6.8 version.

We are suing elastic search update_by_query and delete_by _query is because of that this issue is coming?

@Christian_Dahlqvist @warkolm Can you please help me here?

I suspect concurrently updating and deleting the same document by query might cause this. As far as I know both operations work based on a snapshot of the data as it was when the operation started, so if the operations take a long time and affect a large number of documents it is likely that version conflicts may be detected if multiple operations affect the same documents.

There seem to be a parameter determining how conflicts are handled, have you used this? If that does not help, have you considered altering the size of the update and delete requests?

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