diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index 16b760507324d..7e1032df49851 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -7,5 +7,6 @@ ES_BUILD_JAVA=openjdk12 ES_RUNTIME_JAVA=java11 GRADLE_TASK=build +GRADLE_EXTRA_ARGS=-Dtests.bwc.refspec.7.x=peer-recovery-retention-leases-7.x diff --git a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java index 1fb91d6abeadd..256fe571a24e5 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java @@ -489,7 +489,7 @@ public synchronized void renewPeerRecoveryRetentionLeases() { * create peer recovery retention leases for every shard copy. TODO create leases lazily in that situation. */ assert checkpoints.get(shardRouting.allocationId().getId()).tracked == false - || indexSettings.getIndexVersionCreated().before(Version.V_8_0_0); + || indexSettings.getIndexVersionCreated().before(Version.V_7_4_0); return false; } return retentionLease.timestamp() <= renewalTimeMillis @@ -742,7 +742,7 @@ private boolean invariant() { if (primaryMode && indexSettings.isSoftDeleteEnabled() && indexSettings.getIndexMetaData().getState() == IndexMetaData.State.OPEN - && indexSettings.getIndexVersionCreated().onOrAfter(Version.V_8_0_0)) { + && indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_4_0)) { // all tracked shard copies have a corresponding peer-recovery retention lease for (final ShardRouting shardRouting : routingTable.assignedShards()) { if (checkpoints.get(shardRouting.allocationId().getId()).tracked) { @@ -910,7 +910,7 @@ public synchronized void activatePrimaryMode(final long localCheckpoint) { * We might have got here here via a rolling upgrade from an older version that doesn't create peer recovery retention * leases for every shard copy, but in this case we do not expect any leases to exist. */ - if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_8_0_0)) { + if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_4_0)) { // We are starting up the whole replication group from scratch: if we were not (i.e. this is a replica promotion) then // this copy must already be in-sync and active and therefore holds a retention lease for itself. assert routingTable.activeShards().equals(Collections.singletonList(primaryShard)) : routingTable.activeShards();