diff --git a/src/main/java/org/elasticsearch/index/store/Store.java b/src/main/java/org/elasticsearch/index/store/Store.java index 797cb86ce4f..9b476392b1f 100644 --- a/src/main/java/org/elasticsearch/index/store/Store.java +++ b/src/main/java/org/elasticsearch/index/store/Store.java @@ -224,8 +224,9 @@ public class Store extends AbstractIndexShardComponent implements CloseableIndex public void writeChecksums() throws IOException { ensureOpen(); ImmutableMap files = list(); - String checksumName = CHECKSUMS_PREFIX + System.currentTimeMillis(); + String checksumName; synchronized (mutex) { + checksumName = CHECKSUMS_PREFIX + System.currentTimeMillis(); Map checksums = new HashMap<>(); for (StoreFileMetaData metaData : files.values()) { if (metaData.checksum() != null) {