### CI Link

https://gradle-enterprise.elastic.co/s/doijmf2rj77a6/console-log?task=:server:test

### Repro line

./gradlew ':server:test' --tests "org.elasticsearch.index.store.StoreTests.testStoreSizes" -Dtests.seed=BAFF5AE277B58421 -Dtests.locale=en-NZ -Dtests.timezone=America/Yellowknife -Druntime.java=21

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

```
org.elasticsearch.index.store.StoreTests > testStoreSizes FAILED |  
java.lang.AssertionError: |  
Expected: <40L> |  
but: was <0L> |  
at __randomizedtesting.SeedInfo.seed([BAFF5AE277B58421:76B6314660FDF343]:0) |  
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18) |  
at org.junit.Assert.assertThat(Assert.java:956) |  
at org.junit.Assert.assertThat(Assert.java:923) |  
at org.elasticsearch.index.store.StoreTests.testStoreSizes(StoreTests.java:878)
```

The log also seems to indicate a corrupt index, but I'm not sure if this is expected. It fails reliable with the given repro line (on JDK 20 and 21).
server/src/test/java/org/elasticsearch/index/store/StoreTests.java
public void assertDeleteContent(Store store, Directory dir) throws IOException {
        deleteContent(store.directory());
        assertThat(Arrays.toString(store.directory().listAll()), store.directory().listAll().length, equalTo(0));
        assertThat(store.stats(0L, LongUnaryOperator.identity()).sizeInBytes(), equalTo(0L));
        assertThat(dir.listAll().length, equalTo(0));
    }
    public static void assertConsistent(Store store, Store.MetadataSnapshot metadata) throws IOException {
        for (String file : store.directory().listAll()) {
            if (IndexWriter.WRITE_LOCK_NAME.equals(file) == false && file.startsWith("extra") == false) {
                assertTrue(
                    file + " is not in the map: " + metadata.fileMetadataMap().size() + " vs. " + store.directory().listAll().length,
                    metadata.fileMetadataMap().containsKey(file)
                );
            } else {
                assertFalse(
                    file + " is not in the map: " + metadata.fileMetadataMap().size() + " vs. " + store.directory().listAll().length,
                    metadata.fileMetadataMap().containsKey(file)
                );
            }
        }
    }
    public void testRecoveryDiff() throws IOException, InterruptedException {
        int numDocs = 2 + random().nextInt(100);
        List<Document> docs = new ArrayList<>();
        for (int i = 0; i < numDocs; i++) {
            Document doc = new Document();
            final Field.Store stringFieldStored = random().nextBoolean() ? Field.Store.YES : Field.Store.NO;
            doc.add(new StringField("id", "" + i, stringFieldStored));
            final String textFieldContent = TestUtil.randomRealisticUnicodeString(random());
            final Field.Store textFieldStored = random().nextBoolean() ? Field.Store.YES : Field.Store.NO;