Marcel Reutegger wrote: > Jukka Zitting wrote: > >> Marcel, just out of curiosity, would it be possible to run the indexer >> using asynchronous events or would that cause some complications? > > > yes, there are two issues with this approach: > > - there would be no guarantee anymore that you will find nodes with a > query that were just added. This then depends on when the asynchronous > notification updates the index.
Can't this be delayed until query time. When a query is run, determine if indexing is required and do it at that time not when changing the node. > > - in case of a jvm crash right after a change, that change might not be > reflected in the index. > > while the first point is just a temporary inconsistency, the latter is > severe and cannot be recovered. > why can't the indexer just have a (persistent) list of dirty nodes and do everything in the background or when a query is requested. If the jvm crashes, the node is still dirty so it's done next time the system is up. > IMO the index should even participate in the internal two phase commit. > With the current design a failure while indexing a change cannot > rollback the change. > > But it's certainly possible to push more of the index work into an > background thread. most of the indexing is currently done with the > current thread. > > > regards > marcel > >
