Describe the bug/error/problem
I am getting this error sometimes while updating the index of user.
"error": "[409] {"error":{"root_cause":[{"type":"version_conflict_engine_exception","reason":"[2568]: version conflict, required seqNo [105769], primary term [1]. current document has seqNo [105774] and primary term [1]","index_uuid":"ZrDtgX8oQ4CP8hiIN8gIjQ","shard":"0","index":"users"}],"type":"version_conflict_engine_exception","reason":"[2568]: version conflict, required seqNo [105769], primary term [1]. current document has seqNo [105774] and primary term [1]","index_uuid":"ZrDtgX8oQ4CP8hiIN8gIjQ","shard":"0","index":"users"},"status":409}"
To Reproduce
Steps to reproduce the behavior:
Step 1:- update a document simultaneously 15-20 times, I am getting this bug and in my project I need to make this functional as we have so many things going on.
Your Environment (please complete the following information):
Yeah, this could lead to version conflicts, it is expected since one thread may try to update a document while another update on the same document wasn't finished yet.
This is as Leandro explained expected behaviour. Elasticsearch is not optimised for handling frequent updates to the same documents. In addition to version conflicts it can also lead to performance issues.
As far as I am aware there is no workaround, at least within Elasticsearch. I have seen users gather updates outside of Elasticsearch using some other data store and only periodically update Elasticsearch, but that off course is more complicated and adds a lag.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.