Spark serverless reliability and state management
Skill vaquarkhan/data-engineering-agent-skills/skills/spark-serverless-reliability-and-state-management
Production-grade Agent Skills for data engineering AI agents: 73 workflows, platform presets, safe backfill/replay, Kafka & Spark reliability, MCP observability, and VS Code/JetBrains installers.
npx -y skills add vaquarkhan/data-engineering-agent-skills --skill spark-serverless-reliability-and-state-managementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 21 stars21 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Enforces timeout-aware rollbacks, resumable checkpoints, and orphan cleanup for serverless Spark workloads on AWS Lambda, Glue, and similar runtimes. Use when writing or reviewing Spark jobs in serverless environments, S3 checkpoint patterns, partial-failure recovery, or IceGuard-style state management.
SKILL.md
4.5 KB, 858 tokens by cl100k_base, as published. Nobody here has run it
Spark Serverless Reliability And State Management
Overview
Serverless Spark hides cluster failures behind short-lived runtimes and opaque retries. Silent partial writes, orphaned checkpoints, and timeout-induced corruption are common when agents treat serverless Spark like a long-running cluster job. This skill forces explicit state boundaries, resumable progress, and cleanup before any publish path opens.
When to Use
- implementing or reviewing Spark on
AWS Lambda,AWS Glueserverless, or comparable short-lived runtimes - designing S3-backed checkpoints, progress markers, or staged write paths
- recovering from timeout, OOM, or mid-batch partial failure without double-counting
- translating IceGuard-style checkpoint and rollback patterns into agent workflows
- hardening batch Spark that must survive cold starts, memory limits, and hard execution ceilings
Do not use this for always-on EMR or Databricks clusters unless the job also runs in a serverless path with hard time limits.
Workflow
-
Classify execution risk before coding. Document:
- maximum runtime and memory ceiling
- input cardinality and partition fan-out
- whether output is append, merge, or overwrite
- downstream consumers that would see partial data
- whether the job is restartable from a known offset or partition set
-
Design a resumable checkpoint contract. Require:
- durable progress markers in object storage (for example
s3://.../checkpoints/{run_id}/) - explicit run identifiers tied to orchestration metadata
- idempotent write semantics at the target grain
- a manifest or
_SUCCESS-style gate before publish - separation between staging prefixes and publish prefixes
Load
references/spark-serverless-reliability-patterns.mdfor checkpoint layout and orphan-detection patterns. - durable progress markers in object storage (for example
-
Implement timeout-aware rollback. Before any publish:
- detect incomplete partitions or missing manifest files
- roll back staged outputs when the runtime approaches its ceiling
- persist last-good checkpoint state for resume
- block downstream publish when rollback is incomplete
- emit structured failure context (run id, partition range, bytes written)
-
Plan orphan and zombie cleanup. Include:
- TTL or lifecycle rules for abandoned staging prefixes
- a reconciliation job or hook that lists orphaned checkpoints older than N hours
- explicit ownership for cleanup automation
- guardrails against deleting in-flight runs
-
Pair with observability before production. Load
mcp-data-observability-integrationwhen live execution plans, stage metrics, or cluster signals are needed to diagnose OOM or skew before rollout. -
Prove recovery paths in a bounded slice. Validate:
- forced timeout mid-batch resumes without duplicate publish
- rerun from checkpoint produces identical contract-compliant output
- orphan cleanup does not remove active runs
Common Rationalizations
| Rationalization | Reality |
|---|---|
| "Lambda will just retry the whole function." | Retries can duplicate writes, leave orphaned staging data, and publish partial partitions. |
| "We can write directly to the final table path." | Serverless timeouts make direct writes dangerous without staging and manifest gates. |
| "Checkpointing is only for streaming." | Any resumable batch with hard runtime limits needs durable progress markers. |
| "Glue handles cleanup automatically." | Managed runtimes do not guarantee orphan cleanup or rollback of partial lake writes. |
Red Flags
- writes go directly to publish paths with no staging boundary
- no run id or checkpoint manifest exists
- timeout handling is undefined
- partial S3 prefixes have no orphan detection or TTL policy
- resume logic cannot distinguish completed versus in-flight partitions
- agents scale partitions without checking memory ceiling per task
Verification
- Runtime limits, write mode, and idempotency grain are documented
- Checkpoint and staging layout support safe resume
- Timeout rollback and publish gating are explicit
- Orphan cleanup ownership and detection exist
- Recovery was proven on a bounded partition slice before full rollout
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.