### 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 testCorruptionMarkerVersionCheck() throws IOException {
        final ShardId shardId = new ShardId("index", "_na_", 1);
        final Directory dir = new ByteBuffersDirectory(); 
        try (Store store = new Store(shardId, INDEX_SETTINGS, dir, new DummyShardLock(shardId))) {
            final String corruptionMarkerName = Store.CORRUPTED_MARKER_NAME_PREFIX + UUIDs.randomBase64UUID();
            try (IndexOutput output = dir.createOutput(corruptionMarkerName, IOContext.DEFAULT)) {
                CodecUtil.writeHeader(output, Store.CODEC, Store.CORRUPTED_MARKER_CODEC_VERSION + randomFrom(1, 2, -1, -2, -3));
                
            }
            final IOException ioException = expectThrows(IOException.class, store::failIfCorrupted);
            assertThat(ioException, anyOf(instanceOf(IndexFormatTooOldException.class), instanceOf(IndexFormatTooNewException.class)));
            assertThat(ioException.getMessage(), containsString(corruptionMarkerName));
        }
    }
    public void testHistoryUUIDCanBeForced() throws IOException {
        final ShardId shardId = new ShardId("index", "_na_", 1);
        try (Store store = new Store(shardId, INDEX_SETTINGS, StoreTests.newDirectory(random()), new DummyShardLock(shardId))) {
            store.createEmpty();
            SegmentInfos segmentInfos = Lucene.readSegmentInfos(store.directory());
            assertThat(segmentInfos.getUserData(), hasKey(Engine.HISTORY_UUID_KEY));
            final String oldHistoryUUID = segmentInfos.getUserData().get(Engine.HISTORY_UUID_KEY);
            store.bootstrapNewHistory();
            segmentInfos = Lucene.readSegmentInfos(store.directory());
            assertThat(segmentInfos.getUserData(), hasKey(Engine.HISTORY_UUID_KEY));
            assertThat(segmentInfos.getUserData().get(Engine.HISTORY_UUID_KEY), not(equalTo(oldHistoryUUID)));
        }
    }
    public void testGetPendingFiles() throws IOException {
        final ShardId shardId = new ShardId("index", "_na_", 1);