Skip to content

Commit e85dcb4

Browse files
authored
Remove already exist assertion while renew ccr lease (#46009)
If a CCR lease is disappeared while we are renewing it, then we will issue asyncAddRetentionLease to add that lease. And if asyncAddRetentionLease takes longer than retentionLeaseRenewInterval, then we can issue another asyncAddRetentionLease request. One of asyncAddRetentionLease requests will fail with RetentionLeaseAlreadyExistsException, hence trip the assertion. Closes #45192
1 parent 59003f1 commit e85dcb4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardFollowTasksExecutor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.elasticsearch.index.engine.CommitStats;
4545
import org.elasticsearch.index.engine.Engine;
4646
import org.elasticsearch.index.seqno.RetentionLeaseActions;
47-
import org.elasticsearch.index.seqno.RetentionLeaseAlreadyExistsException;
4847
import org.elasticsearch.index.seqno.RetentionLeaseNotFoundException;
4948
import org.elasticsearch.index.seqno.SeqNoStats;
5049
import org.elasticsearch.index.shard.ShardId;
@@ -439,7 +438,6 @@ protected Scheduler.Cancellable scheduleBackgroundRetentionLeaseRenewal(final Lo
439438
* going on. Log it, and renew again after another renew interval has passed.
440439
*/
441440
final Throwable innerCause = ExceptionsHelper.unwrapCause(inner);
442-
assert innerCause instanceof RetentionLeaseAlreadyExistsException == false;
443441
logRetentionLeaseFailure(retentionLeaseId, innerCause);
444442
}));
445443
} else {

0 commit comments

Comments
 (0)