I have an Ignite cluster of 3 baseline nodes and multiple client nodes. Each baseline node has a configuration with specified implementation of the IndexingSpi.
The IndexingSpi JavaDoc does not explain, how are the SPI methods called on the nodes in the cluster.
Can anyone explain in details?
What I have observed, is that when a client node, uses a cache (which has 2 partition backup copies), and puts an element in it, the IndexingSpi.store method is called on all the 3 baseline nodes.
When a client nodes uses an SpiQuery to query the cache, the IndexinSpi.query method is called on all the 3 server nodes, and the client receives iterator over the UNION of the the result from the 3 nodes. (E.g. 3x times the result).
In my implementation of the IndexingSpi, I use Elasticsearch as indexing service.
The way IndexingSpi works, is causing one cache entity to be indexed 3 times, by every server node, and when a query is executed, the result has each element 3 times.
I also tried using a cluster wide semaphore in order to limit the IndexingSpi service methods to be executed only one baseline node on the cluster. However, in that scenario, the query method on the nodes that do not hold the permit, returns empty iterator, and sometimes the client nodes making the query are getting empty result.
Overall my experience with the IndexingSpi has been very poor. I will very much appreciate some help to figure out how this SPI is working in a clustered environment.
Thank you in advance. Assen.