Hi Team,

As part of OAK-4180 feature around using another NodeStore as a local
cache for a remote Document store I would need to register another
NodeStore instance (for now a SegmentNodeStore - OAK-4490) with the
OSGi service registry.

This instance would then be used by SecondaryStoreCacheService to save
NodeState under certain paths locally and use it later for reads.

With this change we would have a situation where there would be
multiple NodeStore instance in same service registry. This can confuse
some component which have a dependency on NodeStore as a reference and
we need to ensure they bind to correct NodeStore instance.

Proposal A - Use a 'type' service property to distinguish
==========================================

Register the NodeStore with a 'type' property. For now the value can
be 'primary' or 'secondary'. When any component registers the
NodeStore it also provides the type property.

On user side the reference needs to provide which type of NodeStore it
needs to bound

This would ensure that user of NodeStore get bound to correct type.

if we use service.ranking then it can cause a race condition where the
secondary instance may get bound untill primary comes up

Looking for feedback on what approach to take

Chetan Mehrotra

Reply via email to