-
Notifications
You must be signed in to change notification settings - Fork 35
Support ES7.0, use primary_term and seq_no for job doc versioning #5
Support ES7.0, use primary_term and seq_no for job doc versioning #5
Conversation
@@ -188,16 +188,16 @@ public void postIndex(ShardId shardId, Engine.Index index, Engine.IndexResult re | |||
|
|||
ShardNodes shardNodes = new ShardNodes(localNodeId, shardNodeIds); | |||
if (shardNodes.isOwningNode(index.id())) { | |||
this.sweep(shardId, index.id(), result.getVersion(), index.source()); | |||
this.sweep(shardId, index.id(), result.getVersion(), index.source(), result.getTerm(), result.getSeqNo()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass in the JobDocVersion instead of all 3 properties separately to reduce parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored to pass JobDocVersion
@@ -218,7 +219,7 @@ void sweep(ShardId shardId, String docId, Long version, BytesReference jobSource | |||
this.sweptJobs.put(shardId, jobVersionMap); | |||
} | |||
jobVersionMap.compute(docId, (id, currentVersion) -> { | |||
JobDocVersion newJobVersion = new JobDocVersion(primaryTerm, seqNo, version); | |||
JobDocVersion newJobVersion = new JobDocVersion(version.getPrimaryTerm(), version.getSeqNo(), version.getVersion()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to do this? Just use the given version from parameter for comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, fixed this silly code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
*Issue #4 *
Description of changes: This change updates the JobScheduler plugin to build with Elasticsearch 7.0, and make the change to use document primary_term and seq_no for job versioning, which is a breaking change introduced in ES7.0.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.