From 2b0723f28601ece4bec32220545cad17f9053061 Mon Sep 17 00:00:00 2001 From: Sachin Kale Date: Wed, 18 Sep 2024 20:46:26 +0530 Subject: [PATCH] Consider primary term while deleting generations Signed-off-by: Sachin Kale --- .../snapshots/DeleteSnapshotV2IT.java | 10 +- .../RemoteFsTimestampAwareTranslog.java | 143 ++++++++++++++---- .../transfer/TranslogTransferManager.java | 49 +++++- .../transfer/TranslogTransferMetadata.java | 6 +- .../RemoteFsTimestampAwareTranslogTests.java | 83 +++++----- 5 files changed, 216 insertions(+), 75 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/DeleteSnapshotV2IT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/DeleteSnapshotV2IT.java index c4e3a478c8540..5410b66c075f2 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/DeleteSnapshotV2IT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/DeleteSnapshotV2IT.java @@ -305,11 +305,11 @@ public void testRemoteStoreCleanupForDeletedIndexForSnapshotV2MultipleSnapshots( List segmentsPostDeletionOfSnapshot1 = Files.list(segmentsPath).collect(Collectors.toList()); assertTrue(segmentsPostDeletionOfSnapshot1.size() < segmentsPostSnapshot2.size()); }, 60, TimeUnit.SECONDS); - // To uncomment following, we need to handle deletion of generations in translog cleanup flow - // List translogPostDeletionOfSnapshot1 = Files.list(translogPath).collect(Collectors.toList()); - // Delete is async. Give time for it - // assertBusy(() -> assertEquals(translogPostSnapshot2.size() - translogPostSnapshot1.size(), - // translogPostDeletionOfSnapshot1.size()), 60, TimeUnit.SECONDS); + + assertBusy(() -> { + List translogPostDeletionOfSnapshot1 = Files.list(translogPath).collect(Collectors.toList()); + assertTrue(translogPostDeletionOfSnapshot1.size() < translogPostSnapshot2.size()); + }, 60, TimeUnit.SECONDS); } private Settings snapshotV2Settings(Path remoteStoreRepoPath) { diff --git a/server/src/main/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslog.java b/server/src/main/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslog.java index cb8e9fbeba4ab..2ddc54591f0f3 100644 --- a/server/src/main/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslog.java +++ b/server/src/main/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslog.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -201,18 +202,17 @@ public void onResponse(List blobMetadata) { logger.debug(() -> "metadataFilesNotToBeDeleted = " + metadataFilesNotToBeDeleted); - Set generationsToBeDeleted = getGenerationsToBeDeleted( + Map> primaryTermGenerationsToBeDeletedMap = getGenerationsToBeDeleted( metadataFilesNotToBeDeleted, metadataFilesToBeDeleted, indexDeleted ? Long.MAX_VALUE : minRemoteGenReferenced ); - logger.debug(() -> "generationsToBeDeleted = " + generationsToBeDeleted); - if (generationsToBeDeleted.isEmpty() == false) { + logger.debug(() -> "generationsToBeDeleted = " + primaryTermGenerationsToBeDeletedMap); + if (primaryTermGenerationsToBeDeletedMap.isEmpty() == false) { // Delete stale generations translogTransferManager.deleteGenerationAsync( - primaryTermSupplier.getAsLong(), - generationsToBeDeleted, + primaryTermGenerationsToBeDeletedMap, remoteGenerationDeletionPermits::release ); } else { @@ -248,32 +248,115 @@ public void onFailure(Exception e) { translogTransferManager.listTranslogMetadataFilesAsync(listMetadataFilesListener); } + protected Map> getGenerationsToBeDeleted( + List metadataFilesNotToBeDeleted, + List metadataFilesToBeDeleted, + long minRemoteGenReferenced + ) throws IOException { + return getGenerationsToBeDeleted( + metadataFilesNotToBeDeleted, + metadataFilesToBeDeleted, + translogTransferManager, + oldFormatMetadataFileGenerationMap, + oldFormatMetadataFilePrimaryTermMap, + minRemoteGenReferenced + ); + } + // Visible for testing - protected Set getGenerationsToBeDeleted( + protected static Map> getGenerationsToBeDeleted( List metadataFilesNotToBeDeleted, List metadataFilesToBeDeleted, + TranslogTransferManager translogTransferManager, + Map> oldFormatMetadataFileGenerationMap, + Map> oldFormatMetadataFilePrimaryTermMap, long minRemoteGenReferenced ) throws IOException { - Set generationsFromMetadataFilesToBeDeleted = new HashSet<>(); + Map> generationsFromMetadataFilesToBeDeleted = new HashMap<>(); for (String mdFile : metadataFilesToBeDeleted) { - Tuple minMaxGen = getMinMaxTranslogGenerationFromMetadataFile(mdFile, translogTransferManager); - generationsFromMetadataFilesToBeDeleted.addAll( - LongStream.rangeClosed(minMaxGen.v1(), minMaxGen.v2()).boxed().collect(Collectors.toList()) + Tuple minMaxGen = getMinMaxTranslogGenerationFromMetadataFile( + mdFile, + translogTransferManager, + oldFormatMetadataFileGenerationMap ); + for (long generation : LongStream.rangeClosed(minMaxGen.v1(), minMaxGen.v2()).boxed().collect(Collectors.toList())) { + if (generationsFromMetadataFilesToBeDeleted.containsKey(generation) == false) { + generationsFromMetadataFilesToBeDeleted.put(generation, new HashSet<>()); + } + generationsFromMetadataFilesToBeDeleted.get(generation).add(mdFile); + } + } + + Map> metadataFileNotToBeDeletedGenerationMap = new HashMap<>(); + for (String mdFile : metadataFilesNotToBeDeleted) { + Tuple minMaxGen = getMinMaxTranslogGenerationFromMetadataFile( + mdFile, + translogTransferManager, + oldFormatMetadataFileGenerationMap + ); + metadataFileNotToBeDeletedGenerationMap.put(mdFile, minMaxGen); + List generations = LongStream.rangeClosed(minMaxGen.v1(), minMaxGen.v2()).boxed().collect(Collectors.toList()); + for (Long generation : generations) { + if (generationsFromMetadataFilesToBeDeleted.containsKey(generation)) { + generationsFromMetadataFilesToBeDeleted.get(generation).add(mdFile); + } + } } - Map> metadataFileNotToBeDeletedGenerationMap = getGenerationForMetadataFiles(metadataFilesNotToBeDeleted); TreeSet> pinnedGenerations = getOrderedPinnedMetadataGenerations(metadataFileNotToBeDeletedGenerationMap); - Set generationsToBeDeleted = new HashSet<>(); - for (long generation : generationsFromMetadataFilesToBeDeleted) { + Map> generationsToBeDeletedToPrimaryTermRangeMap = new HashMap<>(); + for (long generation : generationsFromMetadataFilesToBeDeleted.keySet()) { // Check if the generation is not referred by metadata file matching pinned timestamps // The check with minRemoteGenReferenced is redundant but kept as to make sure we don't delete generations // that are not persisted in remote segment store yet. if (generation < minRemoteGenReferenced && isGenerationPinned(generation, pinnedGenerations) == false) { - generationsToBeDeleted.add(generation); + generationsToBeDeletedToPrimaryTermRangeMap.put( + generation, + getPrimaryTermRange( + generationsFromMetadataFilesToBeDeleted.get(generation), + translogTransferManager, + oldFormatMetadataFilePrimaryTermMap + ) + ); + } + } + return getPrimaryTermToGenerationsMap(generationsToBeDeletedToPrimaryTermRangeMap); + } + + protected static Map> getPrimaryTermToGenerationsMap(Map> generationsToBeDeletedToPrimaryTermRangeMap) { + Map> primaryTermToGenerationsMap = new HashMap<>(); + for (Map.Entry> entry : generationsToBeDeletedToPrimaryTermRangeMap.entrySet()) { + for (Long primaryTerm : entry.getValue()) { + if (primaryTermToGenerationsMap.containsKey(primaryTerm) == false) { + primaryTermToGenerationsMap.put(primaryTerm, new HashSet<>()); + } + primaryTermToGenerationsMap.get(primaryTerm).add(entry.getKey()); } } - return generationsToBeDeleted; + return primaryTermToGenerationsMap; + } + + protected static Set getPrimaryTermRange( + Set metadataFiles, + TranslogTransferManager translogTransferManager, + Map> oldFormatMetadataFilePrimaryTermMap + ) throws IOException { + Tuple primaryTermRange = new Tuple<>(Long.MIN_VALUE, Long.MAX_VALUE); + for (String metadataFile : metadataFiles) { + Tuple primaryTermRangeForMdFile = getMinMaxPrimaryTermFromMetadataFile( + metadataFile, + translogTransferManager, + oldFormatMetadataFilePrimaryTermMap + ); + primaryTermRange = new Tuple<>( + Math.max(primaryTermRange.v1(), primaryTermRangeForMdFile.v1()), + Math.min(primaryTermRange.v2(), primaryTermRangeForMdFile.v2()) + ); + if (primaryTermRange.v1().equals(primaryTermRange.v2())) { + break; + } + } + return LongStream.rangeClosed(primaryTermRange.v1(), primaryTermRange.v2()).boxed().collect(Collectors.toSet()); } protected List getMetadataFilesToBeDeleted(List metadataFiles, boolean indexDeleted) { @@ -349,7 +432,7 @@ protected static List getMetadataFilesToBeDeleted( } // Visible for testing - protected boolean isGenerationPinned(long generation, TreeSet> pinnedGenerations) { + protected static boolean isGenerationPinned(long generation, TreeSet> pinnedGenerations) { Tuple ceilingGenerationRange = pinnedGenerations.ceiling(new Tuple<>(generation, generation)); if (ceilingGenerationRange != null && generation >= ceilingGenerationRange.v1() && generation <= ceilingGenerationRange.v2()) { return true; @@ -361,7 +444,9 @@ protected boolean isGenerationPinned(long generation, TreeSet> return false; } - private TreeSet> getOrderedPinnedMetadataGenerations(Map> metadataFileGenerationMap) { + private static TreeSet> getOrderedPinnedMetadataGenerations( + Map> metadataFileGenerationMap + ) { TreeSet> pinnedGenerations = new TreeSet<>((o1, o2) -> { if (Objects.equals(o1.v1(), o2.v1()) == false) { return o1.v1().compareTo(o2.v1()); @@ -374,18 +459,10 @@ private TreeSet> getOrderedPinnedMetadataGenerations(Map> getGenerationForMetadataFiles(List metadataFiles) throws IOException { - Map> metadataFileGenerationMap = new HashMap<>(); - for (String metadataFile : metadataFiles) { - metadataFileGenerationMap.put(metadataFile, getMinMaxTranslogGenerationFromMetadataFile(metadataFile, translogTransferManager)); - } - return metadataFileGenerationMap; - } - - // Visible for testing - protected Tuple getMinMaxTranslogGenerationFromMetadataFile( + protected static Tuple getMinMaxTranslogGenerationFromMetadataFile( String metadataFile, - TranslogTransferManager translogTransferManager + TranslogTransferManager translogTransferManager, + Map> oldFormatMetadataFileGenerationMap ) throws IOException { Tuple minMaxGenerationFromFileName = TranslogTransferMetadata.getMinMaxTranslogGenerationFromFilename(metadataFile); if (minMaxGenerationFromFileName != null) { @@ -542,6 +619,16 @@ public void onResponse(List blobMetadata) { metadataFilesNotToBeDeleted.removeAll(metadataFilesToBeDeleted); staticLogger.debug(() -> "metadataFilesNotToBeDeleted = " + metadataFilesNotToBeDeleted); + Map> primaryTermGenerationsToBeDeletedMap = getGenerationsToBeDeleted( + metadataFilesNotToBeDeleted, + metadataFilesToBeDeleted, + translogTransferManager, + new HashMap<>(), + new HashMap<>(), + Long.MAX_VALUE + ); + translogTransferManager.deleteGenerationAsync(primaryTermGenerationsToBeDeletedMap, () -> {}); + // Delete stale metadata files translogTransferManager.deleteMetadataFilesAsync(metadataFilesToBeDeleted, () -> {}); diff --git a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java index 291218ea47499..e1a728ca1d8db 100644 --- a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java +++ b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferManager.java @@ -13,6 +13,7 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.OutputStreamIndexOutput; import org.opensearch.action.LatchedActionListener; +import org.opensearch.action.support.GroupedActionListener; import org.opensearch.common.SetOnce; import org.opensearch.common.blobstore.BlobMetadata; import org.opensearch.common.blobstore.BlobPath; @@ -39,6 +40,7 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Base64; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -496,6 +498,12 @@ public byte[] getMetadataBytes(TranslogTransferMetadata metadata) throws IOExcep * @param onCompletion runnable to run on completion of deletion regardless of success/failure. */ public void deleteGenerationAsync(long primaryTerm, Set generations, Runnable onCompletion) { + List translogFiles = getTranslogFilesFromGenerations(generations); + // Delete the translog and checkpoint files asynchronously + deleteTranslogFilesAsync(primaryTerm, translogFiles, onCompletion); + } + + private List getTranslogFilesFromGenerations(Set generations) { List translogFiles = new ArrayList<>(); generations.forEach(generation -> { // Add .ckp and .tlog file to translog file list which is located in basePath/ @@ -507,8 +515,47 @@ public void deleteGenerationAsync(long primaryTerm, Set generations, Runna translogFiles.add(translogFileName); } }); + return translogFiles; + } + + public void deleteGenerationAsync(Map> primaryTermToGenerationsMap, Runnable onCompletion) { + GroupedActionListener groupedActionListener = new GroupedActionListener<>(new ActionListener<>() { + @Override + public void onResponse(Collection unused) { + logger.trace(() -> "Deleted translogs for primaryTermToGenerationsMap=" + primaryTermToGenerationsMap); + onCompletion.run(); + } + + @Override + public void onFailure(Exception e) { + onCompletion.run(); + logger.error( + () -> new ParameterizedMessage( + "Exception occurred while deleting translog for primaryTermToGenerationsMap={}", + primaryTermToGenerationsMap + ), + e + ); + } + }, primaryTermToGenerationsMap.size()); + // Delete the translog and checkpoint files asynchronously - deleteTranslogFilesAsync(primaryTerm, translogFiles, onCompletion); + deleteTranslogFilesAsync(primaryTermToGenerationsMap, groupedActionListener); + } + + private void deleteTranslogFilesAsync(Map> primaryTermToGenerationsMap, ActionListener actionListener) { + for (Long primaryTerm : primaryTermToGenerationsMap.keySet()) { + try { + transferService.deleteBlobsAsync( + ThreadPool.Names.REMOTE_PURGE, + remoteDataTransferPath.add(String.valueOf(primaryTerm)), + getTranslogFilesFromGenerations(primaryTermToGenerationsMap.get(primaryTerm)), + actionListener + ); + } catch (Exception e) { + actionListener.onFailure(e); + } + } } /** diff --git a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferMetadata.java b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferMetadata.java index 7fe3305545085..4620d44a8c8ca 100644 --- a/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferMetadata.java +++ b/server/src/main/java/org/opensearch/index/translog/transfer/TranslogTransferMetadata.java @@ -119,11 +119,7 @@ private long getMinPrimaryTermReferred() { if (generationToPrimaryTermMapper.get() == null || generationToPrimaryTermMapper.get().values().isEmpty()) { return -1; } - Optional minPrimaryTerm = generationToPrimaryTermMapper.get() - .values() - .stream() - .map(s -> Long.parseLong(s)) - .min(Long::compareTo); + Optional minPrimaryTerm = generationToPrimaryTermMapper.get().values().stream().map(Long::parseLong).min(Long::compareTo); if (minPrimaryTerm.isPresent()) { return minPrimaryTerm.get(); } else { diff --git a/server/src/test/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslogTests.java b/server/src/test/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslogTests.java index 799d858b7dd12..dec79cc76bd2c 100644 --- a/server/src/test/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslogTests.java +++ b/server/src/test/java/org/opensearch/index/translog/RemoteFsTimestampAwareTranslogTests.java @@ -649,11 +649,14 @@ public void testGetGenerationsToBeDeletedEmptyMetadataFilesNotToBeDeleted() thro // 27 to 42 "metadata__9223372036854775806__9223372036854775765__9223370311919910403__31__9223372036854775780__1__1" ); - Set generations = ((RemoteFsTimestampAwareTranslog) translog).getGenerationsToBeDeleted( + Map> primaryTermGenerationsToBeDeletedMap = ((RemoteFsTimestampAwareTranslog) translog).getGenerationsToBeDeleted( metadataFilesNotToBeDeleted, metadataFilesToBeDeleted, Long.MAX_VALUE ); + + Set generations = primaryTermGenerationsToBeDeletedMap.values().stream().flatMap(Set::stream).collect(Collectors.toSet()); + Set md1Generations = LongStream.rangeClosed(4, 7).boxed().collect(Collectors.toSet()); Set md2Generations = LongStream.rangeClosed(17, 37).boxed().collect(Collectors.toSet()); Set md3Generations = LongStream.rangeClosed(27, 42).boxed().collect(Collectors.toSet()); @@ -685,11 +688,14 @@ public void testGetGenerationsToBeDeleted() throws IOException { // 27 to 42 "metadata__9223372036854775806__9223372036854775765__9223370311919910403__31__9223372036854775780__1__1" ); - Set generations = ((RemoteFsTimestampAwareTranslog) translog).getGenerationsToBeDeleted( + Map> primaryTermGenerationsToBeDeletedMap = ((RemoteFsTimestampAwareTranslog) translog).getGenerationsToBeDeleted( metadataFilesNotToBeDeleted, metadataFilesToBeDeleted, Long.MAX_VALUE ); + + Set generations = primaryTermGenerationsToBeDeletedMap.values().stream().flatMap(Set::stream).collect(Collectors.toSet()); + Set md1Generations = LongStream.rangeClosed(5, 7).boxed().collect(Collectors.toSet()); Set md2Generations = LongStream.rangeClosed(17, 25).boxed().collect(Collectors.toSet()); Set md3Generations = LongStream.rangeClosed(31, 41).boxed().collect(Collectors.toSet()); @@ -892,75 +898,78 @@ public void testIsGenerationPinned() { pinnedGenerations.add(new Tuple<>(142L, 180L)); pinnedGenerations.add(new Tuple<>(4L, 9L)); - RemoteFsTimestampAwareTranslog translog = (RemoteFsTimestampAwareTranslog) this.translog; - - assertFalse(translog.isGenerationPinned(3, pinnedGenerations)); - assertFalse(translog.isGenerationPinned(10, pinnedGenerations)); - assertFalse(translog.isGenerationPinned(141, pinnedGenerations)); - assertFalse(translog.isGenerationPinned(181, pinnedGenerations)); - assertFalse(translog.isGenerationPinned(5000, pinnedGenerations)); - assertFalse(translog.isGenerationPinned(0, pinnedGenerations)); - - assertTrue(translog.isGenerationPinned(1, pinnedGenerations)); - assertTrue(translog.isGenerationPinned(120, pinnedGenerations)); - assertTrue(translog.isGenerationPinned(121, pinnedGenerations)); - assertTrue(translog.isGenerationPinned(156, pinnedGenerations)); - assertTrue(translog.isGenerationPinned(12, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(3, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(10, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(141, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(181, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(5000, pinnedGenerations)); + assertFalse(RemoteFsTimestampAwareTranslog.isGenerationPinned(0, pinnedGenerations)); + + assertTrue(RemoteFsTimestampAwareTranslog.isGenerationPinned(1, pinnedGenerations)); + assertTrue(RemoteFsTimestampAwareTranslog.isGenerationPinned(120, pinnedGenerations)); + assertTrue(RemoteFsTimestampAwareTranslog.isGenerationPinned(121, pinnedGenerations)); + assertTrue(RemoteFsTimestampAwareTranslog.isGenerationPinned(156, pinnedGenerations)); + assertTrue(RemoteFsTimestampAwareTranslog.isGenerationPinned(12, pinnedGenerations)); } public void testGetMinMaxTranslogGenerationFromMetadataFile() throws IOException { TranslogTransferManager translogTransferManager = mock(TranslogTransferManager.class); - RemoteFsTimestampAwareTranslog translog = (RemoteFsTimestampAwareTranslog) this.translog; - // Fetch generations directly from the filename assertEquals( new Tuple<>(701L, 1008L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854774799__9223370311919910393__31__9223372036854775106__1__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(4L, 7L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854775800__9223370311919910398__31__9223372036854775803__2__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(106L, 106L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854775701__9223370311919910403__31__9223372036854775701__3__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(4573L, 99964L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854675843__9223370311919910408__31__9223372036854771234__4__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(1L, 4L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854775803__9223370311919910413__31__9223372036854775806__5__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(2474L, 3462L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854772345__9223370311919910429__31__9223372036854773333__6__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); assertEquals( new Tuple<>(5807L, 7917L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854767890__9223370311919910434__31__9223372036854770000__7__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); @@ -972,9 +981,10 @@ public void testGetMinMaxTranslogGenerationFromMetadataFile() throws IOException .thenReturn(md1); assertEquals( new Tuple<>(701L, 1008L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854774799__9223370311919910393__31__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) ); TranslogTransferMetadata md2 = mock(TranslogTransferMetadata.class); @@ -984,9 +994,10 @@ public void testGetMinMaxTranslogGenerationFromMetadataFile() throws IOException .thenReturn(md2); assertEquals( new Tuple<>(4L, 7L), - translog.getMinMaxTranslogGenerationFromMetadataFile( + RemoteFsTimestampAwareTranslog.getMinMaxTranslogGenerationFromMetadataFile( "metadata__9223372036438563903__9223372036854775800__9223370311919910398__31__1", - translogTransferManager + translogTransferManager, + new HashMap<>() ) );