Skip to content
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

Machine object deletion will proceed if backing VM not found #59

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

himanshu-kun
Copy link
Contributor

@himanshu-kun himanshu-kun commented Dec 23, 2021

What this PR does / why we need it:
Till now for cases where a machine obj has ProviderID but the instance on provider is not found , deletion had been be retried.
With This PR if the AWS api returns InvalidInstanceIDNotFound error (which was earlier taken as an Internal error and not handled) , the instance deletion is assumed to be success.

Eventual consistency can't occur in this case as another PR handles that case for CreateMachine and so it can't reach DeleteMachine.
Also in worst case if instance still exists and we assumed its deletion with this new logic, orphan VM collection will deal with it.

Refer live issue 1201

Which issue(s) this PR fixes:
Fixes #56

Special notes for your reviewer:
I have changed the mockClient functions to return InvalidInstanceIDNotFound error in case instance is not found (which was not done earlier) . This mimics the actual behavior of AWS API.
The existing testcases are changed accordingly
Also wait for 5min is NOT introduced, as that would deviate the code from other providers a lot.

Release note:

The machine obj will be deleted if the AWS API indicate absence of backing instance. Earlier retrying used to happen, which led to cases where machine obj never got deleted.

@himanshu-kun himanshu-kun requested review from a team as code owners December 23, 2021 09:02
@gardener-robot gardener-robot added needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Dec 23, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 23, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Dec 23, 2021
@himanshu-kun
Copy link
Contributor Author

@AxiomSamarth I would like to merge this PR before PR #58 , as both have clashing changes. So rebase will be req.

Copy link
Collaborator

@AxiomSamarth AxiomSamarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm there is just one quick nit

pkg/mockclient/mockclient.go Outdated Show resolved Hide resolved
pkg/mockclient/mockclient.go Outdated Show resolved Hide resolved
pkg/mockclient/mockclient.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Jan 3, 2022
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 3, 2022
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 3, 2022
@himanshu-kun himanshu-kun added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 5, 2022
@himanshu-kun himanshu-kun changed the title No backing vm deletion Machine object deletion will proceed if backing VM not found Jan 6, 2022
@himanshu-kun himanshu-kun force-pushed the no-backing-vm-deletion branch from 6736fce to 496a9bb Compare January 6, 2022 07:03
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 6, 2022
@himanshu-kun himanshu-kun merged commit 51961cb into gardener:master Jan 6, 2022
@himanshu-kun himanshu-kun deleted the no-backing-vm-deletion branch January 6, 2022 07:12
@himanshu-kun
Copy link
Contributor Author

The test step didn't pass because there has been a major version jump for ginkgo and so tests don't work with that. A fixing PR to use gingko v1.16.5 has been raised to deal with it . See this

I verified that the integration tests and unit tests pass locally and so have merged the PR as this PR needed some discussion before merging

rishabh-11 added a commit to rishabh-11/machine-controller-manager-provider-aws that referenced this pull request Sep 6, 2023
himanshu-kun pushed a commit that referenced this pull request Sep 21, 2023
* map aws error codes to mcm error codes

* temporary vendor changes

* add error code to replace PR #59

* map ResourceExhausted error code for CreateMachine call

* remove unused variables from mockclient.go

* revert mcm vendor changes

* resolved make check errors

* address review comments

* address review comments part-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/s Size of pull request is small (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing to delete machine which instance id is not found in the infrastruture
6 participants