What happens if a spot instance worker is lost in the middle of a query?

User16826992666
Databricks Employee
Databricks Employee

Does the query have to be re-run from the start, or can it continue? Trying to evaluate what risk there is by using spot instances for production jobs

User16826992666
Databricks Employee
Databricks Employee

If a spot instance is reclaimed in the middle of a job, then spark will treat it as a lost worker. The spark engine will automatically retry the tasks from the lost worker on other available workers.

So the query does not have to start over if individual workers are lost. However, if there was temporary data on the node that was lost it will have to be recomputed, which could lead to longer runtimes. For that reason it is only recommended to use spot instances when variation in job runtimes is acceptable.