From 036b89bc58f905d84e161035495e60b82bd2d4a5 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 18 Feb 2025 13:18:22 +0100 Subject: [PATCH 1/3] Unmute `FrozenSearchableSnapshotsIntegTests#testCreateAndRestorePartialSearchableSnapshot` The underlying failure `java.lang.AssertionError: Searchable snapshot directory does not support the operation [createOutput` was fixed in https://github.com/elastic/elasticsearch/pull/122006. The automation bot was too aggressive in re-opening this issue. Resolve #122693 --- muted-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index ddcd4a988dbd7..19d73e6b2b12b 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -344,9 +344,6 @@ tests: - class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase method: testRestoreIndex {p0=[9.1.0, 8.19.0, 8.19.0]} issue: https://github.com/elastic/elasticsearch/issues/122691 -- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests - method: testCreateAndRestorePartialSearchableSnapshot - issue: https://github.com/elastic/elasticsearch/issues/122693 - class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase method: testClosedIndexUpgrade {p0=[9.1.0, 9.1.0, 8.19.0]} issue: https://github.com/elastic/elasticsearch/issues/122694 From f3b9d7a489e7ab9ec22cfbd034bd75eb4af98e4c Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 18 Feb 2025 14:07:35 +0100 Subject: [PATCH 2/3] Add a check for the CLOSED state along with STOPPED --- .../xpack/searchablesnapshots/cache/full/CacheService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java index a02c32cd56d94..29b8a7ac7218e 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java @@ -245,7 +245,7 @@ private void ensureLifecycleStarted() { final Lifecycle.State state = lifecycleState(); assert state != Lifecycle.State.INITIALIZED : state; if (state != Lifecycle.State.STARTED) { - if (state == Lifecycle.State.STOPPED) { + if (state == Lifecycle.State.STOPPED || state == Lifecycle.State.CLOSED) { throw new AlreadyClosedException("Failed to read data from cache: cache service is stopped"); } else { throw new IllegalStateException("Failed to read data from cache: cache service is not started [" + state + "]"); From 4298ead1786f57edecd27565680bd8df9b11579c Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 18 Feb 2025 15:25:43 +0100 Subject: [PATCH 3/3] Update x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java Co-authored-by: Tanguy Leroux --- .../xpack/searchablesnapshots/cache/full/CacheService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java index 29b8a7ac7218e..dee6fc7241d53 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java @@ -246,7 +246,7 @@ private void ensureLifecycleStarted() { assert state != Lifecycle.State.INITIALIZED : state; if (state != Lifecycle.State.STARTED) { if (state == Lifecycle.State.STOPPED || state == Lifecycle.State.CLOSED) { - throw new AlreadyClosedException("Failed to read data from cache: cache service is stopped"); + throw new AlreadyClosedException("Failed to read data from cache: cache service is [" + state + ']'); } else { throw new IllegalStateException("Failed to read data from cache: cache service is not started [" + state + "]"); }