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 mi...@apache.org on 2024/02/15 10:28:59 UTC
(jackrabbit-oak) branch issue/OAK-10652 created (now 69887c9ed5)
This is an automated email from the ASF dual-hosted git repository.
miroslav pushed a change to branch issue/OAK-10652
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
at 69887c9ed5 OAK-10652 obrain lock in target SegmentNodeStorePersistence
This branch includes the following new commits:
new 69887c9ed5 OAK-10652 obrain lock in target SegmentNodeStorePersistence
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-10652 obrain lock in target SegmentNodeStorePersistence
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
miroslav pushed a commit to branch issue/OAK-10652
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 69887c9ed51c2b94eba301ad1d763b6447bf5a8a
Author: Miroslav Smiljanic <mi...@apache.com>
AuthorDate: Thu Feb 15 11:28:15 2024 +0100
OAK-10652 obrain lock in target SegmentNodeStorePersistence
---
.../jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java | 5 +++++
.../jackrabbit/oak/segment/azure/tool/SegmentCopyTestBase.java | 4 ----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java
index 997cf51897..43677b62ef 100644
--- a/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java
+++ b/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentStoreMigrator.java
@@ -33,6 +33,7 @@ import org.apache.jackrabbit.oak.segment.spi.monitor.RemoteStoreMonitorAdapter;
import org.apache.jackrabbit.oak.segment.spi.persistence.GCJournalFile;
import org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileReader;
import org.apache.jackrabbit.oak.segment.spi.persistence.JournalFileWriter;
+import org.apache.jackrabbit.oak.segment.spi.persistence.RepositoryLock;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveEntry;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveManager;
import org.apache.jackrabbit.oak.segment.spi.persistence.SegmentArchiveReader;
@@ -88,10 +89,14 @@ public class SegmentStoreMigrator implements Closeable {
}
public void migrate() throws IOException, ExecutionException, InterruptedException {
+ RepositoryLock repositoryLock = target.lockRepository();
+
RETRIER.execute(this::migrateJournal);
RETRIER.execute(this::migrateGCJournal);
RETRIER.execute(this::migrateManifest);
migrateArchives();
+
+ repositoryLock.unlock();
}
private void migrateJournal() throws IOException {
diff --git a/oak-segment-azure/src/test/java/oak/apache/jackrabbit/oak/segment/azure/tool/SegmentCopyTestBase.java b/oak-segment-azure/src/test/java/oak/apache/jackrabbit/oak/segment/azure/tool/SegmentCopyTestBase.java
index a732dbeb36..95ea2a63d1 100644
--- a/oak-segment-azure/src/test/java/oak/apache/jackrabbit/oak/segment/azure/tool/SegmentCopyTestBase.java
+++ b/oak-segment-azure/src/test/java/oak/apache/jackrabbit/oak/segment/azure/tool/SegmentCopyTestBase.java
@@ -102,8 +102,6 @@ public abstract class SegmentCopyTestBase {
SegmentNodeStorePersistence srcPersistence = getSrcPersistence();
SegmentNodeStorePersistence destPersistence = getDestPersistence();
- RepositoryLock destRepositoryLock = destPersistence.lockRepository();
-
String srcPathOrUri = getSrcPathOrUri();
String destPathOrUri = getDestPathOrUri();
@@ -123,8 +121,6 @@ public abstract class SegmentCopyTestBase {
checkJournal(srcPersistence, destPersistence);
checkGCJournal(srcPersistence, destPersistence);
checkManifest(srcPersistence, destPersistence);
-
- destRepositoryLock.unlock();
}
private int runSegmentCopy(SegmentNodeStorePersistence srcPersistence, SegmentNodeStorePersistence destPersistence,