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/05/17 14:09:41 UTC

(jackrabbit-oak) branch trunk updated: OAK-10814 - Tar file recovery still fails with SNFE in some cases. (#1468)

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

miroslav pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c80a8f816d OAK-10814 - Tar file recovery still fails with SNFE in some cases. (#1468)
c80a8f816d is described below

commit c80a8f816d8f0f0f315951e1365e4a9967a84fd7
Author: Axel Hanikel <ah...@gmail.com>
AuthorDate: Fri May 17 16:09:35 2024 +0200

    OAK-10814 - Tar file recovery still fails with SNFE in some cases. (#1468)
    
    * OAK-10814 - Reproduce issue by modifying existing test.
    
    * OAK-10814 - Put recovered segment in cache, making it available during recovery.
    
    ---------
    
    Co-authored-by: Axel Hanikel <ah...@adobe.com>
---
 .../java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java  | 1 +
 .../java/org/apache/jackrabbit/oak/segment/LongIdMappingBlobStore.java  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java
index 9f5e168653..ce4ec19495 100644
--- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java
+++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java
@@ -234,6 +234,7 @@ public abstract class AbstractFileStore implements SegmentStore, Closeable {
         if (SegmentId.isDataSegmentId(lsb)) {
             SegmentId segmentId = tracker.newSegmentId(msb, lsb);
             Segment segment = new Segment(tracker, segmentReader, segmentId, buffer);
+            segmentCache.putSegment(segment);
             w.addSegment(segment);
             populateTarGraph(segment, w);
             populateTarBinaryReferences(segment, w);
diff --git a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/LongIdMappingBlobStore.java b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/LongIdMappingBlobStore.java
index 2b51647bc7..5a260e3d28 100644
--- a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/LongIdMappingBlobStore.java
+++ b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/LongIdMappingBlobStore.java
@@ -25,7 +25,7 @@ public class LongIdMappingBlobStore extends IdMappingBlobStore {
 
     @Override
     protected String generateId() {
-        return Strings.repeat("0", Segment.BLOB_ID_SMALL_LIMIT) + next++;
+        return Strings.repeat("0", Segment.BLOB_ID_SMALL_LIMIT * 20) + next++;
     }
 
 }