Hi,
I'm using elasticsearch version 7.2.0 and implementing in my application the optimistic concurrency control with sequence number and primary term parameters.
As I understand, before these two parameters were introduiced, optimistic concurrency control was implemented wit hversion parameter.
So, these sequence number and primary term are meant to replace the version parameter (at least for internal versioning) .
The response to a "get" request includes the term and sequence number, and "get" requests are realtime, so as soon as a document has been indexed it will be visible to future gets against every in-sync shard copy. If you subsequently get a different version then it must be a later version.
The usual pattern for optimistic concurrency control is to get the latest version of a document (unconditionally) and then update it (conditionally on it not having changed) and for this you do not need a conditional read.
I think I was misleaded by the documentation about version parameter. Seeing that, I was expecting the same behaviour with the new parameters.
I suppose the "old" version parameter is still there to implement optimistic concurrency control with external versioning, is that right?
Also, does in this context document versioning and optimistic concurrency control mean the same thing?
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.