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

Chetan Mehrotra commented on OAK-3606:
--------------------------------------

This alone might not be sufficient as post index update the index gets 
refreshed in {{IndexTracker}} in Lucene in async manner as it uses 
{{BackgroundObserver}}. So to make it more accurate we would need some state 
info from index side which are being used by query to determine upto what state 
they have done the indexing.

This should now be possible via the use of {{CommitInfo}}
* AsyncIndexUpdate sets the time at which checkpoint is created in CommitInfo
* LuceneIndexEditors pickup this time and then stores them as part of index data
* When index gets opened in IndexTracker this time can be accessed

Note that this would only be reflected in those index which got affected by the 
change done i.e. they index data from that change. If not then there last 
indexed time would continue to reflect the old time

> Improvements for IndexStatsMBean usage
> --------------------------------------
>
>                 Key: OAK-3606
>                 URL: https://issues.apache.org/jira/browse/OAK-3606
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, lucene
>    Affects Versions: 1.3.9
>            Reporter: Thierry Ygé
>            Assignee: Chetan Mehrotra
>         Attachments: adding_new_MBean.patch, 
> new_mbean_interface_and_implementation.patch
>
>
> When running integration tests, it is common to have the need to wait for the 
> async indexes to have been executed. So that the test can successfully 
> validate operations that depend on the search result.
> With the current IndexStatsMBean implementation it cannot return the start 
> time of the last successful indexing. It provide a "LastIndexedTime" which is 
> not sufficient to know if changes made recently are now indexed.
> The idea is to set the start time as value of a new attribute (i.e 
> "StartLastSuccessIndexedTime") to the IndexStatsMBean.
> Then create a new Mbean that calculate from all existing IndexStatsMBean (as 
> multiple are possible now) the oldest "StartLastSuccessIndexedTime".
> That will allow integration tests to be able to wait until that oldest 
> "StartLastSuccessIndexedTime" is greater than the time it started to wait.
> Attached is a sample patch containing the necessary changes (for a Oak core 
> 1.4.0-SNAPSHOT).



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

Reply via email to