Forráskód Böngészése

Fix bad version check writing Repository nodes (#30846)

The writeTo method of VerifyRepositoryResponse incorrectly used its
local version to determine what it was receiving, rather than the
sender's version. This fixes a bug that ocassionally happened when a 6.4
master node sent data to a 7.0 client, causing the number of bytes to be
improperly read. This also unmutes the test.

Closes #30807
Michael Basnight 7 éve
szülő
commit
e1ffbeb824

+ 0 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml

@@ -51,9 +51,6 @@ setup:
 
 ---
 "Verify created repository":
-  - skip:
-      version:     " - 6.99.99"
-      reason:      AwaitsFix for https://github.com/elastic/elasticsearch/issues/30807
   - do:
       snapshot.verify_repository:
         repository: test_repo_get_2

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java

@@ -151,7 +151,7 @@ public class VerifyRepositoryResponse extends ActionResponse implements ToXConte
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);
-        if (Version.CURRENT.onOrAfter(Version.V_7_0_0_alpha1)) {
+        if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
             out.writeList(getNodes());
         } else {
             clusterName.writeTo(out);