Refine handling of checkpointing, but still won't work due to SPARK-4196