[ 
https://issues.apache.org/jira/browse/OAK-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14003394#comment-14003394
 ] 

Amit Jain commented on OAK-1817:
--------------------------------

The blob gc passes after making the change as in the patch.

As for the test case it strangely passes.
The following code snippet passes, which means that the blobId returned is null.
{code}
Blob b1 = testCreateAndRead(createBlob(fds.getMinRecordLength()));
assertTrue(b1 instanceof SegmentBlob);
assertNull(((SegmentBlob) b1).getBlobId());
{code}

But when collecting blob references (after adding the same blob as above),  in 
the {{Segment#collectBlobReferences}}, blobrefcount comes out to be 0, because 
of which it does not go into the loop. Looks like there is some edge case 
missing here.

> NPE in MarkSweepGarbageCollector.saveBatchToFile during Datastore GC with 
> FileDataStore
> ---------------------------------------------------------------------------------------
>
>                 Key: OAK-1817
>                 URL: https://issues.apache.org/jira/browse/OAK-1817
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: blob
>    Affects Versions: 0.20
>            Reporter: Konrad Windszus
>            Assignee: Chetan Mehrotra
>         Attachments: NodeAndDataStoreOsgiConfig.zip, OAK-1817.patch
>
>
> During running a datastore garbage collection on a Jackrabbit 2 FileDataStore 
> (org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore, see 
> http://jackrabbit.apache.org/oak/docs/osgi_config.html) an NPE is thrown
> {code}
> 13.05.2014 17:50:16.944 *ERROR* [qtp1416657193-147] 
> org.apache.jackrabbit.oak.management.ManagementOperation Blob garbage 
> collection failed
> java.lang.RuntimeException: Error in retrieving references
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector$1.addReference(MarkSweepGarbageCollector.java:395)
>       at 
> org.apache.jackrabbit.oak.plugins.segment.Segment.collectBlobReferences(Segment.java:248)
>       at 
> org.apache.jackrabbit.oak.plugins.segment.SegmentTracker.collectBlobReferences(SegmentTracker.java:178)
>       at 
> org.apache.jackrabbit.oak.plugins.segment.SegmentBlobReferenceRetriever.collectReferences(SegmentBlobReferenceRetriever.java:38)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector.iterateNodeTree(MarkSweepGarbageCollector.java:361)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector.mark(MarkSweepGarbageCollector.java:201)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector.markAndSweep(MarkSweepGarbageCollector.java:173)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector.collectGarbage(MarkSweepGarbageCollector.java:149)
>       at 
> org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService$2.collectGarbage(SegmentNodeStoreService.java:185)
>       at org.apache.jackrabbit.oak.plugins.blob.BlobGC$1.call(BlobGC.java:68)
>       at org.apache.jackrabbit.oak.plugins.blob.BlobGC$1.call(BlobGC.java:64)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException: null
>       at 
> com.google.common.base.Preconditions.checkNotNull(Preconditions.java:192)
>       at com.google.common.base.Joiner.toString(Joiner.java:436)
>       at com.google.common.base.Joiner.appendTo(Joiner.java:108)
>       at com.google.common.base.Joiner.appendTo(Joiner.java:152)
>       at com.google.common.base.Joiner.join(Joiner.java:193)
>       at com.google.common.base.Joiner.join(Joiner.java:183)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector.saveBatchToFile(MarkSweepGarbageCollector.java:317)
>       at 
> org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector$1.addReference(MarkSweepGarbageCollector.java:391)
>       ... 14 common frames omitted
> {code}
> Attached you find the OSGi config for both the nodestore and the datastore.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to