Skip to content

Terminal State Job Purging#1231

Merged
alirezazamani merged 5 commits intoapache:masterfrom
NealSun96:nealsun/terminal-job-purging
Aug 13, 2020
Merged

Terminal State Job Purging#1231
alirezazamani merged 5 commits intoapache:masterfrom
NealSun96:nealsun/terminal-job-purging

Conversation

@NealSun96
Copy link
Contributor

@NealSun96 NealSun96 commented Aug 7, 2020

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Fixes #1230

Description

  • Here are some details about my PR, including screenshots of any UI changes:

  • A new field is added to JobConfig in order to support terminal state job purging: TerminalStateExpiry. Necessary functions are implemented to support the new field.

  • A new set of logic is added to TaskGarbageCollectionStage. When purging jobs, terminal state jobs will be considered based on the new expiry value. In addition, a "failed job propagation" logic is put in place. This accounts for the jobs that fail due to parental job failures, because these jobs would not have JobContexts, preventing them to be purged through normal means; with the propagation logic they can be purged along with the failed parental jobs.

  • Modify scheduleJobCleanUp usage to correctly reflect the expiry used. The previous code wasn't necessary as FAILED jobs were not cleaned up anyways, but now it has a meaning.

  • Modify jobDispatcher to honor TIMED_OUT job states.

Tests

  • The following tests are written for this issue:

testJobQueueFailedCleanUp, testJobQueueTimedOutCleanUp, testGetExpiredJobsFromCacheFailPropagation

  • The following is the result of the "mvn test" command on the appropriate module:
[ERROR] Tests run: 1169, Failures: 5, Errors: 0, Skipped: 1, Time elapsed: 4,517.039 s <<< FAILURE! - in TestSuite
[ERROR] testResourceSubset(org.apache.helix.tools.TestClusterStateVerifier)  Time elapsed: 1.028 s  <<< FAILURE!
org.apache.helix.HelixException: Failed to create pause signal
        at org.apache.helix.tools.TestClusterStateVerifier.testResourceSubset(TestClusterStateVerifier.java:115)

[ERROR] afterMethod(org.apache.helix.tools.TestClusterStateVerifier)  Time elapsed: 1.064 s  <<< FAILURE!
java.lang.IllegalStateException: ZkClient already closed!
        at org.apache.helix.tools.TestClusterStateVerifier.afterMethod(TestClusterStateVerifier.java:98)

[ERROR] TestMessageSimpleSendReceiveAsync(org.apache.helix.integration.messaging.TestCrossClusterMessagingService)  Time elapsed: 2.118 s  <<< FAILURE!
java.lang.AssertionError: 
        at org.apache.helix.integration.messaging.TestCrossClusterMessagingService.TestMessageSimpleSendReceiveAsync(TestCrossClusterMessagingService.java:145)

[ERROR] testEnableCompressionResource(org.apache.helix.integration.TestEnableCompression)  Time elapsed: 168.201 s  <<< FAILURE!
java.lang.AssertionError: expected:<true> but was:<false>
        at org.apache.helix.integration.TestEnableCompression.testEnableCompressionResource(TestEnableCompression.java:117)

[ERROR] testStateTransitionTimeOut(org.apache.helix.integration.paticipant.TestStateTransitionTimeoutWithResource)  Time elapsed: 36.072 s  <<< FAILURE!
java.lang.AssertionError: expected:<true> but was:<false>
        at org.apache.helix.integration.paticipant.TestStateTransitionTimeoutWithResource.testStateTransitionTimeOut(TestStateTransitionTimeoutWithResource.java:171)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   TestEnableCompression.testEnableCompressionResource:117 expected:<true> but was:<false>
[ERROR]   TestCrossClusterMessagingService.TestMessageSimpleSendReceiveAsync:145
[ERROR]   TestStateTransitionTimeoutWithResource.testStateTransitionTimeOut:171 expected:<true> but was:<false>
[ERROR]   TestClusterStateVerifier.afterMethod:98 » IllegalState ZkClient already closed...
[ERROR]   TestClusterStateVerifier.testResourceSubset:115 » Helix Failed to create pause...
[INFO] 
[ERROR] Tests run: 1169, Failures: 5, Errors: 0, Skipped: 1
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:15 h
[INFO] Finished at: 2020-08-13T13:11:21-07:00
[INFO] ------------------------------------------------------------------------

Rerun

[ERROR] Tests run: 11, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 77.624 s <<< FAILURE! - in TestSuite
[ERROR] afterMethod(org.apache.helix.tools.TestClusterStateVerifier)  Time elapsed: 1.13 s  <<< FAILURE!
java.lang.IllegalStateException: ZkClient already closed!
        at org.apache.helix.tools.TestClusterStateVerifier.afterMethod(TestClusterStateVerifier.java:98)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   TestClusterStateVerifier.afterMethod:98 » IllegalState ZkClient already closed...
[INFO] 
[ERROR] Tests run: 11, Failures: 1, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:22 min
[INFO] Finished at: 2020-08-13T14:10:06-07:00
[INFO] ------------------------------------------------------------------------

Rerun

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.392 s - in org.apache.helix.tools.TestClusterStateVerifier
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.566 s
[INFO] Finished at: 2020-08-13T14:12:20-07:00
[INFO] ------------------------------------------------------------------------

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

Copy link
Contributor

@junkaixue junkaixue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@NealSun96
Copy link
Contributor Author

This PR is ready to merge, approved by @alirezazamani
Final commit message:

Terminal State Job Purging in TaskFramework

This PR added a new field to JobConfig for terminal job expiries, and added new logic to garbage collection stage to purge jobs in terminal states.

@alirezazamani alirezazamani merged commit e163efc into apache:master Aug 13, 2020
huizhilu pushed a commit to huizhilu/helix that referenced this pull request Aug 16, 2020
This commit added a new field to JobConfig for terminal job expiries, and added new logic to garbage collection stage to purge jobs in terminal states.
@NealSun96 NealSun96 mentioned this pull request Aug 27, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal State Job Purging

3 participants