Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-33841][CORE] Fix issue with jobs disappearing intermittently from the SHS under high load #30845

Closed
wants to merge 1 commit into from

Conversation

vladhlinsky
Copy link
Contributor

@vladhlinsky vladhlinsky commented Dec 18, 2020

What changes were proposed in this pull request?

Mark SHS event log entries that were processing at the beginning of the checkForLogs run as not stale and check for this mark before deleting an event log. This fixes the issue when a particular job was displayed in the SHS and disappeared after some time, but then, in several minutes showed up again.

Why are the changes needed?

The issue is caused by SPARK-29043, which is designated to improve the concurrent performance of the History Server. The change breaks the "app deletion" logic because of missing proper synchronization for processing event log entries. Since SHS now filters out all processing event log entries, such entries do not have a chance to be updated with the new lastProcessed time and thus any entity that completes processing right after filtering and before the check for stale entities will be identified as stale and will be deleted from the UI until the next checkForLogs run. This is because updated lastProcessed time is used as criteria, and event log entries that missed to be updated with a new time, will match that criteria.

The issue can be reproduced by generating a big number of event logs and uploading them to the SHS event log directory on S3. Essentially, around 236(26.7 MB) copies of an event log directory were created using shs-monitor script. Strange behavior of SHS counting the total number of applications was noticed - at first, the number was increasing as expected, but with the next page refresh, the total number of applications decreased. No errors were logged by SHS.

58 entities are displayed at 17:35:35:
1-58-entries-at-17-35
25 entities are displayed at 17:36:40:
2-25-entries-at-17-36

Does this PR introduce any user-facing change?

Yes, SHS users won't face the behavior when the number of displayed applications decreases periodically.

How was this patch tested?

Tested using shs-monitor script:

  • Build SHS with the proposed change
  • Download Hadoop AWS and AWS Java SDK
  • Prepare S3 bucket and user for programmatic access, grant required roles to the user. Get access key and secret key
  • Configure SHS to read event logs from S3
  • Start monitor script to query SHS API
  • Run 5 producers for ~5 mins, create 125(14.2 MB) event log directory copies
  • Wait for SHS to load all the applications
  • Verify that the number of loaded applications increases continuously over time

For more details, please refer to the shs-monitor repository.

This version of the reproduction uses event log directories instead of single files, since recent optimization
SPARK-33790 makes it hard to reproduce the issue with single event log files.

@github-actions github-actions bot added the CORE label Dec 18, 2020
@vladhlinsky
Copy link
Contributor Author

cc @HeartSaVioR

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Thank you for making a PR to master, @vladhlinsky .
Could you rebase to the master once more to bring GitHub action fix?

@vladhlinsky
Copy link
Contributor Author

The PR has been rebased.
Thank you, @dongjoon-hyun!

@HeartSaVioR
Copy link
Contributor

add to whitelist

@HeartSaVioR
Copy link
Contributor

retest this, please

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

+1 and I'd consider @tgravescs approved this PR as only target branch is different.

@dongjoon-hyun
Copy link
Member

I don't think this PR has an issue, but we need to ping @tgravescs to get his approval technically. Ping, @tgravescs .

+1 and I'd consider @tgravescs approved this PR as only target branch is different.

@SparkQA
Copy link

SparkQA commented Dec 18, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37637/

@SparkQA
Copy link

SparkQA commented Dec 18, 2020

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37637/

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @vladhlinsky .
Merged to master for Apache Spark 3.2.0.

@dongjoon-hyun
Copy link
Member

Thank you for your first contribution, @vladhlinsky .
I added you to the Apache Spark contributor group and assigned SPARK-33841 to you.
Welcome to the Apache Spark community.

@vladhlinsky
Copy link
Contributor Author

Thank you, @dongjoon-hyun!

@SparkQA
Copy link

SparkQA commented Dec 18, 2020

Test build #133038 has finished for PR 30845 at commit e9f13a5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants