Skip to content

Commit f8df217

Browse files
repro #41898
1 parent 228ece6 commit f8df217

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,6 @@ public void initializeSnapshot(SnapshotId snapshotId, List<IndexId> indices, Met
395395
if (repositoryData.getAllSnapshotIds().stream().anyMatch(s -> s.getName().equals(snapshotName))) {
396396
throw new InvalidSnapshotNameException(metadata.name(), snapshotId.getName(), "snapshot with the same name already exists");
397397
}
398-
if (snapshotFormat.exists(blobContainer(), snapshotId.getUUID())) {
399-
throw new InvalidSnapshotNameException(metadata.name(), snapshotId.getName(), "snapshot with the same name already exists");
400-
}
401398

402399
// Write Global MetaData
403400
globalMetaDataFormat.write(clusterMetaData, blobContainer(), snapshotId.getUUID());

server/src/test/java/org/elasticsearch/snapshots/mockstore/MockEventuallyConsistentRepository.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ public void writeBlob(String blobName, InputStream inputStream, long blobSize, b
172172
super.writeBlob(blobName, new ByteArrayInputStream(baos.toByteArray()), blobSize, failIfAlreadyExists);
173173
if (cachedMisses.contains(blobName)) {
174174
// Remove cached missing blob later to simulate inconsistency between list and get calls.
175-
deterministicTaskQueue.scheduleNow(() -> cachedMisses.remove(blobName));
175+
// Just scheduling at the current time since we get randomized future execution from the deterministic
176+
// task queue's jitter anyway.
177+
deterministicTaskQueue.scheduleAt(
178+
deterministicTaskQueue.getCurrentTimeMillis(), () -> cachedMisses.remove(blobName));
176179
}
177180
} catch (NoSuchFileException | FileAlreadyExistsException e) {
178181
// Ignoring, assuming a previous concurrent delete removed the parent path and that overwrites are not

0 commit comments

Comments
 (0)