ignitegridgain

ContinuousQuery events are not synchronised with its initial query


Basically, as the title says.

Same behaviour between Ignite 2.17.0 and GridGain CE 8.9.19.

The subscription model suggested in the documentation - i.e. set-up a ContinuousQuery with initial query, enumerate the cursor - works properly only when the cache is not updated during the cursor iteration. If there are updates happening to the cache at the same time, then it seems that it goes all over the place:

That's quite unexpected, surely there must be a way to get a cache's State-Of-World seamlessly joined by the subscription. Especially taking that the documentations almost says that it actually should be there:

You can specify an initial query that is executed before the continuous query gets registered in the cluster and before you start to receive updates.

So I still hope that I did something wrong.

Here is a small project that demonstrates this behaviour - three instances need to be started by e.g. ./gradlew run, 2nd of them will show WARN's, please have a look at the very short README there for details. If not reproduced straight away, restart all three again - the test case still sometimes might run cleanly, although in most cases it doesn't: https://github.com/new-mikha/ignite-sow-subscribe-demo

And here the class from the same repo that sets up and runs a ContinuousQuery - I wonder is there chance that did something wrong?

Thanks!


Solution

  • I think that's expected behaviour.

    In practice, this is rarely an issue. Most of the time, CQs would be used with a remote filter and a SQL query (rather than a scan), which doesn't eliminate the possibility but does mean it's unlikely.

    If this really is an problem for your application, you could consider using GridGain 9, which can create a snapshot of a table and start a CQ immediately after.