Apache Spark / Editorial solution guide
A streaming query cannot resume from its checkpoint
Diagnose checkpoint access and query compatibility before choosing a controlled recovery.
Read-only knowledge base ยท No public comments
Recognize the symptoms
A Structured Streaming query fails during restart or initialization after a deployment, configuration change or storage incident. Its previous checkpoint exists, but the query does not resume as expected.
Understand the likely causes
- The checkpoint may be inaccessible or incomplete, the restarted query may differ incompatibly from the query that wrote its state, or its source and sink configuration may no longer match the recovery plan. Exact compatibility depends on Spark and connector versions.
Capture the checkpoint and query identity
Record the sanitized exception, Spark and connector versions, checkpoint location, query revision, source and sink identities, and last confirmed successful progress. Determine whether the failure is access, missing data, state compatibility or another cause before taking action. Preserve the existing checkpoint and logs under the incident procedure; deleting it to clear an error discards recovery evidence and may cause a new query to replay or skip data depending on source configuration.
Compare the old and new query
Compare the previous and current source subscriptions, stateful operations, state schema, output mode and sink configuration. Consult the recovery rules for the exact deployed Spark release and connectors, because permitted changes depend on the operation and implementation. Verify storage permissions and the actual checkpoint path independently. A successful deployment of application code does not prove that an existing state store can be interpreted by the changed query.
Choose a recovery boundary with owners
If the query change is incompatible, consider restoring the compatible version or designing a separately checkpointed rebuild from a verified source and state boundary. Agree on the input range, sink isolation, duplicate handling, publication and rollback with data owners before starting. Test the chosen path using synthetic data in an isolated environment. A new checkpoint is a new recovery decision, not a general repair that automatically preserves prior progress or destination effects.
Reconcile state and destination effects
In the isolated rehearsal, process known events, interrupt the query, resume the compatible version and compare the final sink state with an independently calculated expectation. Include a repeated event and a late event where applicable. For a rebuild, verify the selected source range and compare the candidate output before switching readers. Observe progress and errors after controlled resumption; a running query alone cannot prove completeness or duplicate safety.
Verify the fix
Record the checkpoint and query revisions, selected recovery boundary, source positions and reconciled destination result. Confirm the intended duplicate and late-data behavior in the disposable test before any approved production cutover.
Keep it from recurring
- Version query and checkpoint assumptions together, test planned stateful changes against the deployed Spark release and rehearse recovery. Protect checkpoint storage and document independent source retention and sink idempotency requirements.