This is an automated email from the ASF dual-hosted git repository. keith-turner pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 853433bd11033012e29a4d8240d9b1f6da1cad89 Merge: ba0291c74e e6edbaf056 Author: Keith Turner <[email protected]> AuthorDate: Fri Nov 6 17:53:00 2026 +0000 Merge branch '2.1' .../org/apache/accumulo/tserver/log/ResolvedSortedLog.java | 4 ++-- .../apache/accumulo/tserver/log/TabletServerLogger.java | 4 +++- .../accumulo/tserver/log/RecoveryLogsIteratorTest.java | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/log/ResolvedSortedLog.java index b9faa8c8f7,91041f9396..0de01e5ee5 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/ResolvedSortedLog.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/ResolvedSortedLog.java @@@ -66,10 -64,10 +66,10 @@@ public class ResolvedSortedLog } /** - * @return When an unsorted walog is sorted the sorted data is stored in one os more rfiles, this + * @return When an unsorted walog is sorted the sorted data is stored in one or more rfiles, this * returns the paths of those rfiles. */ - public SortedSet<Path> getChildren() { + public SortedSet<UnreferencedTabletFile> getChildren() { return children; } @@@ -85,10 -83,23 +85,10 @@@ */ public static ResolvedSortedLog resolve(LogEntry logEntry, VolumeManager fs) throws IOException { - // convert the path of on unsorted logs to the expected path for the corresponding sorted log + // convert the path of an unsorted log to the expected path for the corresponding sorted log // dir - Path sortedLogPath = RecoveryPath.getRecoveryPath(new Path(logEntry.filename)); + Path sortedLogPath = RecoveryPath.getRecoveryPath(new Path(logEntry.getPath())); - return resolve(logEntry, sortedLogPath, fs); - } - - /** - * Resolve a sorted log directory path. This is useful for diagnostic tools that operate directly - * on sorted recovery logs without going through the normal recovery flow with LogEntry objects. - */ - public static ResolvedSortedLog resolve(Path sortedLogDir, VolumeManager fs) throws IOException { - return resolve(new LogEntry(null, 0, sortedLogDir.toString()), sortedLogDir, fs); - } - - private static ResolvedSortedLog resolve(LogEntry logEntry, Path sortedLogPath, VolumeManager fs) - throws IOException { boolean foundFinish = false; // Path::getName compares the last component of each Path value. In this case, the last // component should diff --cc server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsIteratorTest.java index 76516fbed8,13595ad16b..bb13482077 --- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsIteratorTest.java +++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsIteratorTest.java @@@ -27,10 -26,11 +27,11 @@@ import static org.easymock.EasyMock.ver import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -import java.io.File; import java.io.IOException; import java.util.ArrayList; + import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@@ -169,13 -155,27 +170,26 @@@ public class RecoveryLogsIteratorTest e Map<String,KeyValue[]> logs = new TreeMap<>(); logs.put("keyValues", keyValues); - ArrayList<Path> dirs = new ArrayList<>(); + ArrayList<ResolvedSortedLog> dirs = new ArrayList<>(); - createRecoveryDir(logs, dirs, false); - - assertThrows(IOException.class, - () -> new RecoveryLogsIterator(context, pathsToResolvedLogs(dirs), null, null, false), + var exception = assertThrows(IOException.class, () -> createRecoveryDir(logs, dirs, false), "Finish marker should not be found"); + assertTrue(exception.getMessage().contains("'finished' flag not found")); } + @Test + public void testSingleFile() throws IOException { - String destPath = workDir + "/test.rf"; ++ String destPath = "file://" + workDir + "/" + VolumeManager.FileType.WAL.getDirectory() ++ + "/localhost+9997/" + UUID.randomUUID(); + fs.create(new Path(destPath)); + + assertThrows(IOException.class, + () -> new RecoveryLogsIterator(context, - Collections.singletonList(ResolvedSortedLog.resolve(new Path(destPath), fs)), null, - null, false), ++ Collections.singletonList(ResolvedSortedLog.resolve(LogEntry.fromPath(destPath), fs)), ++ null, null, false), + "Finish marker should not be found for a single file."); + } + @Test public void testCheckFirstKeyFailed() throws IOException { KeyValue keyValue = new KeyValue();
