Spark Structured Streaming checkpointing and HDFS snapshot integration for backup restoration
0 reputation · 26 Mar 2021, 14:22 UTC
Goal: Determine whether Apache Spark Structured Streaming’s internal checkpointing and write‑ahead log (WAL) mechanism provides sufficient fault tolerance for recovery from HDFS‑based checkpoint storage, or whether augmenting it with external HDFS snapshots is necessary to guard against metadata corruption or accidental deletion.
Constraints: The checkpoint directory must be durable and visible to all driver and executor nodes; WAL replay behavior and offset commit guarantees differ between Spark 2.x and 3.x releases, requiring version‑specific verification. HDFS snapshots offer a point‑in‑time copy of the checkpoint directory but add storage overhead and potential latency, and the documentation does not prescribe a combined approach.
Questions: Should users rely exclusively on Spark’s WAL replay for exactly‑once recovery, or is it recommended to schedule periodic HDFS snapshots of the checkpoint directory? How does the interaction between WAL replay and snapshot restoration affect end‑to‑end data verification? What operational trade‑offs (storage cost, recovery time, complexity) arise when combining internal checkpointing with external snapshots for backup restoration?