### 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
} else if (op == 1) {
                indexInput.readByte();
                pos++;
            } else {
                int min = (int) Math.min(indexInput.length() - pos, ref.bytes.length);
                indexInput.readBytes(ref.bytes, ref.offset, min);
                pos += min;
            }
        }
    }
    private void corruptFile(Directory dir, String fileIn, String fileOut) throws IOException {
        IndexInput input = dir.openInput(fileIn, IOContext.READONCE);
        IndexOutput output = dir.createOutput(fileOut, IOContext.DEFAULT);
        long len = input.length();
        byte[] b = new byte[1024];
        long broken = randomInt((int) len - 1);
        long pos = 0;
        while (pos < len) {
            int min = (int) Math.min(input.length() - pos, b.length);
            input.readBytes(b, 0, min);
            if (broken >= pos && broken < pos + min) {
                
                int flipPos = (int) (broken - pos);
                b[flipPos] = (byte) (b[flipPos] ^ 42);
            }
            output.writeBytes(b, min);
            pos += min;
        }
        IOUtils.close(input, output);
    }