[jira] [Commented] (OAK-8166) Index definition with orderable property definitions with and without functions breaks index

2019-03-31 Thread Nitin Gupta (JIRA)


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

Nitin Gupta commented on OAK-8166:
--

Starting work on this issue .

> Index definition with orderable property definitions with and without 
> functions breaks index
> 
>
> Key: OAK-8166
> URL: https://issues.apache.org/jira/browse/OAK-8166
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: indexing
>Affects Versions: 1.8.12
>Reporter: Tom Blackford
>Priority: Major
>
> If an index definition contains the same orderable property with and without 
> functions, it will fail to index any node which contains that property. The 
> failure will be logged as [1].
> Steps to reproduce:
> * Configure index with the two property definitions shown at [2].
> * Refresh the index definition
> * Modify a node that falls under the definition - it will fail with the 
> exception shown at [1]
> * Modify the 'non-function' index definition to not be orderable 
> (orderable=false)
> * Refresh the index definition
> * Modify the same node - note there is no exception.
> Thanks to [~catholicon] for assistance identifying root cause.
> [1]
> {code}
> 25.03.2019 15:39:04.135 *WARN* [async-index-update-async] 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor Failed to 
> index the node [/content/dam/Unknown-2.png]
> java.lang.IllegalArgumentException: DocValuesField 
> ":dvjcr:content/metadata/dc:title" appears more than once in this document 
> (only one value is allowed per field)
>   at 
> org.apache.lucene.index.SortedDocValuesWriter.addValue(SortedDocValuesWriter.java:62)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.DocValuesProcessor.addSortedField(DocValuesProcessor.java:125)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.DocValuesProcessor.addField(DocValuesProcessor.java:59)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.TwoStoredFieldsConsumers.addField(TwoStoredFieldsConsumers.java:36)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.DocFieldProcessor.processDocument(DocFieldProcessor.java:236)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:253)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:455)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1534) 
> [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1507) 
> [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.jackrabbit.oak.plugins.index.lucene.writer.DefaultIndexWriter.updateDocument(DefaultIndexWriter.java:86)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.addOrUpdate(LuceneIndexEditor.java:258)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.leave(LuceneIndexEditor.java:140)
>  [org.apache.jackrabbit.oak-lucene:1.8.9]
>   at 
> org.apache.jackrabbit.oak.spi.commit.CompositeEditor.leave(CompositeEditor.java:74)
>  [org.apache.jackrabbit.oak-store-spi:1.8.9]
> {code}
> [2] 
> {code}
> "dcTitle": {
> "jcr:primaryType": "nt:unstructured",
> "nodeScopeIndex": "true",
> "useInSuggest": "true",
> "ordered": "true",
> "propertyIndex": "true",
> "useInSpellcheck": "true",
> "name": "jcr:content/metadata/dc:title",
> "boost": "2.0"
> },
>   "dcTitleLowercase": {
> "jcr:primaryType": "nt:unstructured",
> "ordered": "true",
> "propertyIndex": "true",
> "function": "fn:lower-case(jcr:content/metadata/@dc:title)"
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OAK-8048) VersionHistory not removed when removing node and all its versions

2019-03-31 Thread Marco Piovesana (JIRA)


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

Marco Piovesana commented on OAK-8048:
--

Hi all,

I would like to propose a solution for this bug (attached patch).

I saw that the class responsible for checking whether or not to remove the 
history is the {{OrphanedVersionCleaner}}, but I thought that was better to add 
the logic directly into {{ReadWriteVersionManager}} for three reasons:
 # All the logic used within the {{leave}} method works for nodes and not 
versions
 # The {{OrphanedVersionCleaner.leave}} method is called much more often than 
the {{ReadWriteVersionManager.removeVersion}}, that is called only when a 
version is removed
 # The class {{ReadWriteVersionManager}} contains already all the logic to 
check if the history is empty and remove it

let me know if the proposed solution if ok, or what can I do to make it better.

 

thanks, Marco.[^fix-OAK-8048.patch]

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Priority: Major
> Attachments: fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-34):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (OAK-8048) VersionHistory not removed when removing node and all its versions

2019-03-31 Thread Marco Piovesana (JIRA)


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

Marco Piovesana updated OAK-8048:
-
Attachment: fix-OAK-8048.patch

> VersionHistory not removed when removing node and all its versions
> --
>
> Key: OAK-8048
> URL: https://issues.apache.org/jira/browse/OAK-8048
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.8.9
>Reporter: Marco Piovesana
>Priority: Major
> Attachments: fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-34):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)