mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Don't log on RetentionLeaseSync error handler (#58157)
After an index has been deleted it may take some time to cancel all the maintenance tasks such as RetentionLeaseSync, it's possible that the task is already executing before the cancellation. This commit just avoids logging a warning message for those scenarios. Closes #57864 Backport of (#58098)
This commit is contained in:
parent
423697f414
commit
a5bc5ae030
server/src/main/java/org/elasticsearch/index/seqno
@ -39,6 +39,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.gateway.WriteStateException;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.index.shard.IndexShard;
|
||||
import org.elasticsearch.index.shard.IndexShardClosedException;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -137,8 +138,11 @@ public class RetentionLeaseBackgroundSyncAction extends TransportReplicationActi
|
||||
// node shutting down
|
||||
return;
|
||||
}
|
||||
if (ExceptionsHelper.unwrap(e, AlreadyClosedException.class, IndexShardClosedException.class) != null) {
|
||||
// the shard is closed
|
||||
if (ExceptionsHelper.unwrap(e,
|
||||
IndexNotFoundException.class,
|
||||
AlreadyClosedException.class,
|
||||
IndexShardClosedException.class) != null) {
|
||||
// the index was deleted or the shard is closed
|
||||
return;
|
||||
}
|
||||
getLogger().warn(new ParameterizedMessage("{} retention lease background sync failed", shardId), e);
|
||||
|
@ -41,6 +41,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.gateway.WriteStateException;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.index.shard.IndexShard;
|
||||
import org.elasticsearch.index.shard.IndexShardClosedException;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -130,7 +131,10 @@ public class RetentionLeaseSyncAction extends
|
||||
|
||||
@Override
|
||||
public void handleException(TransportException e) {
|
||||
if (ExceptionsHelper.unwrap(e, AlreadyClosedException.class, IndexShardClosedException.class) == null) {
|
||||
if (ExceptionsHelper.unwrap(e,
|
||||
IndexNotFoundException.class,
|
||||
AlreadyClosedException.class,
|
||||
IndexShardClosedException.class) == null) {
|
||||
getLogger().warn(new ParameterizedMessage("{} retention lease sync failed", shardId), e);
|
||||
}
|
||||
task.setPhase("finished");
|
||||
|
Loading…
x
Reference in New Issue
Block a user