vaquarkhan/data-engineering-agent-skills/spark-serverless-reliability-and-state-management

Claude Code and agent skill by vaquarkhan/data-engineering-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install vaquarkhan/data-engineering-agent-skills/spark-serverless-reliability-and-state-management

SKILL.md

The same SKILL.md was published earlier as vaquarkhan/data-engineering-agent-skills/spark-serverless-reliability-and-state-management.

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 Glue serverless, 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

  1. 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
  1. 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.md for checkpoint layout and orphan-detection patterns.

  1. 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)
  1. 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
  1. Pair with observability before production.

Load mcp-data-observability-integration when live execution plans, stage metrics, or cluster signals are needed to diagnose OOM or skew before rollout.

  1. 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

RationalizationReality
"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

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
48
Repository forks
5
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/vaquarkhan/data-engineering-agent-skills/spark-serverless-reliability-and-state-management/badge)](https://verified-skill.com/skills/vaquarkhan/data-engineering-agent-skills/spark-serverless-reliability-and-state-management)

Something wrong with this skill or its page? Tell us.