This is an automated email from the ASF dual-hosted git repository. alsuliman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 77a5b277e5e60416d417e6956c73f9f20915093d Merge: 7c7d24096e cc1334aa58 Author: Michael Blow <[email protected]> AuthorDate: Fri May 10 22:39:54 2024 -0400 Merge branch 'gerrit/neo' into 'gerrit/trinity' Change-Id: Ibcbefe51fe91e800dbc218d5b7d65ca849c3db2f .../apache/asterix/app/active/RecoveryTask.java | 1 + .../hyracks/control/cc/executor/JobExecutor.java | 15 ++--- .../apache/hyracks/control/cc/job/JobManager.java | 5 +- .../control/cc/partitions/PartitionMatchMaker.java | 71 ++++++---------------- .../control/cc/result/ResultDirectoryService.java | 25 +++++--- .../hyracks/control/cc/work/JobCleanupWork.java | 1 - .../hyracks/control/cc/work/TaskFailureWork.java | 9 +-- .../control/common/config/ConfigManager.java | 11 +++- .../apache/hyracks/control/nc/CcConnection.java | 2 + .../control/nc/work/NotifyTaskFailureWork.java | 4 -- .../integration/TestJobLifecycleListener.java | 6 +- 11 files changed, 58 insertions(+), 92 deletions(-) diff --cc hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java index 9165953b0c,33bdd0558a..3a954f4477 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/job/JobManager.java @@@ -145,19 -129,17 +145,19 @@@ public class JobManager implements IJob if (activeRunMap.containsKey(jobId)) { JobRun jobRun = activeRunMap.get(jobId); // The following call will abort all ongoing tasks and then consequently - // trigger JobCleanupWork and JobCleanupNotificationWork which will update the lifecyle of the job. + // trigger JobCleanupWork and JobCleanupNotificationWork which will update the lifecycle of the job. // Therefore, we do not remove the job out of activeRunMap here. jobRun.getExecutor().cancelJob(callback); + incrementCancelledJobs(); return; } // Removes a pending job. JobRun jobRun = jobQueue.remove(jobId); if (jobRun != null) { + incrementCancelledJobs(); List<Exception> exceptions = Collections.singletonList(HyracksException.create(ErrorCode.JOB_CANCELED, jobId)); - // Since the job has not been executed, we only need to update its status and lifecyle here. + // Since the job has not been executed, we only need to update its status and lifecycle here. jobRun.setStatus(JobStatus.FAILURE_BEFORE_EXECUTION, exceptions); runMapArchive.put(jobId, jobRun); runMapHistory.put(jobId, exceptions); diff --cc hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/result/ResultDirectoryService.java index a0c2ce4cfd,46dd3512af..f56ec33590 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/result/ResultDirectoryService.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/result/ResultDirectoryService.java @@@ -79,11 -77,8 +78,9 @@@ public class ResultDirectoryService ext } @Override - public synchronized void notifyJobCreation(JobId jobId, JobSpecification spec) throws HyracksException { + public synchronized void notifyJobCreation(JobId jobId, JobSpecification spec, + IJobCapacityController.JobSubmissionStatus status) throws HyracksException { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(getClass().getSimpleName() + " notified of new job " + jobId); - } + LOGGER.debug("{} notified of new job {}", getClass().getSimpleName(), jobId); if (jobResultLocations.get(jobId) != null) { throw HyracksDataException.create(ErrorCode.MORE_THAN_ONE_RESULT, jobId); } diff --cc hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java index 6262c475e5,6454804154..f065940967 --- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java +++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/JobCleanupWork.java @@@ -52,10 -51,9 +52,9 @@@ public class JobCleanupWork extends Abs @Override public void run() { - LOGGER.info("cleaning up {} on NCs, status={}", jobId, status); final JobRun jobRun = jobManager.get(jobId); if (jobRun == null) { - LOGGER.debug("Ignoring cleanup for unknown job: {}", jobId); + LOGGER.debug("ignoring cleanup for unknown {}", jobId); return; } try { diff --cc hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/TestJobLifecycleListener.java index 4d4635aadc,008be29584..19fdcfee01 --- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/TestJobLifecycleListener.java +++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/TestJobLifecycleListener.java @@@ -48,7 -47,7 +48,8 @@@ public class TestJobLifecycleListener i private final Set<JobId> finishWithoutStart = new HashSet<>(); @Override - public void notifyJobCreation(JobId jobId, JobSpecification spec, IJobCapacityController.JobSubmissionStatus status) throws HyracksException { - public void notifyJobCreation(JobId jobId, JobSpecification spec) throws HyracksException { ++ public void notifyJobCreation(JobId jobId, JobSpecification spec, IJobCapacityController.JobSubmissionStatus status) ++ throws HyracksException { if (created.containsKey(jobId)) { LOGGER.log(Level.WARN, "Job " + jobId + "has been created before"); increment(doubleCreated, jobId); @@@ -76,7 -75,7 +77,8 @@@ } @Override - public void notifyJobFinish(JobId jobId, JobSpecification spec, JobStatus jobStatus, List<Exception> exceptions) throws HyracksException { - public void notifyJobFinish(JobId jobId, JobStatus jobStatus, List<Exception> exceptions) throws HyracksException { ++ public void notifyJobFinish(JobId jobId, JobSpecification spec, JobStatus jobStatus, List<Exception> exceptions) ++ throws HyracksException { if (!started.contains(jobId)) { LOGGER.log(Level.WARN, "Job " + jobId + "has not been started"); finishWithoutStart.add(jobId);
