### 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
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.index.engine;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.plugins.EnginePlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import org.elasticsearch.xcontent.XContentType;
import org.junit.After;
import org.junit.Before;
import java.util.Collection;