Author: rohini
Date: Sun Sep 22 18:01:53 2013
New Revision: 1525406
URL: http://svn.apache.org/r1525406
Log:
OOZIE-1545 RecoveryService keeps repeatedly queueing SuspendXCommand (rohini)
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsGetForRecoveryJPAExecutor.java
oozie/trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
oozie/trunk/release-log.txt
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java?rev=1525406&r1=1525405&r2=1525406&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
(original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java
Sun Sep 22 18:01:53 2013
@@ -147,7 +147,7 @@ import org.json.simple.JSONObject;
@NamedQuery(name = "GET_COORD_ACTIONS_WAITING_SUBMITTED_OLDER_THAN",
query = "select a.id, a.jobId, a.statusStr, a.externalId,
a.pushMissingDependencies from CoordinatorActionBean a where (a.statusStr =
'WAITING' OR a.statusStr = 'SUBMITTED') AND a.lastModifiedTimestamp <=
:lastModifiedTime"),
- @NamedQuery(name = "GET_COORD_ACTIONS_FOR_RECOVERY_OLDER_THAN", query
= "select a.id, a.jobId, a.statusStr, a.externalId from CoordinatorActionBean a
where a.pending > 0 AND (a.statusStr = 'SUSPENDED' OR a.statusStr = 'KILLED' OR
a.statusStr = 'RUNNING') AND a.lastModifiedTimestamp <= :lastModifiedTime"),
+ @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"),
// Select query used by rerun, requires almost all columns so select *
is used
@NamedQuery(name = "GET_ACTIONS_FOR_DATES", query = "select OBJECT(a)
from CoordinatorActionBean a where a.jobId = :jobId AND (a.statusStr =
'TIMEDOUT' OR a.statusStr = 'SUCCEEDED' OR a.statusStr = 'KILLED' OR
a.statusStr = 'FAILED') AND a.nominalTimestamp >= :startTime AND
a.nominalTimestamp <= :endTime"),
// Select query used by log
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsGetForRecoveryJPAExecutor.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsGetForRecoveryJPAExecutor.java?rev=1525406&r1=1525405&r2=1525406&view=diff
==============================================================================
---
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsGetForRecoveryJPAExecutor.java
(original)
+++
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionsGetForRecoveryJPAExecutor.java
Sun Sep 22 18:01:53 2013
@@ -94,6 +94,9 @@ public class CoordActionsGetForRecoveryJ
if (arr[3] != null) {
bean.setExternalId((String) arr[3]);
}
+ if (arr[4] != null) {
+ bean.setPending((Integer) arr[4]);
+ }
return bean;
}
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java?rev=1525406&r1=1525405&r2=1525406&view=diff
==============================================================================
---
oozie/trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java
(original)
+++
oozie/trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java
Sun Sep 22 18:01:53 2013
@@ -266,7 +266,7 @@ public class RecoveryService implements
+ caction.getId());
}
else if (caction.getStatus() ==
CoordinatorActionBean.Status.SUSPENDED) {
- if (caction.getExternalId() != null) {
+ if (caction.getExternalId() != null &&
caction.getPending() > 1) {
queueCallable(new
SuspendXCommand(caction.getExternalId()));
log.debug("Recover a SUSPENDED coord action
and resubmit SuspendXCommand :"
+ caction.getId());
Modified:
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java?rev=1525406&r1=1525405&r2=1525406&view=diff
==============================================================================
---
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
(original)
+++
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
Sun Sep 22 18:01:53 2013
@@ -425,7 +425,7 @@ public class TestRecoveryService extends
WorkflowJobBean wfJob =
addRecordToWfJobTable(WorkflowJob.Status.RUNNING,
WorkflowInstance.Status.RUNNING);
final String wfJobId = wfJob.getId();
addRecordToCoordActionTable(coordJob.getId(), 1,
- CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml",
wfJobId, "RUNNING", 1);
+ CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml",
wfJobId, "RUNNING", 2);
sleep(3000);
Modified: oozie/trunk/release-log.txt
URL:
http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1525406&r1=1525405&r2=1525406&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Sun Sep 22 18:01:53 2013
@@ -1,5 +1,6 @@
-- Oozie 4.1.0 release (trunk - unreleased)
+OOZIE-1545 RecoveryService keeps repeatedly queueing SuspendXCommand (rohini)
OOZIE-1547 Change Coordinator SELECT query to fetch only necessary columns and
consolidate JPA Executors (ryota)
OOZIE-1529 Disable job DAG display for workflow having huge actions (puru via
rohini)
OOZIE-1468 Add created time column in WF_ACTIONS and SLA tables (rohini)