Fix off-by-one on CCR lease (#58158)
The leases issued by CCR keep one extra operation around on the leader shards. This is not harmful to the leader cluster, but means that there's potentially one delete that can't be cleaned up.
This commit is contained in:
parent
a5bc5ae030
commit
1e235a7f55
|
@ -603,7 +603,7 @@ public class CcrRetentionLeaseIT extends CcrIntegTestCase {
|
|||
// we assert that retention leases are being advanced
|
||||
assertThat(
|
||||
retentionLease.retainingSequenceNumber(),
|
||||
equalTo(leaderGlobalCheckpoints.get(shardsStats.get(i).getShardRouting().id())));
|
||||
equalTo(leaderGlobalCheckpoints.get(shardsStats.get(i).getShardRouting().id()) + 1));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -455,7 +455,7 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollo
|
|||
CcrRetentionLeases.asyncAddRetentionLease(
|
||||
params.getLeaderShardId(),
|
||||
retentionLeaseId,
|
||||
followerGlobalCheckpoint.getAsLong(),
|
||||
followerGlobalCheckpoint.getAsLong() + 1,
|
||||
remoteClient(params),
|
||||
wrappedListener);
|
||||
} catch (NoSuchRemoteClusterException rce) {
|
||||
|
@ -480,7 +480,7 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollo
|
|||
CcrRetentionLeases.asyncRenewRetentionLease(
|
||||
params.getLeaderShardId(),
|
||||
retentionLeaseId,
|
||||
followerGlobalCheckpoint.getAsLong(),
|
||||
followerGlobalCheckpoint.getAsLong() + 1,
|
||||
remoteClient(params),
|
||||
listener);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue