Version Meta data
(1) When creating a document for the first time, its _version version number is 1, and each time the document is modified or deleted, it will automatically add 1 to this _version version number.
(2) When deleting a document, it is not immediately physically deleted, some of its version number and other information remains. Delete a document first, in the re-creation of this document, in fact, will be on the delete version base, and then add the version number 1
———————————————————————————————————————————————————————————————
Es in the background, many similar to replica synchronization requests, are multi-threaded asynchronous. In other words, multiple modification requests are disorderly, and may be modified first-to-first, modified after.
The multi-threaded asynchronous concurrency control inside ES is based on its own _version version number for optimistic locking concurrency control. When the thread modifies the operation, it compares the _version version number, modifies it if it wants to wait, or loses it if it is not equal, and the thread will no longer perform the modification operation.
Multi-threaded asynchronous concurrency control inside ES