Skip to content

Commit

Permalink
Update version peer recovery constants to 7_9 (#57829)
Browse files Browse the repository at this point in the history
The resilient recovery work introduced version dependent behavior and
serialization. This commit updates the version constants to indicate
that this work has been backported to 7.9.
  • Loading branch information
Tim-Brooks authored Jun 8, 2020
1 parent 7425edd commit 807e075
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/57827" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1042,12 +1042,11 @@ private enum ElasticsearchExceptionHandle {
org.elasticsearch.ingest.IngestProcessorException::new,
157,
Version.V_7_5_0),
// TODO: Version after backport
PEER_RECOVERY_NOT_FOUND_EXCEPTION(
org.elasticsearch.indices.recovery.PeerRecoveryNotFound.class,
org.elasticsearch.indices.recovery.PeerRecoveryNotFound::new,
158,
Version.V_8_0_0);
Version.V_7_9_0);

final Class<? extends ElasticsearchException> exceptionClass;
final CheckedFunction<StreamInput, ? extends ElasticsearchException, IOException> constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,7 @@ private void onException(Exception e) {
if (cause instanceof ConnectTransportException) {
logger.debug("delaying recovery of {} for [{}] due to networking error [{}]", request.shardId(),
recoverySettings.retryDelayNetwork(), cause.getMessage());
// TODO: Change after backport
if (request.sourceNode().getVersion().onOrAfter(Version.V_8_0_0)) {
if (request.sourceNode().getVersion().onOrAfter(Version.V_7_9_0)) {
reestablishRecovery(request, cause.getMessage(), recoverySettings.retryDelayNetwork());
} else {
retryRecovery(recoveryId, cause.getMessage(), recoverySettings.retryDelayNetwork(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.elasticsearch.indices.recovery;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.seqno.SequenceNumbers;
Expand All @@ -32,8 +33,7 @@ public abstract class RecoveryTransportRequest extends TransportRequest {

RecoveryTransportRequest(StreamInput in) throws IOException {
super(in);
// TODO: Change after backport
if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_9_0)) {
requestSeqNo = in.readLong();
} else {
requestSeqNo = SequenceNumbers.UNASSIGNED_SEQ_NO;
Expand All @@ -51,8 +51,7 @@ public long requestSeqNo() {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
// TODO: Change after backport
if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_9_0)) {
out.writeLong(requestSeqNo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public RemoteRecoveryTargetHandler(long recoveryId, ShardId shardId, TransportSe
.withType(TransportRequestOptions.Type.RECOVERY)
.withTimeout(recoverySettings.internalActionTimeout())
.build();
// TODO: Change after backport
this.retriesSupported = targetNode.getVersion().onOrAfter(Version.V_8_0_0);
this.retriesSupported = targetNode.getVersion().onOrAfter(Version.V_7_9_0);
}

@Override
Expand Down

0 comments on commit 807e075

Please sign in to comment.