Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions docs/changelog/145209.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
area: Distributed
issues:
- 123773
pr: 145209
summary: Do not attempt marking store as corrupted if the check is rejected due to
shutdown
type: bug
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ tests:
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
method: testChildrenTasksCancelledOnTimeout
issue: https://github.com/elastic/elasticsearch/issues/123568
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
method: testCreateAndRestorePartialSearchableSnapshot
issue: https://github.com/elastic/elasticsearch/issues/123773
- class: org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
method: testDeploymentSurvivesRestart {cluster=OLD}
issue: https://github.com/elastic/elasticsearch/issues/124160
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.core.Assertions;
import org.elasticsearch.core.Booleans;
Expand Down Expand Up @@ -3384,9 +3385,10 @@ void checkIndex() throws IOException {
try {
doCheckIndex();
} catch (IOException e) {
if (ExceptionsHelper.unwrap(e, AlreadyClosedException.class) != null) {
if (ExceptionsHelper.unwrap(e, AlreadyClosedException.class) != null || isRejectedDueToShutdown(e)) {
// Cache-based read operations on Lucene files can throw an AlreadyClosedException wrapped into an IOException in case
// of evictions. We don't want to mark the store as corrupted for this.
// of evictions, or the read might be rejected if the node is shutting down. We don't want to mark the store as
// corrupted for this.
} else {
store.markStoreCorrupted(e);
}
Expand Down Expand Up @@ -4936,4 +4938,9 @@ private boolean assertNoEngineResetLock() {
+ "] to not hold the engine write lock (lock ordering should be: engineMutex -> engineResetLock -> mutex)";
return true;
}

private static boolean isRejectedDueToShutdown(IOException e) {
var rejected = ExceptionsHelper.unwrap(e, EsRejectedExecutionException.class);
return rejected instanceof EsRejectedExecutionException esRejected && esRejected.isExecutorShutdown();
}
}
Loading