### CI Link

https://gradle-enterprise.elastic.co/s/bettqvfg5kyos

### Repro line

./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.indices.recovery.IndexRecoveryIT.testTransientErrorsDuringRecoveryAreRetried" -Dtests.seed=4BDFC31A406EBDF9 -Dtests.locale=ga -Dtests.timezone=America/Atikokan -Druntime.java=19	

### Does it reproduce?

Didn't try

### Applicable branches

main

### Failure history

https://gradle-enterprise.elastic.co/scans/tests?search.timeZoneId=Europe/Rome&tests.container=org.elasticsearch.indices.recovery.IndexRecoveryIT&tests.test=testTransientErrorsDuringRecoveryAreRetried

### Failure excerpt

```
java.lang.AssertionError: timed out waiting for green state
```

Call to `ensureGreen()` times out before being able to reach a stable cluster state.
server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexRecoveryIT.java
reasonableOperationsBasedRecoveryProportion = IndexSettings.FILE_BASED_RECOVERY_THRESHOLD_SETTING.get(Settings.EMPTY);
        }
        logger.info("--> performing ops-based recoveries up to [{}%] of docs", reasonableOperationsBasedRecoveryProportion * 100.0);
        createIndex(indexName, settings.build());
        indexRandom(
            randomBoolean(),
            false,
            randomBoolean(),
            IntStream.range(0, between(0, 100)).mapToObj(n -> client().prepareIndex(indexName).setSource("num", n)).collect(toList())
        );
        ensureGreen(indexName);
        flush(indexName);
        
        assertBusy(() -> {
            for (ShardStats shardStats : client().admin().indices().prepareStats(indexName).get().getShards()) {
                final long maxSeqNo = shardStats.getSeqNoStats().getMaxSeqNo();
                assertTrue(
                    shardStats.getRetentionLeaseStats().retentionLeases() + " should discard history up to " + maxSeqNo,
                    shardStats.getRetentionLeaseStats()
                        .retentionLeases()
                        .leases()
                        .stream()
                        .allMatch(l -> l.retainingSequenceNumber() == maxSeqNo + 1)
                );
            }
        });
        flush(indexName); 
        final ShardStats shardStats = client().admin().indices().prepareStats(indexName).get().getShards()[0];
        final long docCount = shardStats.getStats().docs.getCount();
        assertThat(shardStats.getStats().docs.getDeleted(), equalTo(0L));