[server] Make account deletion for fault tolerant #9654
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
kubectl port-forward mysql-0 3306
mysql -u gitpod -h 127.0.0.1 -p
,use gitpod;
select * from d_b_user;
, copy your userIdINSERT 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';
select phasePersisted from d_b_workspace_instance;
Release Notes
Documentation