cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Does cancelling a job run rollback any actions performed by query plan?

brendanc19
New Contributor III

If I were to stop a rather large job run, say half way thru execution, will any actions performed on our Delta tables persist or will they be rolled back?

Are there any other risks that I need to be aware of in terms of cancelling a job run half way thru?

1 ACCEPTED SOLUTION

Accepted Solutions

Anonymous
Not applicable

@Brendan Carey​ :

If you stop a job run in the middle of execution, any actions that have already been committed to Delta tables will persist. However, any uncommitted changes made by the job will be rolled back. This means that any transactions that were in progress at the time of the job interruption will be undone, and the Delta tables will be restored to their previous state.

It's important to note that when you stop a job run in the middle of execution, you may introduce inconsistencies into your data. For example, if the job was updating multiple tables at once and you stop it before all updates are complete, some tables may have been updated while others have not, resulting in inconsistent data. Additionally, if the job was in the process of performing some critical or non-reversible operations, such as deleting or overwriting data, stopping the job run in the middle could have unforeseen consequences.

To mitigate the risks of stopping a job run in the middle of execution, it's a good practice to design your jobs in a way that allows for safe stopping and restarting. For example, you can break your job into smaller, atomic steps that can be run independently, and use checkpoints to ensure that each step completes successfully before moving on to the next. You can also use logging and monitoring tools to track the progress of your job and identify any issues before they become critical.

View solution in original post

5 REPLIES 5

Anonymous
Not applicable

@Brendan Carey​ :

If you stop a job run in the middle of execution, any actions that have already been committed to Delta tables will persist. However, any uncommitted changes made by the job will be rolled back. This means that any transactions that were in progress at the time of the job interruption will be undone, and the Delta tables will be restored to their previous state.

It's important to note that when you stop a job run in the middle of execution, you may introduce inconsistencies into your data. For example, if the job was updating multiple tables at once and you stop it before all updates are complete, some tables may have been updated while others have not, resulting in inconsistent data. Additionally, if the job was in the process of performing some critical or non-reversible operations, such as deleting or overwriting data, stopping the job run in the middle could have unforeseen consequences.

To mitigate the risks of stopping a job run in the middle of execution, it's a good practice to design your jobs in a way that allows for safe stopping and restarting. For example, you can break your job into smaller, atomic steps that can be run independently, and use checkpoints to ensure that each step completes successfully before moving on to the next. You can also use logging and monitoring tools to track the progress of your job and identify any issues before they become critical.

brendanc19
New Contributor III

Thank you @Suteja Kanuri​ 

Anonymous
Not applicable

You're welcome! Happy learning

Vartika
Moderator
Moderator

Hey @Brendan Carey​ 

Hope everything is going great.

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark @Suteja Kanuri​'s answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you. 

Cheers!

brendanc19
New Contributor III

Will do, thank you Vartika

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.