[
https://issues.apache.org/jira/browse/OAK-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15316418#comment-15316418
]
Francesco Mari edited comment on OAK-4102 at 6/6/16 12:31 PM:
--------------------------------------------------------------
The work for OAK-4373 made very easy to find a (potential) solution for this
issue. With [^OAK-4102-01.patch] I propose the following changes:
# Introduce a {{SegmentIdMaker}} to create a new {{SegmentId}} given a msb/lsb
pair.
# Remove the reference from {{SegmentIdTable}} to {{SegmentStore}}.
# In {{SegmentIdTable}} and {{SegmentTracker}}, every method that performs an
insertion of a new {{SegmentId}} receives a reference to a {{SegmentIdMaker}}.
The creation of the {{SegmentId}} is delegated to the {{SegmentIdMaker}}
instance.
# {{SegmentStore}} can be used to lookup existing {{SegmentId}} or to create
new data/bulk {{SegmentId}}. This change shelters users of a {{SegmentStore}}
from the {{SegmentTracker}}, which is more and more an implementation detail of
the {{SegmentStore}}.
I run every unit/integration test locally, and I didn't see any failure. The
patch still needs some work, especially regarding documentation. [~mduerig],
what do you think about this?
was (Author: frm):
The work for OAK-4373 made very easy to find a (potential) solution for this
issue. With [^OAK-4102-01.patch] I propose the following changes:
# Introduce a {{SegmentIdMaker}} to create a new {{SegmentId}} given a msb/lsb
pair.
# Remove the reference from {{SegmentIdTable}} to {{SegmentStore}}.
# In {{SegmentIdTable}} and {{SegmentTracker}}, every method that performs an
insertion of a new {{SegmentId}} receives a reference to a {{SegmentIdMaker}}.
The creation of the {{SegmentId}} is delegated to the {{SegmentIdMaker}}
instance.
# {{SegmentStore}} can be used to lookup existing {{SegmentId}} or to create
new data/bulk {{SegmentId}}. This change shelters users of a {{SegmentStore}}
from the {{SegmentTracker}}, which is more and more an implementation detail of
the {{SegmentStore}}.
I run every unit/integration test locally, and I didn't see any failure. The
patch still needs some work, especially regarding documentation. [~mduerig],
what do you think about this?
> Break cyclic dependency of FileStore and SegmentTracker
> -------------------------------------------------------
>
> Key: OAK-4102
> URL: https://issues.apache.org/jira/browse/OAK-4102
> Project: Jackrabbit Oak
> Issue Type: Technical task
> Components: segment-tar
> Reporter: Michael Dürig
> Assignee: Francesco Mari
> Labels: technical_debt
> Fix For: 1.6
>
> Attachments: OAK-4102-01.patch
>
>
> {{SegmentTracker}} and {{FileStore}} are mutually dependent on each other.
> This is problematic and makes initialising instances of these classes
> difficult: the {{FileStore}} constructor e.g. passes a not fully initialised
> instance to the {{SegmentTracker}}, which in turn writes an initial node
> state to the store. Notably using the not fully initialised {{FileStore}}
> instance!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)