[ 
https://issues.apache.org/jira/browse/SLING-5387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15986326#comment-15986326
 ] 

Carsten Ziegeler commented on SLING-5387:
-----------------------------------------

I'm not sure if we need to go there. These jobs are scheduled. So if job A is 
currently running on an instance, and while it is running the topology changes, 
then job A will not be immediately scheduled on a different instance. First of 
all, the distribution algorithm must calculate a different result than 
previously which might or might not be the case. But more important, these jobs 
are scheduled. So usually, the schedule is defined in a way that the next run 
of A is after the previous run of A is finished. And if the schedule is in such 
a way that  there are multiple jobs of A potentially running in parallel, then 
I think we're fine as well.
Of course, there is the slight chance that the topology changes exactly at the 
point of an activation of a schedule and then the job runs in parallel. But I 
think this chance is pretty low.

> Provide support for running singleton jobs on non leader cluster nodes also
> ---------------------------------------------------------------------------
>
>                 Key: SLING-5387
>                 URL: https://issues.apache.org/jira/browse/SLING-5387
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>            Reporter: Chetan Mehrotra
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Scheduler 2.5.4
>
>
> With SLING-2979 support for running singleton jobs on specific instance was 
> provided. In most cases we want to run  a job as singleton and not want to 
> "pin" it to specific nodes. For this {{scheduler.runOn}} needs to be set to 
> {{SINGLE}}.
> However per [current 
> implementation|https://github.com/apache/sling/blob/org.apache.sling.commons.scheduler-2.4.14/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzJobExecutor.java#L64]
>  {{SINGLE}} is treated as {{LEADER}}. This effectively causes *all singleton* 
> jobs to get executed on leader only thus putting extra load.
> For better utilization of cluster resources it should be possible to 
> distribute such singleton jobs on other cluster nodes and still ensure that 
> singleton contract is honoured!
> We would like to make use of this feature to ensure Oak AsyncIndexTask to run 
> on different cluster nodes (OAK-2749) 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to