Skip to content

Commit c52f7f3

Browse files
authored
Enable bwc tests and adjust versioning. (#66004)
Relates to #64710
1 parent 2d743dd commit c52f7f3

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ tasks.register("verifyVersions") {
175175
* after the backport of the backcompat code is complete.
176176
*/
177177

178-
boolean bwc_tests_enabled = false
179-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/65999" /* place a PR link here when committing bwc changes */
178+
boolean bwc_tests_enabled = true
179+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
180180
if (bwc_tests_enabled == false) {
181181
if (bwc_tests_disabled_issue.isEmpty()) {
182182
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public DataStreamTemplate(boolean hidden) {
300300
}
301301

302302
DataStreamTemplate(StreamInput in) throws IOException {
303-
hidden = in.getVersion().onOrAfter(DataStream.HIDDEN_VERSION) && in.readBoolean();
303+
hidden = in.getVersion().onOrAfter(DataStream.NEW_DS_VERSION) && in.readBoolean();
304304
}
305305

306306
public String getTimestampField() {
@@ -321,7 +321,7 @@ public boolean isHidden() {
321321

322322
@Override
323323
public void writeTo(StreamOutput out) throws IOException {
324-
if (out.getVersion().onOrAfter(DataStream.HIDDEN_VERSION)) {
324+
if (out.getVersion().onOrAfter(DataStream.NEW_DS_VERSION)) {
325325
out.writeBoolean(hidden);
326326
}
327327
}

server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@
4343
public final class DataStream extends AbstractDiffable<DataStream> implements ToXContentObject {
4444

4545
public static final String BACKING_INDEX_PREFIX = ".ds-";
46-
public static final Version HIDDEN_VERSION = Version.V_7_11_0;
47-
public static final Version REPLICATED_VERSION = Version.V_8_0_0;
46+
47+
/**
48+
* The version when data stream metadata, hidden data streams and replicated data streams was introduced.
49+
*/
50+
public static final Version NEW_DS_VERSION = Version.V_7_11_0;
4851

4952
private final String name;
5053
private final TimestampField timeStampField;
@@ -190,9 +193,9 @@ public static String getDefaultBackingIndexName(String dataStreamName, long gene
190193

191194
public DataStream(StreamInput in) throws IOException {
192195
this(in.readString(), new TimestampField(in), in.readList(Index::new), in.readVLong(),
193-
in.getVersion().onOrAfter(Version.V_7_11_0) ? in.readMap(): null,
194-
in.getVersion().onOrAfter(HIDDEN_VERSION) && in.readBoolean(),
195-
in.getVersion().onOrAfter(REPLICATED_VERSION) && in.readBoolean());
196+
in.getVersion().onOrAfter(NEW_DS_VERSION) ? in.readMap(): null,
197+
in.getVersion().onOrAfter(NEW_DS_VERSION) && in.readBoolean(),
198+
in.getVersion().onOrAfter(NEW_DS_VERSION) && in.readBoolean());
196199
}
197200

198201
public static Diff<DataStream> readDiffFrom(StreamInput in) throws IOException {
@@ -205,13 +208,9 @@ public void writeTo(StreamOutput out) throws IOException {
205208
timeStampField.writeTo(out);
206209
out.writeList(indices);
207210
out.writeVLong(generation);
208-
if (out.getVersion().onOrAfter(Version.V_7_11_0)) {
211+
if (out.getVersion().onOrAfter(NEW_DS_VERSION)) {
209212
out.writeMap(metadata);
210-
}
211-
if (out.getVersion().onOrAfter(HIDDEN_VERSION)) {
212213
out.writeBoolean(hidden);
213-
}
214-
if (out.getVersion().onOrAfter(REPLICATED_VERSION)) {
215214
out.writeBoolean(replicated);
216215
}
217216
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DeleteDataStreamAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public Request(StreamInput in) throws IOException {
6868
super(in);
6969
this.names = in.readStringArray();
7070
this.wildcardExpressionsOriginallySpecified = in.getVersion().onOrAfter(Version.V_7_10_0) && in.readBoolean();
71-
if (in.getVersion().onOrAfter(DataStream.HIDDEN_VERSION)) {
71+
if (in.getVersion().onOrAfter(DataStream.NEW_DS_VERSION)) {
7272
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
7373
}
7474
}
@@ -80,7 +80,7 @@ public void writeTo(StreamOutput out) throws IOException {
8080
if (out.getVersion().onOrAfter(Version.V_7_10_0)) {
8181
out.writeBoolean(wildcardExpressionsOriginallySpecified);
8282
}
83-
if (out.getVersion().onOrAfter(DataStream.HIDDEN_VERSION)) {
83+
if (out.getVersion().onOrAfter(DataStream.NEW_DS_VERSION)) {
8484
indicesOptions.writeIndicesOptions(out);
8585
}
8686
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public ActionRequestValidationException validate() {
5656
public Request(StreamInput in) throws IOException {
5757
super(in);
5858
this.names = in.readOptionalStringArray();
59-
if (in.getVersion().onOrAfter(DataStream.HIDDEN_VERSION)) {
59+
if (in.getVersion().onOrAfter(DataStream.NEW_DS_VERSION)) {
6060
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
6161
}
6262
}
@@ -65,7 +65,7 @@ public Request(StreamInput in) throws IOException {
6565
public void writeTo(StreamOutput out) throws IOException {
6666
super.writeTo(out);
6767
out.writeOptionalStringArray(names);
68-
if (out.getVersion().onOrAfter(DataStream.HIDDEN_VERSION)) {
68+
if (out.getVersion().onOrAfter(DataStream.NEW_DS_VERSION)) {
6969
indicesOptions.writeIndicesOptions(out);
7070
}
7171
}

0 commit comments

Comments
 (0)