Skip to content

Commit 1278960

Browse files
authored
Update version for serialization of allowed system indices (#53085)
This commit updates the serialization for allowed system indices after the backport of the work and also re-enables bwc compatibility tests. Relates #52385 Relates #53035 Relates #53062
1 parent 82c645e commit 1278960

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

build.gradle

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

222-
boolean bwc_tests_enabled = false
223-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/52385" /* place a PR link here when committing bwc changes */
222+
boolean bwc_tests_enabled = true
223+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
224224
if (bwc_tests_enabled == false) {
225225
if (bwc_tests_disabled_issue.isEmpty()) {
226226
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

server/src/main/java/org/elasticsearch/common/util/concurrent/ThreadContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public static Tuple<Map<String, String>, Map<String, Set<String>>> readHeadersFr
272272
}
273273

274274
public static List<String> readAllowedSystemIndices(StreamInput in) throws IOException {
275-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO update version on backport
275+
if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
276276
return in.readOptionalStringList();
277277
} else {
278278
return emptyList();
@@ -663,7 +663,7 @@ private void writeTo(StreamOutput out, Map<String, String> defaultHeaders) throw
663663
}
664664

665665
out.writeMap(responseHeaders, StreamOutput::writeString, StreamOutput::writeStringCollection);
666-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO update version on backport
666+
if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
667667
out.writeOptionalStringCollection(allowedSystemIndexPatterns);
668668
}
669669
}

test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,15 +2369,15 @@ public String executor() {
23692369
assertEquals(1, transportStats.getRxCount());
23702370
assertEquals(2, transportStats.getTxCount());
23712371
assertEquals(25, transportStats.getRxSize().getBytes());
2372-
assertEquals(111, transportStats.getTxSize().getBytes());
2372+
assertEquals(113, transportStats.getTxSize().getBytes());
23732373
});
23742374
sendResponseLatch.countDown();
23752375
responseLatch.await();
23762376
stats = serviceC.transport.getStats(); // response has been received
23772377
assertEquals(2, stats.getRxCount());
23782378
assertEquals(2, stats.getTxCount());
2379-
assertEquals(50, stats.getRxSize().getBytes());
2380-
assertEquals(111, stats.getTxSize().getBytes());
2379+
assertEquals(52, stats.getRxSize().getBytes());
2380+
assertEquals(113, stats.getTxSize().getBytes());
23812381
} finally {
23822382
serviceC.close();
23832383
}
@@ -2484,7 +2484,7 @@ public String executor() {
24842484
assertEquals(1, transportStats.getRxCount());
24852485
assertEquals(2, transportStats.getTxCount());
24862486
assertEquals(25, transportStats.getRxSize().getBytes());
2487-
assertEquals(111, transportStats.getTxSize().getBytes());
2487+
assertEquals(113, transportStats.getTxSize().getBytes());
24882488
});
24892489
sendResponseLatch.countDown();
24902490
responseLatch.await();
@@ -2498,8 +2498,8 @@ public String executor() {
24982498
String failedMessage = "Unexpected read bytes size. The transport exception that was received=" + exception;
24992499
// 49 bytes are the non-exception message bytes that have been received. It should include the initial
25002500
// handshake message and the header, version, etc bytes in the exception message.
2501-
assertEquals(failedMessage, 53 + streamOutput.bytes().length(), stats.getRxSize().getBytes());
2502-
assertEquals(111, stats.getTxSize().getBytes());
2501+
assertEquals(failedMessage, 55 + streamOutput.bytes().length(), stats.getRxSize().getBytes());
2502+
assertEquals(113, stats.getTxSize().getBytes());
25032503
} finally {
25042504
serviceC.close();
25052505
}

0 commit comments

Comments
 (0)