Add Seq# based optimistic concurrency control to UpdateRequest#37872
Merged
bleskes merged 20 commits intoelastic:masterfrom Jan 29, 2019
Merged
Add Seq# based optimistic concurrency control to UpdateRequest#37872bleskes merged 20 commits intoelastic:masterfrom
bleskes merged 20 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-distributed |
ywelsch
approved these changes
Jan 28, 2019
docs/reference/docs/update.asciidoc
Outdated
|
|
||
| `if_seq_no` and `if_primary_term`:: | ||
|
|
||
| Update operations can be made optional and only be performed if the last |
Contributor
There was a problem hiding this comment.
you mean "conditional" and not "optional"?
Contributor
Author
There was a problem hiding this comment.
good question. I took this over from the text in IndexRequest. I can change all if you prefer.
| if (ifPrimaryTerm == UNASSIGNED_PRIMARY_TERM && ifSeqNo != UNASSIGNED_SEQ_NO) { | ||
| validationException = addValidationError("ifSeqNo is set, but primary term is [0]", validationException); | ||
| } | ||
| if (ifPrimaryTerm != UNASSIGNED_PRIMARY_TERM && ifSeqNo == UNASSIGNED_SEQ_NO) { |
Contributor
There was a problem hiding this comment.
these 3 conditions are the same as for index request. Can we share this code?
Contributor
Author
There was a problem hiding this comment.
yeah. I now changed to take another approach which I also took in a future PR for something else. Let me know if you prefer it.
| } | ||
|
|
||
| /** | ||
| * only perform this update request if the document was last modification was assigned the given |
Contributor
There was a problem hiding this comment.
something wrong with this sentence (same for some of these other docs here and in the requestbuilder class)
dnhatn
approved these changes
Jan 28, 2019
server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/get/ShardGetService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/get/ShardGetService.java
Outdated
Show resolved
Hide resolved
Contributor
Author
bleskes
added a commit
to bleskes/elasticsearch
that referenced
this pull request
Jan 31, 2019
bleskes
added a commit
to bleskes/elasticsearch
that referenced
this pull request
Feb 1, 2019
…ic#37872) The update request has a lesser known support for a one off update of a known document version. This PR adds an a seq# based alternative to power these operations. Relates elastic#36148 Relates elastic#10708
bleskes
added a commit
to bleskes/elasticsearch
that referenced
this pull request
Feb 1, 2019
After backporting elastic#37977, elastic#37857 and elastic#37872
bleskes
added a commit
that referenced
this pull request
Feb 1, 2019
bleskes
added a commit
that referenced
this pull request
Feb 1, 2019
…37872 (#38155) * Move update and delete by query to use seq# for optimistic concurrency control (#37857) The delete and update by query APIs both offer protection against overriding concurrent user changes to the documents they touch. They currently are using internal versioning. This PR changes that to rely on sequences numbers and primary terms. Relates #37639 Relates #36148 Relates #10708 * Add Seq# based optimistic concurrency control to UpdateRequest (#37872) The update request has a lesser known support for a one off update of a known document version. This PR adds an a seq# based alternative to power these operations. Relates #36148 Relates #10708 * Move watcher to use seq# and primary term for concurrency control (#37977) * Adapt minimum versions for seq# power operations After backporting #37977, #37857 and #37872
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Feb 1, 2019
…ersion * elastic/master: SnapshotShardsService Simplifications (elastic#38025) Default include_type_name to false in the yml test harness. (elastic#38058) Disable bwc preparing to backport of#37977, elastic#37857 and elastic#37872 (elastic#38126) Adding ml_settings entry to HLRC and Docs for deprecation_info (elastic#38118)
bleskes
added a commit
to bleskes/elasticsearch
that referenced
this pull request
Feb 1, 2019
…equests and UpdateRequest After backporting elastic#37977, elastic#37857 and elastic#37872
jasontedor
added a commit
to bleskes/elasticsearch
that referenced
this pull request
Feb 1, 2019
* elastic/master: AwaitsFix testAbortedSnapshotDuringInitDoesNotStart (elastic#38227) Preserve ILM operation mode when creating new lifecycles (elastic#38134) Enable trace log in FollowerFailOverIT (elastic#38148) SnapshotShardsService Simplifications (elastic#38025) Default include_type_name to false in the yml test harness. (elastic#38058) Disable bwc preparing to backport of#37977, elastic#37857 and elastic#37872 (elastic#38126)
jasontedor
added a commit
to AthenaEryma/elasticsearch
that referenced
this pull request
Feb 1, 2019
* elastic/master: (54 commits) Introduce retention leases versioning (elastic#37951) Correctly disable tests for FIPS JVMs (elastic#38214) AwaitsFix testAbortedSnapshotDuringInitDoesNotStart (elastic#38227) Preserve ILM operation mode when creating new lifecycles (elastic#38134) Enable trace log in FollowerFailOverIT (elastic#38148) SnapshotShardsService Simplifications (elastic#38025) Default include_type_name to false in the yml test harness. (elastic#38058) Disable bwc preparing to backport of#37977, elastic#37857 and elastic#37872 (elastic#38126) Adding ml_settings entry to HLRC and Docs for deprecation_info (elastic#38118) Replace awaitBusy with assertBusy in atLeastDocsIndexed (elastic#38190) Adjust SearchRequest version checks (elastic#38181) AwaitsFix testClientSucceedsWithVerificationDisabled (elastic#38213) Zen2ify RareClusterStateIT (elastic#38184) ML: Fix error race condition on stop _all datafeeds and close _all jobs (elastic#38113) AwaitsFix PUT mapping with _doc on an index that has types (elastic#38204) Allow built-in monitoring_user role to call GET _xpack API (elastic#38060) Update geo_shape docs to include unsupported features (elastic#38138) [ML] Remove "8" prefixes from file structure finder timestamp formats (elastic#38016) Disable bwc tests while backporting elastic#38104 (elastic#38182) Enable TLSv1.3 by default for JDKs with support (elastic#38103) ...
jasontedor
pushed a commit
that referenced
this pull request
Feb 2, 2019
bleskes
added a commit
that referenced
this pull request
Feb 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The update request has a lesser known support for a one off update of a known document version. This PR adds an a seq# based alternative to power these operations.
Relates #36148
Relates #10708