```
:qa:rolling-upgrade:v7.17.8#upgradedClusterTest FAILED	
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 -Dsun.jnu.encoding=UTF8	
REPRODUCE WITH: ./gradlew ':qa:rolling-upgrade:v7.17.8#upgradedClusterTest' -Dtests.class="org.elasticsearch.upgrades.SnapshotBasedRecoveryIT" -Dtests.method="testSnapshotBasedRecovery" -Dtests.seed=99DD5020A91464DB -Dtests.bwc=true -Dtests.locale=uk -Dtests.timezone=America/Curacao -Druntime.java=17	
org.elasticsearch.upgrades.SnapshotBasedRecoveryIT > testSnapshotBasedRecovery FAILED	
    org.elasticsearch.client.WarningFailureException: method [PUT], host [http://127.0.0.1:41245], URI [/snapshot_based_recovery/_settings], status line [HTTP/1.1 200 OK]	
    Warnings: [[index.indexing.slowlog.level] setting was deprecated in the previous Elasticsearch release and is removed in this release.]	
    {"acknowledged":true}	
        at __randomizedtesting.SeedInfo.seed([99DD5020A91464DB:703258D83588DF92]:0)	
        at app//org.elasticsearch.client.RestClient.convertResponse(RestClient.java:343)	
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)	
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)	
        at app//org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1609)	
        at app//org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1603)	
        at app//org.elasticsearch.upgrades.SnapshotBasedRecoveryIT.testSnapshotBasedRecovery(SnapshotBasedRecoveryIT.java:103)	
Suite: Test class org.elasticsearch.upgrades.SnapshotBasedRecoveryIT	
  1> [2022-11-07T17:37:03,189][INFO ][o.e.u.SnapshotBasedRecoveryIT] [testSnapshotBasedRecovery] before test	
  1> [2022-11-07T17:37:03,193][INFO ][o.e.u.SnapshotBasedRecoveryIT] [testSnapshotBasedRecovery] initializing REST clients against [http://[::1]:36499, http://127.0.0.1:38953, http://[::1]:37855, http://127.0.0.1:43011, http://[::1]:45727, http://127.0.0.1:41245]	
  2> лист. 07, 2022 5:37:03 PM org.elasticsearch.client.RestClient logResponse	
  2> WARNING: request [PUT http://127.0.0.1:41245/snapshot_based_recovery/_settings] returned 1 warnings: [299 Elasticsearch-8.6.0-SNAPSHOT-a94347e002da18c9d567dde2b1bbec6b3ba133b0 "[index.indexing.slowlog.level] setting was deprecated in the previous Elasticsearch release and is removed in this release."]	
  1> [2022-11-07T17:37:03,387][INFO ][o.e.u.SnapshotBasedRecoveryIT] [testSnapshotBasedRecovery] There are still tasks running after this test that might break subsequent tests [health-node[c]].	
  1> [2022-11-07T17:37:03,388][INFO ][o.e.u.SnapshotBasedRecoveryIT] [testSnapshotBasedRecovery] after test	
  2> REPRODUCE WITH: ./gradlew ':qa:rolling-upgrade:v7.17.8#upgradedClusterTest' -Dtests.class="org.elasticsearch.upgrades.SnapshotBasedRecoveryIT" -Dtests.method="testSnapshotBasedRecovery" -Dtests.seed=99DD5020A91464DB -Dtests.bwc=true -Dtests.locale=uk -Dtests.timezone=America/Curacao -Druntime.java=17	
  2> org.elasticsearch.client.WarningFailureException: method [PUT], host [http://127.0.0.1:41245], URI [/snapshot_based_recovery/_settings], status line [HTTP/1.1 200 OK]	
    Warnings: [[index.indexing.slowlog.level] setting was deprecated in the previous Elasticsearch release and is removed in this release.]	
    {"acknowledged":true}	
        at __randomizedtesting.SeedInfo.seed([99DD5020A91464DB:703258D83588DF92]:0)	
        at app//org.elasticsearch.client.RestClient.convertResponse(RestClient.java:343)	
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)	
        at app//org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)	
        at app//org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1609)	
        at app//org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1603)	
        at app//org.elasticsearch.upgrades.SnapshotBasedRecoveryIT.testSnapshotBasedRecovery(SnapshotBasedRecoveryIT.java:103)	
  2> NOTE: leaving temporary files on disk at: /var/lib/jenkins/workspace/elastic+elasticsearch+main+multijob+platform-support-unix/os/debian-10&&immutable/qa/rolling-upgrade/build/testrun/v7.17.8#upgradedClusterTest/temp/org.elasticsearch.upgrades.SnapshotBasedRecoveryIT_99DD5020A91464DB-001	
  2> NOTE: test params are: codec=Asserting(Lucene94): {}, docValues:{}, maxPointsInLeafNode=1084, maxMBSortInHeap=7.319935879968938, sim=Asserting(RandomSimilarity(queryNorm=false): {}), locale=uk, timezone=America/Curacao	
  2> NOTE: Linux 4.19.0-22-cloud-amd64 amd64/Oracle Corporation 17.0.2 (64-bit)/cpus=32,threads=1,free=361787920,total=536870912	
  2> NOTE: All tests run in this JVM: [DesiredNodesUpgradeIT, FeatureUpgradeIT, FieldCapsIT, IndexingIT, RecoveryIT, SnapshotBasedRecoveryIT]	
WARNING: A terminally deprecated method in java.lang.System has been called	
WARNING: System::setSecurityManager has been called by org.gradle.api.internal.tasks.testing.worker.TestWorker (file:/var/lib/jenkins/.gradle/wrapper/dists/gradle-7.5.1-all/1ehga6e77gqps5uk2kc5kf1vc/gradle-7.5.1/lib/plugins/gradle-testing-base-7.5.1.jar)	
WARNING: Please consider reporting this to the maintainers of org.gradle.api.internal.tasks.testing.worker.TestWorker	
WARNING: System::setSecurityManager will be removed in a future release	
Tests with failures:	
 - org.elasticsearch.upgrades.SnapshotBasedRecoveryIT.testSnapshotBasedRecovery
```

**Build scan:**
https://gradle-enterprise.elastic.co/s/o3ol7dvdybvbu/tests/:qa:rolling-upgrade:v7.17.8%23upgradedClusterTest/org.elasticsearch.upgrades.SnapshotBasedRecoveryIT/testSnapshotBasedRecovery

**Reproduction line:**
`./gradlew ':qa:rolling-upgrade:v7.17.8#upgradedClusterTest' -Dtests.class="org.elasticsearch.upgrades.SnapshotBasedRecoveryIT" -Dtests.method="testSnapshotBasedRecovery" -Dtests.seed=99DD5020A91464DB -Dtests.bwc=true -Dtests.locale=uk -Dtests.timezone=America/Curacao -Druntime.java=17`

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.upgrades.SnapshotBasedRecoveryIT&tests.test=testSnapshotBasedRecovery

**Failure excerpt:**
```
org.elasticsearch.client.WarningFailureException: method [PUT], host [http://127.0.0.1:41245], URI [/snapshot_based_recovery/_settings], status line [HTTP/1.1 200 OK]
Warnings: [[index.indexing.slowlog.level] setting was deprecated in the previous Elasticsearch release and is removed in this release.]
{"acknowledged":true}

  at __randomizedtesting.SeedInfo.seed([99DD5020A91464DB:703258D83588DF92]:0)
  at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:343)
  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)
  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
  at org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1609)
  at org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1603)
  at org.elasticsearch.upgrades.SnapshotBasedRecoveryIT.testSnapshotBasedRecovery(SnapshotBasedRecoveryIT.java:103)
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:568)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:833)

```
server/src/main/java/org/elasticsearch/indices/IndicesService.java
}
        }
    }
    int numPendingDeletes(Index index) {
        synchronized (pendingDeletes) {
            List<PendingDelete> deleteList = pendingDeletes.get(index);
            if (deleteList == null) {
                return 0;
            }
            return deleteList.size();
        }
    }
    /**
     * Checks if all pending deletes have completed. Used by tests to ensure we don't check directory contents
     * while deletion still ongoing. * The reason is that, on Windows, browsing the directory contents can interfere
     * with the deletion process and delay it unnecessarily.
     */
    public boolean hasUncompletedPendingDeletes() {
        return numUncompletedDeletes.get() > 0;
    }
    public AnalysisRegistry getAnalysis() {
        return analysisRegistry;
    }
    /**
     * FieldDataCacheCleaner is a scheduled Runnable used to clean a Guava cache
     * periodically. In this case it is the field data cache, because a cache that
     * has an entry invalidated may not clean up the entry if it is not read from
     * or written to after invalidation.
     */
    private static final class CacheCleaner implements Runnable, Releasable {