From a6c1c25e1193e4174afc9b7dd6aea2687f95e02f Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Thu, 17 Apr 2025 17:38:09 +0200 Subject: [PATCH 1/2] Run `SearchWithRandomIOExceptionsIT#testRandomDirectoryIOExceptions` multiple times on CI Let's see if the `seqNo` assertion in `PeerRecoveryTargetService` gets tripped in the main branch. --- muted-tests.yml | 3 --- .../search/basic/SearchWithRandomIOExceptionsIT.java | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index b815f0aa2eae6..b3bb3112a4999 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -77,9 +77,6 @@ tests: - class: org.elasticsearch.xpack.test.rest.XPackRestIT method: test {p0=snapshot/20_operator_privileges_disabled/Operator only settings can be set and restored by non-operator user when operator privileges is disabled} issue: https://github.com/elastic/elasticsearch/issues/116775 -- class: org.elasticsearch.search.basic.SearchWithRandomIOExceptionsIT - method: testRandomDirectoryIOExceptions - issue: https://github.com/elastic/elasticsearch/issues/114824 - class: org.elasticsearch.xpack.apmdata.APMYamlTestSuiteIT method: test {yaml=/10_apm/Test template reinstallation} issue: https://github.com/elastic/elasticsearch/issues/116445 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java index ed02594994b39..0a66dd6818ee3 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java @@ -9,6 +9,8 @@ package org.elasticsearch.search.basic; +import com.carrotsearch.randomizedtesting.annotations.Repeat; + import org.apache.lucene.tests.util.English; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.DocWriteResponse; @@ -18,6 +20,7 @@ import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; @@ -42,6 +45,8 @@ protected Collection> nodePlugins() { return Arrays.asList(MockFSIndexStore.TestPlugin.class); } + @Repeat(iterations = 100) + @SuppressForbidden(reason = "run the test multiple times on CI") public void testRandomDirectoryIOExceptions() throws IOException, InterruptedException, ExecutionException { String mapping = Strings.toString( XContentFactory.jsonBuilder() From 50a66be12e69bffd5f3abb2a3f5fc4b9401e847c Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Thu, 24 Apr 2025 14:04:12 +0200 Subject: [PATCH 2/2] Remove eqNo assertion on IndexNotFoundException --- .../indices/recovery/PeerRecoveryTargetService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java b/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java index 359d084342a74..1787f0a420879 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java @@ -494,7 +494,6 @@ public static StartRecoveryRequest getStartRecoveryRequest( } } catch (final org.apache.lucene.index.IndexNotFoundException e) { // happens on an empty folder. no need to log - assert startingSeqNo == UNASSIGNED_SEQ_NO : startingSeqNo; logger.trace("{} shard folder empty, recovering all files", recoveryTarget); metadataSnapshot = Store.MetadataSnapshot.EMPTY; } catch (final IOException e) {