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
This commit is contained in:
Michael Basnight 2018-05-24 19:21:57 -05:00 committed by GitHub
parent 4bd2607597
commit e1ffbeb824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -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

View File

@ -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);