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

Chetan Mehrotra commented on OAK-4714:
--------------------------------------

For other modes reindexing should not be done but then we need to decide what 
should be done in that case. Simplest would be to avoid looking for editor in 
other modes. This becomes interesting as detailed below!

*Supporting Reindex on live system with minimal impact*

Suppose there is an index definition at /oak:index/fooIndex defined and system 
is running fine. Now for some reason the index needs to be reindex ( say due to 
some index corruption or updation of index definition to index some more 
stuff). In current case if this is done in a running system then it would block 
the async index update for the duration of reindex and in that time frame index 
would be stale and reflect old state of repository (prior to reindex).

Now with hybrid index this can be handled better. For hybrid index - The index 
state can still be updated on each cluster node (based on old index definition) 
which async indexing is busy in reindexing phase. End query result would 
include recent changes and hence would not be stale due to async index lagging 
with reindexing work.

So the adverse impact of reindexing can be reduced and reindexing can be done 
on a live system and query results would still pick up recent changes.

For this to happen we would need to invoke the index editor in "incremental" 
mode for sync commit (even though reindex is true) and have index editor figure 
out which index definition it would be use in such a phase. For Lucene case we 
still have access to older index via IndexTracker so can continue to index with 
old definition and return updated result for queries.

However I am not sure on how to implement such a support. Possibly this part 
can be addressed in separate issue

[~alex.parvulescu] [~catholicon] Thoughts and suggestion for the main issue and 
scenario explained in this comment


> Reindexing should only happen in async mode for a mix mode index definition
> ---------------------------------------------------------------------------
>
>                 Key: OAK-4714
>                 URL: https://issues.apache.org/jira/browse/OAK-4714
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.8
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.6
>
>
> With OAK-4641 support was added for enabling use of same index definition for 
> both async and sync mode. This causes issue for reindexing as with this 
> change it would be attempted for both modes.
> Instead for a mixed mode index definition reindexing should be bounded to 
> only one of the modes and only for that mode reindexing should be performed. 



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

Reply via email to