[
https://issues.apache.org/jira/browse/OAK-5212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15714559#comment-15714559
]
Chetan Mehrotra edited comment on OAK-5212 at 12/2/16 9:18 AM:
---------------------------------------------------------------
Added ignored test with 1772322
[patch|^OAK-5212-v1.patch] for fixing this
Updated the logic in DefaultIndexWriter to check for Index generation at start
and after index writer is closed. If the generation differs then thats an
indication that index has been updated.
IndexWriter does not provide a reliable way to determine if it has modified
something (has some false positves due to delete handling)
[~teofili] Can you review the Lucene API usage
[~catholicon] [~alex.parvulescu] Would be good if you can review it too!
was (Author: chetanm):
[patch|^OAK-5212-v1.patch] for the same.
Updated the logic in DefaultIndexWriter to check for Index generation at start
and after index writer is closed. If the generation differs then thats an
indication that index has been updated.
IndexWriter does not provide a reliable way to determine if it has modified
something (has some false positves due to delete handling)
[~teofili] Can you review the Lucene API usage
[~catholicon] [~alex.parvulescu] Would be good if you can review it too!
> Avoid updating the index nodestate if no change is done in index
> ----------------------------------------------------------------
>
> Key: OAK-5212
> URL: https://issues.apache.org/jira/browse/OAK-5212
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Chetan Mehrotra
> Assignee: Chetan Mehrotra
> Priority: Minor
> Labels: performance
> Fix For: 1.6
>
> Attachments: OAK-5212-v1.patch
>
>
> As noted in OAK-5211 directory listing was getting modified (due to reorder)
> even if no change happens in index.
> Another place where we update state post index close is at ":status" node
> where we store {{lastUpdated}} and {{indexedNodes}} post index close. In
> normal cases LuceneIndexEditor avoids initializing the IndexWriter if there
> is no change. However it can happen that when any node gets deleted the
> editor performs a delete operation. It can happen that tree being deleted is
> not indexed but still editor would do this as it cannot determine that
> easily. And in doing that IndexWriter would be initialized.
> Currently IndexWriter being initialized is considered same as index updated.
> Due to this index status nodes gets unnecessarily updated even if there is no
> change in index which causes the IndexTracker to reopen the index even when
> it has not changed.
> We should make this more explicit and find a way to determine if index has
> been updated or not
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)