mreutegg commented on code in PR #1892:
URL: https://github.com/apache/jackrabbit-oak/pull/1892#discussion_r2209428991


##########
oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java:
##########
@@ -162,9 +162,13 @@ private void migrateArchives() throws IOException, 
ExecutionException, Interrupt
         List<String> targetArchives = targetManager.listArchives();
 
         if (appendMode && !targetArchives.isEmpty()) {
-            //last archive can be updated since last copy and needs to be 
recopied
-            String lastArchive = targetArchives.get(targetArchives.size() - 1);
-            targetArchives.remove(lastArchive);
+            // last archive could have been updated since last copy and needs 
to be recopied
+            try {
+                targetArchives.sort(String::compareTo);

Review Comment:
   Sorting lexicographically only work with up to 5 digits in the archive name.
   ```
   data00001a.tar
   data33985b.tar
   data99999a.tar
   ```
   But the archive name permits more digits up to an archive number of 
Integer.MAX_Value.
   
   
https://github.com/apache/jackrabbit-oak/blob/5b13b559dc9d31a20676353782abff7c96e59f13/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tar/TarFiles.java#L261



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to