Skip to content

Commit

Permalink
Remove unnecessary BwC in StatelessPrimaryRelocationAction (elastic#1…
Browse files Browse the repository at this point in the history
…05538)

There are no remaining clusters using this action with the pre-8.11.x
transport protocol so we can remove the BwC here.
  • Loading branch information
DaveCTurner authored Feb 15, 2024
1 parent 2caf17c commit fb71c6d
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.indices.recovery;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
Expand Down Expand Up @@ -49,11 +48,7 @@ public Request(StreamInput in) throws IOException {
shardId = new ShardId(in);
targetNode = new DiscoveryNode(in);
targetAllocationId = in.readString();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_11_X)) {
clusterStateVersion = in.readVLong();
} else {
clusterStateVersion = 0L; // temporary bwc: do not wait for cluster state to be applied
}
clusterStateVersion = in.readVLong();
}

@Override
Expand All @@ -68,9 +63,7 @@ public void writeTo(StreamOutput out) throws IOException {
shardId.writeTo(out);
targetNode.writeTo(out);
out.writeString(targetAllocationId);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_11_X)) {
out.writeVLong(clusterStateVersion);
} // temporary bwc: just omit it, the receiver doesn't wait for a cluster state anyway
out.writeVLong(clusterStateVersion);
}

public long recoveryId() {
Expand Down

0 comments on commit fb71c6d

Please sign in to comment.