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

Chetan Mehrotra commented on OAK-2045:
--------------------------------------

bq.  Instead we should rely on a mapping from the old to the new node state. 
With CompactionMap we already have something along these lines.

The problem with CompactionMap based approach is that we need to maintain the 
map state (for still living SegmentId) across all the cleanup operations. And 
if the segmentId got shifted multiple times then track it all along. Given that 
path looks more stable

bq. This also affects the notion of identity for Record instances. AFICS it 
even breaks the contract of the hashCode method as equal node states might have 
different hash codes now. 

Yup thats a drawback of this approach. But then the old NodeState is now linked 
to latest revision so effectively we have a newer NodeState. One way or the 
other this contract would be broken under this approach

bq. This one is only handled in SegmentNodeStates. I foresee issues for 
SegmentBlob which clients also might keep references to. 

Thanks for highlighting that. Would update the patch to handle the case for 
SegmentBlob also. Main focus is on type of Records which might be directly 
referred by calling code. So {{SegmentNodeState}} is possible but PropertyState 
is not likely. SegmentBlob thought would be referred in the Lucene OakDirectory 
so need to accounted for.

> Long running JCR session prevent live cleanup in Segment FileStore
> ------------------------------------------------------------------
>
>                 Key: OAK-2045
>                 URL: https://issues.apache.org/jira/browse/OAK-2045
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segmentmk
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.1
>
>         Attachments: OAK-2045-segment-fault-approach.patch, 
> OAK-2045-test-fix.patch
>
>
> Cleanup operation in SegmentNodeStore detects the un referenced garbage and 
> clean it up. To determine the reference validity it starts with an initial 
> set of SegmentId which have a live java reference. 
> This works fine for simple setup but when Oak repository is used in an 
> application (like Sling) where application code can create long running 
> session (for observation) then such session are bound to old NodeState at 
> time of startup. Such references prevent the cleanup logic to remove older 
> revisions while system is running. Such revisions can only be removed via an 
> offline compaction-> cleanup.
> Need to find out a way where we can _migrate_ such old NodeState references 
> to newer revisions



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

Reply via email to