Move watcher to use seq# and primary term for concurrency control#37977
Move watcher to use seq# and primary term for concurrency control#37977bleskes merged 12 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-core-features |
...main/java/org/elasticsearch/xpack/watcher/transport/actions/put/TransportPutWatchAction.java
Show resolved
Hide resolved
| if (isUpdate) { | ||
| UpdateRequest updateRequest = new UpdateRequest(Watch.INDEX, Watch.DOC_TYPE, request.getId()); | ||
| updateRequest.version(request.getVersion()); | ||
| if (request.getIfSeqNo() != SequenceNumbers.UNASSIGNED_SEQ_NO) { |
There was a problem hiding this comment.
why is this one not guarded by
if (clusterService.state().nodes().getMinNodeVersion().onOrAfter(Version.V_7_0_0)) {
but the one in TransportAckWatchAction is?
There was a problem hiding this comment.
this one let's the user decide which feature they use. The one in the ack watch action is internal and needs to make a decision on their own.
|
what about
|
spinscale
left a comment
There was a problem hiding this comment.
few questions for clarification, but in general it looks good
I don't see any versioning support there. Am I missing something?
That's what I was thinking. |
|
Thx @spinscale & @jakelandis.
The idea is to remove it indeed once I backport this all. |
…r-primary-term * elastic/master: Mute failing date index name processor test Reenable BWC testing after retention lease stats (elastic#38062) Move watcher to use seq# and primary term for concurrency control (elastic#37977) ILM setPriority corrections for a 0 value (elastic#38001) Temporarily disable BWC for retention lease stats (elastic#38049) Skip Shrink when numberOfShards not changed (elastic#37953) Add dispatching to `HandledTransportAction` (elastic#38050) Update httpclient for JDK 11 TLS engine (elastic#37994) Reduce flaxiness of ccr recovery timeouts test (elastic#38035) Fix ILM status to allow unknown fields (elastic#38043) Fix ILM Lifecycle Policy to allow unknown fields (elastic#38041) Update verify repository to allow unknown fields (elastic#37619) [ML] Datafeed deprecation checks (elastic#38026) Deprecate minimum_master_nodes (elastic#37868)
After backporting elastic#37977, elastic#37857 and elastic#37872
…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
…equests and UpdateRequest After backporting elastic#37977, elastic#37857 and elastic#37872
Watcher uses internal versioning to make sure a watch isn't changed when updating a status. This PR moves that logic to sequence numbers and opens up the option for users to also use seq# in the put watch API.
Relates #37872
Relates #10708