Retrying updates is one way the server resolves deadlocks. You don't want to 
turn that off, and you can't. Instead you should rethink the way your scheduled 
job works.

First I would gather more information by setting file-log-level=debug. Then let 
the scheduled task run and look for debug-level XMDP-DEADLOCK messages. If 
there are any detected deadlocks, these messages will tell you what URI has 
multiple concurrent update attempts.

In that case it's possible that your 1-min interval is too short, causing the 
jobs to overlap and conflict with each other. If you can verify that, then one 
way to resolve it may be to call 
https://docs.marklogic.com/xdmp:lock-for-update as early as possible in the 
update. That takes a write lock eagerly rather than lazily, so the first 
request to call xdmp:lock-for-update should block subsequent requests. To do 
this you'd need to have a URI that you know you'll always update, or a fake URI 
like '/jobs/some-job-id' that you can use as a lock.

-- Mike

On 15 Sep 2014, at 05:47 , <[email protected]> 
<[email protected]> wrote:

> HI Jason,
>  
>                 Thanks for your reply, Yes we have update operation within 
> the job.
> Some node-replace, some spawn, which internally update some records like that.
> Is there any option , to specify not to restart.
>  
> We have try catch for the job statements, will that not help
>  
> How to avoid this scenario?
> Thanks & Regards,
> Santhosh
>  
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Jason Hunter
> Sent: Monday, September 15, 2014 6:05 PM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Minutely scheduled job is executing more 
> than once within a minute - reg.,
>  
> Since you say this happens under load, I'm going to guess you're doing an 
> update in the job?  If there's a potential deadlock detected in the locks 
> then MarkLogic will restart one of the statements to avoid the deadlock.  
> That would cause the log line to be printed several times, even though the 
> job only ran to completion once.
>  
> -jh-
>  
> On Sep 15, 2014, at 8:28 PM, <[email protected]> 
> <[email protected]> wrote:
> 
> 
> Hi All,
>  
>                 We have created a minutely scheduled job in Mark logic 
> server.  At the beginning of that scheduled module, we are printing a log 
> message.
> Log Message: “Start of minutely scheduled task”. We have noticed that this 
> log is printed (2 to 4 times) within a minute very frequently in the log.
> As it is a minutely job, it should be executed only once per minute.
>  
> Note: This repeated execution within a minute is happening , when the task 
> server is loaded with other tasks to process. Otherwise it is executing / 
> printing only once.
>  
> We tried to change the priority of that scheduled task to higher priority, it 
> didn’t help.
>  
> Can somebody say why it is behaving like this? Please suggest.
>  
> Marklogic Server Version:  6.0-5.3
> Hosts in Cluster : 3
>  
> Thanks & Regards,
> Santhosh
> This e-mail and any files transmitted with it are for the sole use of the 
> intended recipient(s) and may contain confidential and privileged 
> information. If you are not the intended recipient(s), please reply to the 
> sender and destroy all copies of the original message. Any unauthorized 
> review, use, disclosure, dissemination, forwarding, printing or copying of 
> this email, and/or any action taken in reliance on the contents of this 
> e-mail is strictly prohibited and may be unlawful. Where permitted by 
> applicable law, this e-mail and other e-mail communications sent to and from 
> Cognizant e-mail addresses may be monitored.
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>  
> This e-mail and any files transmitted with it are for the sole use of the 
> intended recipient(s) and may contain confidential and privileged 
> information. If you are not the intended recipient(s), please reply to the 
> sender and destroy all copies of the original message. Any unauthorized 
> review, use, disclosure, dissemination, forwarding, printing or copying of 
> this email, and/or any action taken in reliance on the contents of this 
> e-mail is strictly prohibited and may be unlawful. Where permitted by 
> applicable law, this e-mail and other e-mail communications sent to and from 
> Cognizant e-mail addresses may be 
> monitored._______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to