diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java index 8a2260e1f6d90..f36bad543a359 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java @@ -1592,8 +1592,11 @@ private void executeOneStaleIndexDelete( Map shardLevelBlobs = shardBlob.getValue().listBlobs(); for (Map.Entry shardLevelBlob : shardLevelBlobs.entrySet()) { String blob = shardLevelBlob.getKey(); - String snapshotUUID = blob.substring(SHALLOW_SNAPSHOT_PREFIX.length(), blob.length() - ".dat".length()); if (blob.startsWith(SHALLOW_SNAPSHOT_PREFIX) && blob.endsWith(".dat")) { + String snapshotUUID = blob.substring( + SHALLOW_SNAPSHOT_PREFIX.length(), + blob.length() - ".dat".length() + ); RemoteStoreShardShallowCopySnapshot remoteStoreShardShallowCopySnapshot = REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT.read( shardBlob.getValue(),