### 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
final ShardId shardId = new ShardId("index", "_na_", 1);
        Settings settings = Settings.builder()
            .put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current())
            .put(Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), TimeValue.timeValueMinutes(0))
            .build();
        Store store = new Store(
            shardId,
            IndexSettingsModule.newIndexSettings("index", settings),
            StoreTests.newDirectory(random()),
            new DummyShardLock(shardId)
        );
        long initialStoreSize = 0;
        for (String extraFiles : store.directory().listAll()) {
            assertTrue("expected extraFS file but got: " + extraFiles, extraFiles.startsWith("extra"));
            initialStoreSize += store.directory().fileLength(extraFiles);
        }
        final long localStoreSizeDelta = randomLongBetween(-initialStoreSize, initialStoreSize);
        final long reservedBytes = randomBoolean() ? StoreStats.UNKNOWN_RESERVED_BYTES : randomLongBetween(0L, Integer.MAX_VALUE);
        StoreStats stats = store.stats(reservedBytes, size -> size + localStoreSizeDelta);
        assertEquals(initialStoreSize, stats.totalDataSetSize().getBytes());
        assertEquals(initialStoreSize + localStoreSizeDelta, stats.getSize().getBytes());
        assertEquals(reservedBytes, stats.getReservedSize().getBytes());
        stats.add(null);
        assertEquals(initialStoreSize, stats.totalDataSetSize().getBytes());
        assertEquals(initialStoreSize + localStoreSizeDelta, stats.getSize().getBytes());
        assertEquals(reservedBytes, stats.getReservedSize().getBytes());
        final long otherStatsDataSetBytes = randomLongBetween(0L, Integer.MAX_VALUE);
        final long otherStatsLocalBytes = randomLongBetween(0L, Integer.MAX_VALUE);
        final long otherStatsReservedBytes = randomBoolean() ? StoreStats.UNKNOWN_RESERVED_BYTES : randomLongBetween(0L, Integer.MAX_VALUE);
        stats.add(new StoreStats(otherStatsLocalBytes, otherStatsDataSetBytes, otherStatsReservedBytes));