[MGNLSCH-15] Allow tasks to specify cluster node on which to run in clustered configurations Created: 17/May/10 Updated: 23/Jul/12 Resolved: 20/Feb/12 |
|
| Status: | Closed |
| Project: | Scheduler |
| Component/s: | None |
| Affects Version/s: | 1.3 |
| Fix Version/s: | 1.4.3 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Jan Haderka | Assignee: | Ondrej Chytil |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||||||
| Description |
|
Right now when running Magnolia in fully clustered environment (i.e. with clustered config workspace) scheduled tasks are launched on all nodes. This leads to problems when such tasks include content modification and locking. It should be possible to specify at which node such tasks should run or at least say whether to run on all or only on one. |
| Comments |
| Comment by Danilo Ghirardelli [ 04/Jan/12 ] |
|
If you are interested, I created the attached command, that guarantees the execution of a command (or better, a job) on a single cluster node, using Jackrabbit's clusterwise locks. The node on which the job will run is not forced, just the first one that gets the lock is the one that will run the job, the others will quietly skip. |
| Comment by Ondrej Chytil [ 20/Feb/12 ] |
|
The change is active only when magnolia.clusterid property is set in magnolia.properties file. This value is then compared with clusterId parameter which should be placed under params node in job config. ClusterId parameter has to be set if magnolia.clusterid is not null - otherwise job will never be launched. |
| Comment by Danilo Ghirardelli [ 20/Feb/12 ] |
|
Does this mean that if I have a clustered environment, now I have to set the clusterId parameter or all the jobs won't run? And if set it, every job will run only on one node of the cluster and not on all nodes as before? If so, this is quite a breaking change... |
| Comment by Jan Haderka [ 20/Feb/12 ] |
|
two things:
|
| Comment by Ondrej Chytil [ 20/Feb/12 ] |
|
Hello Danilo, this cluster-awareness is dependent on magnolia.clusterid property so if you have your cluster ID set just in Jackrabbit config file everything will work as before (partly because different ticket - MAGNOLIA-3971). |
| Comment by Danilo Ghirardelli [ 20/Feb/12 ] |
|
Explaining the use case might be simpler: I have (like most people, I think) a clustered environment, based on magnolia.clusterid property, usually magnolia.clusterid = ${{ {magnolia.servername}}}, to make things quicker and easier for all cluster nodes. And I have jobs, that currently are meant to run on every single node of the cluster, not knowing other cluster details, just like I think a cluster is meant to be. |
| Comment by Danilo Ghirardelli [ 20/Feb/12 ] |
|
Just another consideration, slightly related. In my experience, when I set up a Magnolia cluster, is usually done with a bunch of cloned virtual (or physical) machines, that are identical. So, when coding a scheduled job, I usually have only two use cases:
If I understood correcty, your change kills my first use case but does not cover the other use case, so I was saying the change is "breaking". |
| Comment by Ondrej Chytil [ 21/Feb/12 ] |
|
Since this can really cause issues in certain enviroments I logged |