Skip to content

Commit a364f18

Browse files
committed
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
1 parent 97cd3fc commit a364f18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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_6_4_0)) {
154+
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
155155
out.writeList(getNodes());
156156
} else {
157157
clusterName.writeTo(out);

0 commit comments

Comments
 (0)