-
Notifications
You must be signed in to change notification settings - Fork 58
[nexus] Make Instance Deletion actually idempotent #7556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch with this one! The new code feels substantially less sketchy to me.
I left a few nitpicky comments, but I have no major concerns about the change and would like to see this landed! I notice that this is currently stacked on top of your affinity work --- would it make sense to base this branch on main
instead and land the fix before the affinity stuff?
c428650
to
83516c8
Compare
Sure thing, pulled it out, will merge first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new commentary looks good to me!
Marking an instance deleted, within the "instance deletion saga", invokes `datastore.project_delete_instance`. This API performs the following tasks: 1. Marks the instance record "Destroyed", and detaches all disks 2. Performs a variety of other cleanup tasks (deleting SSH keys, not-yet-but-soon cleaning up affinity groups, marking migrations as deleted). These operations are not in a transaction, so it's possible for step (1) to succeed, but step (2) to not happen. In this case, it's critical that a second invocation of this API be able to actually perform cleanup. This PR adjusts the implementation of `project_delete_instance` to make this actually true.
Marking an instance deleted, within the "instance deletion saga", invokes
datastore.project_delete_instance
.This API performs the following tasks:
These operations are not in a transaction, so it's possible for step (1) to succeed, but step (2) to not happen.
In this case, it's critical that a second invocation of this API be able to actually perform cleanup.
This PR adjusts the implementation of
project_delete_instance
to make this actually true.