### CI Link

https://gradle-enterprise.elastic.co/s/vn4gmfzui5s3q

### Repro line

NONE

### Does it reproduce?

Didn't try

### Applicable branches

master, 8.2

### Failure history

_No response_

### Failure excerpt

```
java.lang.AssertionError: expected file size 16777216 but was 0 |  
-- | --
  | »  	at org.elasticsearch.xpack.searchablesnapshots.cache.shared.SharedBytes.<init>(SharedBytes.java:64) |  
  | »  	at org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.<init>(FrozenCacheService.java:295) |  
  | »  	at org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.createComponents(SearchableSnapshots.java:339) |  
  | »  	at org.elasticsearch.node.Node.lambda$new$16(Node.java:685) |  
  | »  	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273) |  
  | »  	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) |  
  | »  	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) |  
  | »  	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) |  
  | »  	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) |  
  | »  	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) |  
  | »  	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) |  
  | »  	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) |  
  | »  	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) |  
  | »  	at org.elasticsearch.node.Node.<init>(Node.java:699) |  
  | »  	at org.elasticsearch.node.Node.<init>(Node.java:291) |  
  | »  	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:234) |  
  | »  	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) |  
  | »  	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:358) |  
  | »  	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) |  
  | »  	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) |  
  | »  	at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:81) |  
  | »  	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) |  
  | »  	at org.elasticsearch.cli.Command.main(Command.java:77) |  
  | »  	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) |  
  | »  	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)


```
x-pack/plugin/searchable-snapshots/preallocate/src/main/java/org/elasticsearch/xpack/searchablesnapshots/preallocate/Preallocate.java
if (currentSize < fileSize) {
                        logger.info("pre-allocating cache file [{}] ({}) using native methods", cacheFile, new ByteSizeValue(fileSize));
                        final Field field = AccessController.doPrivileged(new FileDescriptorFieldAction(fileChannel));
                        final int errno = prealloactor.preallocate(
                            (int) field.get(fileChannel.getFD()),
                            currentSize,
                            fileSize - currentSize
                        );
                        if (errno == 0) {
                            success = true;
                            logger.debug("pre-allocated cache file [{}] using native methods", cacheFile);
                        } else {
                            logger.warn(
                                "failed to pre-allocate cache file [{}] using native methods, errno: [{}], error: [{}]",
                                cacheFile,
                                errno,
                                prealloactor.error(errno)
                            );
                        }
                    }
                } catch (final Exception e) {
                    logger.warn(new ParameterizedMessage("failed to pre-allocate cache file [{}] using native methods", cacheFile), e);
                }
            }
            
            try (RandomAccessFile raf = new RandomAccessFile(cacheFile.toFile(), "rw")) {
                if (raf.length() != fileSize) {
                    logger.info("pre-allocating cache file [{}] ({}) using setLength method", cacheFile, new ByteSizeValue(fileSize));
                    raf.setLength(fileSize);
                    success = true;