浏览代码

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
Jay Modi 5 年之前
父节点
当前提交
12789604b2

+ 2 - 2
build.gradle

@@ -219,8 +219,8 @@ task verifyVersions {
  * after the backport of the backcompat code is complete.
  */
 
-boolean bwc_tests_enabled = false
-final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/52385" /* place a PR link here when committing bwc changes */
+boolean bwc_tests_enabled = true
+final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
 if (bwc_tests_enabled == false) {
   if (bwc_tests_disabled_issue.isEmpty()) {
     throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

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

@@ -272,7 +272,7 @@ public final class ThreadContext implements Writeable {
     }
 
     public static List<String> readAllowedSystemIndices(StreamInput in) throws IOException {
-        if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO update version on backport
+        if (in.getVersion().onOrAfter(Version.V_7_7_0)) {
             return in.readOptionalStringList();
         } else {
             return emptyList();
@@ -663,7 +663,7 @@ public final class ThreadContext implements Writeable {
             }
 
             out.writeMap(responseHeaders, StreamOutput::writeString, StreamOutput::writeStringCollection);
-            if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO update version on backport
+            if (out.getVersion().onOrAfter(Version.V_7_7_0)) {
                 out.writeOptionalStringCollection(allowedSystemIndexPatterns);
             }
         }

+ 6 - 6
test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

@@ -2369,15 +2369,15 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 assertEquals(1, transportStats.getRxCount());
                 assertEquals(2, transportStats.getTxCount());
                 assertEquals(25, transportStats.getRxSize().getBytes());
-                assertEquals(111, transportStats.getTxSize().getBytes());
+                assertEquals(113, transportStats.getTxSize().getBytes());
             });
             sendResponseLatch.countDown();
             responseLatch.await();
             stats = serviceC.transport.getStats(); // response has been received
             assertEquals(2, stats.getRxCount());
             assertEquals(2, stats.getTxCount());
-            assertEquals(50, stats.getRxSize().getBytes());
-            assertEquals(111, stats.getTxSize().getBytes());
+            assertEquals(52, stats.getRxSize().getBytes());
+            assertEquals(113, stats.getTxSize().getBytes());
         } finally {
             serviceC.close();
         }
@@ -2484,7 +2484,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
                 assertEquals(1, transportStats.getRxCount());
                 assertEquals(2, transportStats.getTxCount());
                 assertEquals(25, transportStats.getRxSize().getBytes());
-                assertEquals(111, transportStats.getTxSize().getBytes());
+                assertEquals(113, transportStats.getTxSize().getBytes());
             });
             sendResponseLatch.countDown();
             responseLatch.await();
@@ -2498,8 +2498,8 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
             String failedMessage = "Unexpected read bytes size. The transport exception that was received=" + exception;
             // 49 bytes are the non-exception message bytes that have been received. It should include the initial
             // handshake message and the header, version, etc bytes in the exception message.
-            assertEquals(failedMessage, 53 + streamOutput.bytes().length(), stats.getRxSize().getBytes());
-            assertEquals(111, stats.getTxSize().getBytes());
+            assertEquals(failedMessage, 55 + streamOutput.bytes().length(), stats.getRxSize().getBytes());
+            assertEquals(113, stats.getTxSize().getBytes());
         } finally {
             serviceC.close();
         }