jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject commit hooks and indexing
Date Thu, 14 Feb 2013 20:29:23 GMT


AFAIK indexing currently uses commit hooks for keeping the index up to 
date when content changes. As Jukka mentioned this might not be the 
right thing to do since when a commit fails, we end up with invalid 
index entries. The conclusion was, that indexing should use the 
Observer, which is only called after a successful commit rather then a 
commit hook. (See OAK-628 for why this currently wouldn't work though).

However, there is a difference depending on whether the index is stored 
in content or external. For the former case using commit hooks is the 
right thing to do. In the case of a failed commits nothing is written at 
all, not even the index data. Using and observer here still works, but 
would leave the index lagging behind for the time the commit actually 
succeeded until the observer is finally called.

For externally stored indexes I think we need to live with the lag in 
favour of having a consistent index.


View raw message