Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BWC version for PRRLs #43958

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a risk that we forget to remove this when we merge these branches to master. The consequence will be that master builds start to use peer-recovery-retention-leases-7.x rather than 7.x, which will fail when:

  • we delete the peer-recovery-retention-leases-7.x, or
  • we introduce a BWC-affecting change to master and 7.x (but, of course not to peer-recovery-retention-leases-7.x)

I think we'll catch this mistake pretty quickly, but if it's a concern then ideas for machinery to fail the build sooner are welcome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine



Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,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
Expand Down Expand Up @@ -729,7 +729,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) {
Expand Down Expand Up @@ -897,7 +897,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();
Expand Down