Skip to content

Commit e1ffbeb

Browse files
authored
Fix bad version check writing Repository nodes (elastic#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 elastic#30807
1 parent 4bd2607 commit e1ffbeb

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ setup:
5151

5252
---
5353
"Verify created repository":
54-
- skip:
55-
version: " - 6.99.99"
56-
reason: AwaitsFix for https://github.com/elastic/elasticsearch/issues/30807
5754
- do:
5855
snapshot.verify_repository:
5956
repository: test_repo_get_2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void readFrom(StreamInput in) throws IOException {
151151
@Override
152152
public void writeTo(StreamOutput out) throws IOException {
153153
super.writeTo(out);
154-
if (Version.CURRENT.onOrAfter(Version.V_7_0_0_alpha1)) {
154+
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
155155
out.writeList(getNodes());
156156
} else {
157157
clusterName.writeTo(out);

0 commit comments

Comments
 (0)