Apache Spark Big Data (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What causes the fatal "Shuffle Fetch Failed" exception and how do you resolve it?
senior LevelHTTP & REST APIs
In Simple Words: Occurs when a reducer executor attempts to fetch shuffle blocks from an upstream mapper executor that has crashed or timed out:
- Causes:
- Mapper executor crashed due to an OutOfMemory error (GC pause > 120s).
- Node hardware failure or spot instance termination.
- Excessive network congestion.
- Fixes:
- Increase
spark.core.connection.ack.wait.timeout(e.g. from 120s to 300s). - Increase
spark.sql.shuffle.partitionsfrom the default 200 to 1000+ to reduce per-partition block size. - Enable external shuffle service (
spark.shuffle.service.enabled).
- Increase