diff --git a/server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java b/server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java index ced6f083b9d68..ea6b1b13278b4 100644 --- a/server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java +++ b/server/src/main/java/org/opensearch/index/remote/RemoteStoreUtils.java @@ -40,7 +40,6 @@ import java.util.Optional; import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.stream.Collectors; @@ -502,7 +501,7 @@ public static List filterOutMetadataFilesBasedOnAge( Function getTimestampFunction, TimeValue minimumAge ) { - long maxTimestampAllowed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - minimumAge.getMillis(); + long maxTimestampAllowed = System.currentTimeMillis() - minimumAge.getMillis(); List metadataFilesWithMinAge = new ArrayList<>(); for (String metadataFileName : metadataFiles) { long metadataTimestamp = getTimestampFunction.apply(metadataFileName);