[ 
https://issues.apache.org/jira/browse/OAK-2752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Parvulescu updated OAK-2752:
---------------------------------
    Attachment: OAK-2752-v3.patch

tentative new patch based on offline discussion with MichaelD and Thomas 
comments.

from what I gather the problems are when the table is at near capacity, the 
looping around causes a lot of performance issues, so the idea would be to 
increase the capacity when it goes beyond a certain threshold.
another problem is overwriting existing items, which can happen with the 
current version of the patch.

the current approach is to keep track of the number of moves from the starting 
point and once that goes beyond 0.75 we can directly increase the size and add 
the item at the index pointing to the old end of the list, which will 
definitely be a null slot.
I might have left stuff out, feel free to break it apart if it doesn't look 
right. 
[~tmueller] [~mduerig]






> SegmentIdTable can sometimes hang when calling getSegmentId(msb, lsb)
> ---------------------------------------------------------------------
>
>                 Key: OAK-2752
>                 URL: https://issues.apache.org/jira/browse/OAK-2752
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-core
>    Affects Versions: 1.2
>            Reporter: Will McGauley
>            Assignee: Alex Parvulescu
>            Priority: Critical
>             Fix For: 1.0.13, 1.2.1
>
>         Attachments: OAK-2752-v2.patch, OAK-2752-v3.patch, OAK-2752.patch
>
>
> The while loop getSegmentId(msb, lsb) loops forever in the situation where 
> the segment id is not found. 
> Looping occurs from 'first' and loops to the end of the SegmentId references, 
> and then loops back to first.  If the segmentid is not found in any of the 
> referenced items then looping continues past 'first' again and loops for 
> eternity through all the references.
> See attached patch for possible fix to break out of the loop after getting 
> back to 'first' again.
> note: I have tested this patch on my system and it seems to work, but I do 
> not know if the patch provides the best fix, I am a bit new to this code.  
> The most important part of the patch would be the break condition from the 
> loop so the loop does not continue after testing each reference



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to