Hi I am converting from last open source GridGain to apache ignite. I have a small replicated cache of tasks (10's of items), I have a runner task running contentiously over this cache, locks a key and executes the associated task then releases the key. I am facing two problems:
1. When a new node joins the Gird, it can't get hold of the cache: I see errors in log (Retrying preload partition exchange due to timeout ). Eventually in gets the cache and starts executing tasks. Why does this happen?
2. When both nodes have a replica of the cache, if i stop any of the nodes, the other one will complain that the primary node has left the cluster and the cache is not available anymore. Why is that? the remaining node still have the cache available and should release the locks of the other node since its crashed (which used to happen in gridgain if i am not mistaken). Maybe i should reconsider my approach.. in a nutshell I need to execute a collection of tasks on a periodic manner on exclusively one of my nodes( doesn't matter which). Thanks
It would be helpful if you could provide a code snippet to show us how you interact with Ignite caches. You can use Github Gists to paste code. Also, we will probably need to take a look at the configuration you use as well.
Hi Attached is a gist with configuration and our cache manipulation code.. basically we have a cache (Tasks) of several items, each item represents a task and we have a task scheduler igniteCallable when is executed on all nodes on startup, the task scheduler go over the list of tasks, locks a key (certain tasks), checks if it requires execution and executes if needed. I am facing the problems i mentioned earlier 1 and 2, I hope the information I provided suffice, let me know otherwise You can find the relavant code in the following gist: https://gist.github.com/anonymous/1b284adce99d400abe77 Thank you for your help
Hi, I have changed my approach to use a cluster singleton service which will execute my task using the compute engine according to their schedule. This way i do not need to have a cache object at all and the singleton service will assure me that there is at least one instance of my task scheduler running on one of the nodes. When the node running my task scheduler service crashes the service will be started on a different node, my question is what happens to the state of the service, is it reset to construction time? Thanks alot
To make sure that your singleton does not restart from scratch, you can create a cache in your singleton service and periodically store your service state in that cache. This way, whenever a crash happens, your service will be able to restart from the last saved state.
Hi Yes, i have used a shared cache to save the state of the service. This cache will be accessed only from this singleton service, currently i kept as replicated cache since it has a handful of elements and access to cache elements will be local. would you recommend a different cache mode and why? Thanks, Isaeed Mohanna