You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Andras Salamon (JIRA)" <ji...@apache.org> on 2019/04/11 08:53:00 UTC

[jira] [Commented] (OOZIE-2422) Recovery service loads jobs which doesn't need recovery

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

Andras Salamon commented on OOZIE-2422:
---------------------------------------

I think we should keep the {{a.pending > 0}} condition for the KILLED and RUNNING state. If we put the checking into the SQL, we could simplify the Java code.

> Recovery service loads jobs which doesn't need recovery
> -------------------------------------------------------
>
>                 Key: OOZIE-2422
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2422
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Purshotam Shah
>            Assignee: Satish Subhashrao Saley
>            Priority: Major
>         Attachments: OOZIE-2422-1.patch
>
>
> {code}
>         @NamedQuery(name = "GET_COORD_ACTIONS_FOR_RECOVERY_OLDER_THAN", query = "select a.id, a.jobId, a.statusStr, a.externalId, a.pending from CoordinatorActionBean a where a.pending > 0 AND (a.statusStr = 'SUSPENDED' OR a.statusStr = 'KILLED' OR a.statusStr = 'RUNNING') AND a.lastModifiedTimestamp <= :lastModifiedTime"),
> {code}
> Recovery service use above sql to recover killed/suspended/running action and in code it checks for external id. Checking of externalId can be done in sql itself.
> {code}
> else if (caction.getStatus() == CoordinatorActionBean.Status.SUSPENDED) {
>                             if (caction.getExternalId() != null && caction.getPending() > 1) {
>                                 queueCallable(new SuspendXCommand(caction.getExternalId()));
>                                 log.debug("Recover a SUSPENDED coord action and resubmit SuspendXCommand :"
>                                         + caction.getId());
>                             }
>                         }
>                         else if (caction.getStatus() == CoordinatorActionBean.Status.KILLED) {
>                             if (caction.getExternalId() != null) {
>                                 queueCallable(new KillXCommand(caction.getExternalId()));
>                                 log.debug("Recover a KILLED coord action and resubmit KillXCommand :" + caction.getId());
>                             }
>                         }
>                         else if (caction.getStatus() == CoordinatorActionBean.Status.RUNNING) {
>                             if (caction.getExternalId() != null) {
>                                 queueCallable(new ResumeXCommand(caction.getExternalId()));
>                                 log.debug("Recover a RUNNING coord action and resubmit ResumeXCommand :" + caction.getId());
>                             }
>                         }
> 						
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)