**Build scan:**
https://gradle-enterprise.elastic.co/s/xvwrlxusnxdgu/tests/:qa:rolling-upgrade:v8.6.1%23oneThirdUpgradedTest/org.elasticsearch.upgrades.SnapshotBasedRecoveryIT/testSnapshotBasedRecovery

**Reproduction line:**
```
./gradlew ':qa:rolling-upgrade:v8.6.1#oneThirdUpgradedTest' -Dtests.class="org.elasticsearch.upgrades.SnapshotBasedRecoveryIT" -Dtests.method="testSnapshotBasedRecovery" -Dtests.seed=32151106DB58AD22 -Dtests.bwc=true -Dtests.locale=en-MT -Dtests.timezone=Asia/Colombo -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:**
```
java.lang.AssertionError: timed out waiting for green state for index [snapshot_based_recovery] cluster state [{
  "cluster_name" : "v8.6.1",
  "cluster_uuid" : "ETWjuovuQXC6pr6CN8pJXA",
  "version" : 391,
  "state_uuid" : "y7ss0aZLQvab9JIDk7jppg",
  "master_node" : "tsyOGVI1T5iBSTLS0zL29A",
  ...
```
server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java
"node1",
            "node1",
            "node1",
            "test1",
            "test1",
            buildNewFakeTransportAddress(),
            emptyMap(),
            MASTER_DATA_ROLES,
            null
        );
        DiscoveryNode node2 = new DiscoveryNode(
            "node2",
            "node2",
            "node2",
            "test2",
            "test2",
            buildNewFakeTransportAddress(),
            emptyMap(),
            new HashSet<>(randomSubsetOf(Set.of(DiscoveryNodeRole.MASTER_ROLE, DiscoveryNodeRole.INGEST_ROLE))),
            null
        );
        clusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder().add(node1).add(node2)).build();
        logger.info("start primary shard");
        clusterState = startInitializingShardsAndReroute(allocation, clusterState);
        Index index = clusterState.getMetadata().index("test").getIndex();
        MoveAllocationCommand command = new MoveAllocationCommand(index.getName(), 0, "node1", "node2");
        RoutingAllocation routingAllocation = new RoutingAllocation(
            new AllocationDeciders(Collections.emptyList()),
            clusterState.mutableRoutingNodes(),
            clusterState,