Skip to content

Commit

Permalink
Adapt minimum versions for seq# power operations
Browse files Browse the repository at this point in the history
  • Loading branch information
bleskes committed Feb 1, 2019
1 parent 54bbb72 commit 748c13e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Update with if_seq_no":

- skip:
version: " - 6.99.99"
reason: if_seq_no was added in 7.0
version: " - 6.6.99"
reason: if_seq_no was added in 6.7.0

- do:
catch: missing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ public void readFrom(StreamInput in) throws IOException {
docAsUpsert = in.readBoolean();
version = in.readLong();
versionType = VersionType.fromValue(in.readByte());
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
}
Expand Down Expand Up @@ -960,7 +960,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(docAsUpsert);
out.writeLong(version);
out.writeByte(versionType.getValue());
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void readFrom(StreamInput in) throws IOException {
} else {
version = Versions.MATCH_ANY;
}
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
ifSeqNo = in.readZLong();
ifPrimaryTerm = in.readVLong();
} else {
Expand All @@ -228,7 +228,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
out.writeZLong(version);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
out.writeZLong(ifSeqNo);
out.writeVLong(ifPrimaryTerm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(id);
out.writeVLong(version);
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
out.writeZLong(seqNo);
out.writeVLong(primaryTerm);
}
Expand All @@ -122,7 +122,7 @@ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
version = in.readVLong();
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
seqNo = in.readZLong();
primaryTerm = in.readVLong();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void readFrom(StreamInput in) throws IOException {
} else {
version = Versions.MATCH_ANY;
}
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
seqNo = in.readZLong();
primaryTerm = in.readVLong();
}
Expand All @@ -124,7 +124,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
out.writeZLong(version);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
if (out.getVersion().onOrAfter(Version.V_6_7_0)) {
out.writeZLong(seqNo);
out.writeVLong(primaryTerm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ setup:
---
"Test putting a watch with a redacted password with old seq no returns an error":
- skip:
version: " - 6.99.99"
reason: seq no powered concurrency was added in 7.0.0
version: " - 6.6.99"
reason: seq no powered concurrency was added in 6.7.0

# version 1
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected void masterOperation(AckWatchRequest request, ClusterState state,

UpdateRequest updateRequest = new UpdateRequest(Watch.INDEX, Watch.DOC_TYPE, request.getWatchId());
// this may reject this action, but prevents concurrent updates from a watch execution
if (clusterService.state().nodes().getMinNodeVersion().onOrAfter(Version.V_7_0_0)) {
if (clusterService.state().nodes().getMinNodeVersion().onOrAfter(Version.V_6_7_0)) {
updateRequest.setIfSeqNo(getResponse.getSeqNo());
updateRequest.setIfPrimaryTerm(getResponse.getPrimaryTerm());
} else {
Expand Down

0 comments on commit 748c13e

Please sign in to comment.