You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by js...@apache.org on 2025/10/13 10:18:28 UTC

(jackrabbit-oak) branch jsedding/OAK-11980-parallel-delete-check-in-listArchives created (now 7b887db420)

This is an automated email from the ASF dual-hosted git repository.

jsedding pushed a change to branch jsedding/OAK-11980-parallel-delete-check-in-listArchives
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


      at 7b887db420 OAK-11980 - improve parallelization of I/O during segment-azure initialization

This branch includes the following new commits:

     new 7b887db420 OAK-11980 - improve parallelization of I/O during segment-azure initialization

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jackrabbit-oak) 01/01: OAK-11980 - improve parallelization of I/O during segment-azure initialization

Posted by js...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jsedding pushed a commit to branch jsedding/OAK-11980-parallel-delete-check-in-listArchives
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 7b887db420e88ba81d51b40c0a2f050ef8578c53
Author: Julian Sedding <js...@apache.org>
AuthorDate: Mon Oct 13 12:18:11 2025 +0200

    OAK-11980 - improve parallelization of I/O during segment-azure initialization
---
 .../oak/segment/azure/AzureArchiveManager.java     | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java
index 1f130a9849..7d9cea22ba 100644
--- a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java
+++ b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java
@@ -25,6 +25,7 @@ import com.azure.storage.blob.models.BlobStorageException;
 import com.azure.storage.blob.models.ListBlobsOptions;
 import com.azure.storage.blob.models.CopyStatusType;
 import com.azure.storage.blob.specialized.BlockBlobClient;
+import org.apache.jackrabbit.oak.commons.internal.concurrent.ForkJoinUtils;
 import org.apache.jackrabbit.oak.segment.remote.RemoteUtilities;
 import org.apache.jackrabbit.oak.segment.remote.WriteAccessController;
 import org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor;
@@ -37,8 +38,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -91,16 +94,21 @@ public class AzureArchiveManager implements SegmentArchiveManager {
                     .filter(blobName -> blobName.endsWith(".tar"))
                     .collect(Collectors.toList());
 
-            Iterator<String> it = archiveNames.iterator();
-            while (it.hasNext()) {
-                String archiveName = it.next();
-                if (deleteInProgress(archiveName)) {
-                    if (writeAccessController.isWritingAllowed()) {
-                        delete(archiveName);
-                    }
-                    it.remove();
-                }
-            }
+            Set<String> archivesToDelete = ForkJoinUtils.invokeInCustomPool(
+                    "AzureArchiveManager-deleted-archive-handler",
+                    Math.min(64, archiveNames.size()),
+                    () -> archiveNames.stream()
+                            .parallel()
+                            .filter(this::deleteInProgress)
+                            .peek(archiveName -> {
+                                if (writeAccessController.isWritingAllowed()) {
+                                    delete(archiveName);
+                                }
+                            })
+                            .collect(Collectors.toUnmodifiableSet()));
+
+            archiveNames.removeAll(archivesToDelete);
+
             return archiveNames;
         } catch (BlobStorageException e) {
             throw new IOException(e);