Skip to content

[server] Make account deletion for fault tolerant #9654

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

Merged
merged 2 commits into from
May 6, 2022

Conversation

geropl
Copy link
Member

@geropl geropl commented Apr 29, 2022

Description

#9645 revealed that we might fail during account deletion in face of (rare) bad data cases. This PR fixes that.

Related Issue(s)

Fixes #9645

How to test

  • connect to DB
    • create workspace on this branch
    • kubectl port-forward mysql-0 3306
    • mysql -u gitpod -h 127.0.0.1 -p, use gitpod;
  • select * from d_b_user; , copy your userId
  • INSERT INTO d_b_workspace SET id = < some ws id>, ownerId = < your userId >, creationTime = '2022-04-29 13:53:14.251075', contextUrl = 'http://example.org', description = '', context = '{}', config = '{}';
  • INSERT INTO d_b_workspace_instance SET id = < randomstromg >, workspaceId = < your ws id >, creationTime = '2022-04-29 13:53:14.251075', ideUrl = 'http://example.org', workspaceImage = 'some-image', region = 'does-not-exist', status ='{"phase": "pending"}', phasePersisted = 'pending';
  • run select phasePersisted from d_b_workspace_instance;
  • note how all entries are 'stopped' now ✔️

Release Notes

fix account deletion failing on bad DB state

Documentation

  • /werft with-vm=true

@geropl
Copy link
Member Author

geropl commented Apr 29, 2022

/werft run

👍 started the job as gitpod-build-gpl-9645-acc-deletion.2
(with .werft/ from main)

@geropl geropl force-pushed the gpl/9645-acc-deletion branch from be34c80 to 58552f8 Compare April 29, 2022 14:29
@roboquat roboquat added size/M and removed size/S labels Apr 29, 2022
@geropl geropl marked this pull request as ready for review April 29, 2022 15:01
@geropl geropl requested a review from a team April 29, 2022 15:01
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Apr 29, 2022
Copy link
Member

@easyCZ easyCZ left a comment

Choose a reason for hiding this comment

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

Test outlined worked, code looks sensible.
Adding hold in case you want someone else more familiar with this to have a look.
/hold

@geropl
Copy link
Member Author

geropl commented May 6, 2022

Adding hold in case you want someone else more familiar with this to have a look.

Thx, but I think the test does cut it.

/unhold

@roboquat roboquat merged commit 880e8e3 into main May 6, 2022
@roboquat roboquat deleted the gpl/9645-acc-deletion branch May 6, 2022 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Account Deletion might fail due to very old workspaces for unregistered clusters
3 participants