should help http://jackrabbit.apache.org/concurrency-control.html
On Oct 19, 2011, at 9:19 AM, Danilo Ghirardelli wrote: > > Hi all, > I found a issue that I probably have to solve for a project: > http://jira.magnolia-cms.com/browse/MGNLSCH-15 > I'm just looking for idea on how to solve it. I mean, the part about > executing a job on certain nodes seems pretty easy, you can set a property > with the node names and then compare it with magnolia.clusterid (or the > jackrabbit one) property that is already guaranteed to be unique in the > cluster. > But I can't see an easy solution for the part about running in just one node. > Ok, you can set a single cluster id in the aforementioned idea, but this > means that if the node you selected is down, the job is lost, which is pretty > much what I want to avoid with the cluster. > Also there is no "schedule" workspace that could be used, so I thought to use > a lock on some node (maybe the node defining the job itself in config), but I > have no idea if it's possible to set a cluster-wise lock on a node, how to > check if it's currently locked and how eventually force the unlock if the > cluster node has died for some reason. Have you any pointer (with code > samples) on these topics? Thank you. true, there's no schedule workspace, but you can always store something in the config of the scheduler itself. If the above explanation from JR doesn't help you with locking and resolving the take-over-the-job problem, you can always use the passive-aggresive approach and have each node running the still-alive job in which all the node would do is periodically (say every ten minutes) update the property with the name of the node and put the timestamp as a value. First node that detects there was no update from the current master node within the period will automatically update property stating which node should execute the jobs and take over that duty and keep it until it dies (if ever) for whatever reason HTH, Jan > > Regards, Danilo. > > > ---------------------------------------------------------------- > For list details see > http://www.magnolia-cms.com/community/mailing-lists.html > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/community/mailing-lists.html To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
