A Spark step on Amazon EMR keeps failing with out-of-memory errors on one stage. What should the engineer do first?
- Exam domain
- Data Operations and Support22% of the exam
- Difficulty
- Medium
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task Statement 3.3: Maintain and monitor data pipelines.
Objective in the exam guide: Troubleshoot and maintain pipelines (for example, AWS Glue, Amazon EMR); integrate various AWS services to perform logging (for example, Amazon EMR in cases of large volumes of log data).
Big data jobs fail in specific, diagnosable ways. Reading logs before changing settings is the difference between a fix and a guess.
Why B is the answer
Read the step and container logs, which EMR can archive to S3, to find the failing stage, then adjust executor memory or partitioning
EMR logs show which stage and task failed, which guides the fix, such as more memory or better partitioning.
Remember: Troubleshoot pipelines from the logs, then change the right setting.
How it works
Amazon EMR records step, application and container logs, and can archive them to S3.
The logs show which stage and task failed, and with what error.
Out-of-memory on one stage often comes from skewed or oversized partitions, fixed by repartitioning or adjusting executor memory.
Clues in the question
The words that point to the answer, and what each one tells you.
- Out-of-memory errors on one stage
- Find the stage in the logs.
- First
- Diagnose before changing.
In detail
- Large volumes of logs can themselves be analyzed with services such as Athena or EMR.
- Out-of-memory on one stage often points to skew or too few partitions.
Side by side with look-alikes
| Action | Finds or fixes the cause? |
|---|---|
| Read logs, then tune | Yes |
| Rerun unchanged | No |
| Bigger bucket | No |
| Turn off logging | No |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Turn off loggingWrong
Logs are how you find the cause.
B. Read the step and container logs, which EMR can archive to S3, to find the failing stage, then adjust executor memory or partitioningRight
Troubleshoot pipelines from the logs, then change the right setting.
C. Delete the cluster and hope the next run worksWrongMost tempting
Rerunning without changes repeats the failure.
Why it tempts: Transient failures do happen. But a repeated out-of-memory error will come back without a change.
D. Increase the S3 bucket sizeWrong
Bucket size is unrelated to executor memory.
In practice
- Enable log archiving to S3 when creating clusters.
Use case
An illustrative scenario, not a real incident.
Logs show one huge partition; repartitioning fixes the out-of-memory error without adding nodes.
See how it works
flowchart LR
E["OOM error"] --> L["Read step and container logs"]
L --> S{"Cause?"}
S -->|"One huge partition"| R["Repartition"]
S -->|"Too little memory"| M["Raise executor memory"]How to read this chart
- "OOM error" leads to "Read step and container logs".
- "Read step and container logs" leads to "Cause?".
- At "Cause?": if "One huge partition", go to "Repartition"; if "Too little memory", go to "Raise executor memory".