Skip to content

Commit 5ccb3b6

Browse files
authored
Ignore isJoda flag from 7x nodes (#53481)
when upgrading from 7.7+ ES will send out a flag indicating if a pattern is of joda style. This is only used to support joda style indices in 7.x, in 8 we no longer support this. All indices in 8 should use java style pattern. Hence we can ignore this flag. Similarly when writing from v8 to v7.7+ we should always send false flag. relates #52555 relates #53478 closes #53477
1 parent 77ec60b commit 5ccb3b6

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ task verifyVersions {
221221
* after the backport of the backcompat code is complete.
222222
*/
223223

224-
boolean bwc_tests_enabled = false
225-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/issues/53477" /* place a PR link here when committing bwc changes */
224+
boolean bwc_tests_enabled = true
225+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
226226
if (bwc_tests_enabled == false) {
227227
if (bwc_tests_disabled_issue.isEmpty()) {
228228
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

server/src/main/java/org/elasticsearch/search/DocValueFormat.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.lucene.document.InetAddressPoint;
2323
import org.apache.lucene.util.BytesRef;
24+
import org.elasticsearch.Version;
2425
import org.elasticsearch.common.io.stream.NamedWriteable;
2526
import org.elasticsearch.common.io.stream.StreamInput;
2627
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -201,6 +202,13 @@ public DateTime(StreamInput in) throws IOException {
201202
String zoneId = in.readString();
202203
this.timeZone = ZoneId.of(zoneId);
203204
this.resolution = DateFieldMapper.Resolution.ofOrdinal(in.readVInt());
205+
if (in.getVersion().onOrAfter(Version.V_7_7_0) && in.getVersion().before(Version.V_8_0_0)) {
206+
/* when deserialising from 7.7+ nodes expect a flag indicating if a pattern is of joda style
207+
This is only used to support joda style indices in 7.x, in 8 we no longer support this.
208+
All indices in 8 should use java style pattern. Hence we can ignore this flag.
209+
*/
210+
in.readBoolean();
211+
}
204212
}
205213

206214
@Override
@@ -213,6 +221,13 @@ public void writeTo(StreamOutput out) throws IOException {
213221
out.writeString(formatter.pattern());
214222
out.writeString(timeZone.getId());
215223
out.writeVInt(resolution.ordinal());
224+
if (out.getVersion().onOrAfter(Version.V_7_7_0) && out.getVersion().before(Version.V_8_0_0)) {
225+
/* when serializing to 7.7+ send out a flag indicating if a pattern is of joda style
226+
This is only used to support joda style indices in 7.x, in 8 we no longer support this.
227+
All indices in 8 should use java style pattern. Hence this flag is always false.
228+
*/
229+
out.writeBoolean(false);
230+
}
216231
}
217232

218233
@Override

0 commit comments

Comments
 (0)