### CI Link

https://gradle-enterprise.elastic.co/s/ttoy2fz7vpo3a/tests/:server:internalClusterTest/org.elasticsearch.index.engine.MaxDocsLimitIT/testMaxDocsLimit

### Repro line

`./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.index.engine.MaxDocsLimitIT.testMaxDocsLimit" -Dtests.seed=87A99F29C5284169 -Dtests.locale=es-PR -Dtests.timezone=America/Mazatlan -Druntime.java=17`

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

https://gradle-enterprise.elastic.co/scans/tests?search.timeZoneId=Europe/Berlin&tests.container=org.elasticsearch.index.engine.MaxDocsLimitIT&tests.test=testMaxDocsLimit#

### Failure excerpt

```
org.elasticsearch.ResourceAlreadyExistsException: index [test/JWxXBgp8T0CNYCD7JwrRlw] already exists	
	at __randomizedtesting.SeedInfo.seed([87A99F29C5284169:39D24887ACAF7B57]:0)	
	at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.validateIndexName(MetadataCreateIndexService.java:175)	
	at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.validate(MetadataCreateIndexService.java:1360)	
	at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:343)	
	at org.elasticsearch.cluster.metadata.MetadataCreateIndexService$1.execute(MetadataCreateIndexService.java:298)	
	at org.elasticsearch.cluster.service.MasterService$UnbatchedExecutor.execute(MasterService.java:551)	
	at org.elasticsearch.cluster.service.MasterService.innerExecuteTasks(MasterService.java:1052)	
	at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:1017)	
	at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:278)	
	at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:170)	
	at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:110)	
	at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:148)	
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:850)	
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:257)	
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:223)	
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)	
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)	
	at java.lang.Thread.run(Thread.java:833)	
```	
server/src/internalClusterTest/java/org/elasticsearch/index/engine/MaxDocsLimitIT.java
import java.util.Optional;
import java.util.concurrent.Phaser;
import java.util.concurrent.atomic.AtomicInteger;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
public class MaxDocsLimitIT extends ESIntegTestCase {
    private static final AtomicInteger maxDocs = new AtomicInteger();
    public static class TestEnginePlugin extends Plugin implements EnginePlugin {
        @Override
        public Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings) {
            return Optional.of(config -> {
                assert maxDocs.get() > 0 : "maxDocs is unset";
                return EngineTestCase.createEngine(config, maxDocs.get());
            });
        }
    }
    @Override
    protected boolean addMockInternalEngine() {
        return false;
    }
    @Override
    protected Collection<Class<? extends Plugin>> nodePlugins() {
        return CollectionUtils.appendToCopy(super.nodePlugins(), TestEnginePlugin.class);
    }
    @Before
    public void setMaxDocs() {