[
https://issues.apache.org/jira/browse/OAK-9134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17152813#comment-17152813
]
Marcel Reutegger commented on OAK-9134:
---------------------------------------
[~corderob], we usually don't use environment variables to control behaviour,
but rather system properties.
The change in {{VersionableState}} looks good. I was wondering if the node type
check could be cached. Instead of checking the node type whenever a frozen node
is created for a version, just do it once and then remember it in the
{{VersionableState}}.
For the change in {{InitialContent}}, we should probably clarify what the exact
behaviour should be. The way I see it, new repositories should get
nt:frozenNode as defined in JCR 2.0. Existing repositories initialized before
this change should continue using a nt:frozenNode definition that extends from
mix:referenceable. This should be automatic and not need any intervention with
a system property. Still, it would be good to have a system property that
allows a user to keep the current definition on a fresh repository if really
needed.
This would mean {{InitialContent.registerBuiltIn()}} needs some additional
logic that checks whether the repository is initialized for the first time.
This could be done by checking for a node at path
{{/jcr:system/jcr:nodeTypes/nt:frozenNode}}. If it doesn't exist, then this
indicates the built in node types have not been registered yet. As for the two
CND variants that are needed depending on the case, {{builtin_nodetypes.cnd}}
could be the new version with nt:frozenNode *not* extending from
mix:referenceable. When {{registerBuiltIn()}} checks for
{{/jcr:system/jcr:nodeTypes/nt:frozenNode}}, it could also read the supertypes
and then decide to patch the {{builtin_nodetypes.cnd}} accordingly before it is
passed to {{NodeTypeRegistry.register()}}.
> Remove mix:referenceable from nt:frozenNode definition
> ------------------------------------------------------
>
> Key: OAK-9134
> URL: https://issues.apache.org/jira/browse/OAK-9134
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, jcr
> Reporter: José Andrés Cordero Benítez
> Priority: Minor
> Labels: patch
> Attachments: OAK-9134-remove-referenceable-from-test.patch,
> OAK-9134-remove-referenceable-frozenNode.patch
>
>
> One of the changes between JCR 1.0 and JCR 2.0 is the definition of
> nt:frozenNode. In JCR 1.0 the node type extends from mix:referenceable, while
> in JCR 2.0 it does [not
> anymore|https://docs.adobe.com/docs/en/spec/jcr/2.0/3_Repository_Model.html#3.13.4.1%20nt:frozenNode].
> Oak currently uses a nt:frozenNode definition that extends from
> mix:referenceable. This adds quite a bit of overhead because each node
> written under a JCR version gets a jcr:uuid, which is indexed by default.
> The proposal is to remove the supertype "mix:referenceable" from
> nt:frozenNode.
> Removing this supertype, the frozenNodes wouldn't have a "jcr:uuid" field,
> which at the end is not used, and allows to reduce the size of the index.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)