Hi, > Im still very interested in understand some of the design chooses oak > core team had taken and why . For the long lived snapshots what is use > case for this and also I like to understand how indexes are sync between > nodes and the role of a oak leader and how the leader node election > occurs.
One of the primary use cases is asynchronous index updates. The current index state is always associated with a snapshot of the repository. Potential updates of asynchronous indexes are checked periodically by comparing the current repository state with the snapshot referenced in the index. If an index update is needed, the new index state will reference the more recent state of the repository and release the older snapshot. Most of the time the repository only has to keep rather recent snapshots, but there are may also be cases when a snapshot must be kept for a longer period of time, e.g. when an index is re-created. Oak indexes are stored in the repository just like regular content. The only difference is that the actual index data (e.g. the Lucene files) is stored on hidden nodes. You don't see those node when you access the repository over the JCR API. The data is managed internally by Oak. Leader election is not something done by Oak but delegated to another module. Apache Sling Discovery works well and you can find documentation here: https://sling.apache.org/documentation/bundles/discovery-api-and-impl.html More general information on Oak is also available here: https://jackrabbit.apache.org/oak/docs/architecture/nodestate.html Regards Marcel