Skip to content

[ws-manager-mk2] Prevent partial workspace backups #16997

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 1 commit into from
Mar 24, 2023

Conversation

Furisto
Copy link
Member

@Furisto Furisto commented Mar 23, 2023

Description

Depends on #16823

After we have taken the backup we delete the workspace content and only then we update the backup condition on the workspace CR. If the delete operation is interrupted due to ws-daemon restart we will retry the backup due to the missing backup condition and will create only a partial backup. Instead we now first update the backup condition and only then we delete the workspace content.

Related Issue(s)

n.a.

How to test

  • Open workspace in preview
  • Stop workspace
  • Everything should work as usual

Release Notes

None

Documentation

Build Options:

  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish Options
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer Options
  • with-ee-license
  • with-dedicated-emulation
  • with-ws-manager-mk2
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@Furisto Furisto force-pushed the fo/mk2-restart-backup branch from 93eb0eb to 4aff3e3 Compare March 23, 2023 15:41
@roboquat roboquat added size/S and removed size/XL labels Mar 23, 2023
wsc.emitEvent(ws, "Backup", disposeErr)
wsc.emitEvent(ws, "Backup", fmt.Errorf("failed to backup workspace: %w", disposeErr))

err = wsc.operations.DeleteWorkspace(ctx, ws.Name)
Copy link
Member

Choose a reason for hiding this comment

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

how do we ensure that the workspace controller doesn't in the meantime remove the finalizer and delete the workspace resource (because the BackupComplete condition is added)? Is it OK if we don't complete the DeleteWorkspace call in rare occasions, e.g. if daemon restarts after Backup and before Delete, and when daemon comes back up the workspace resource is gone

Copy link
Member Author

Choose a reason for hiding this comment

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

We have housekeeping in place that deletes abandoned workspaces, so even if the deletion of a workspace is interrupted it will be cleaned up after 5 minutes. It currently only takes care of mk1 workspaces but I will add one for mk2 as well. Just for getting started with testing mk2 in Dedicated the current approach is good enough in my opinion. We have to fix it for prod though.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, that works

@roboquat roboquat merged commit 2cfe264 into main Mar 24, 2023
@roboquat roboquat deleted the fo/mk2-restart-backup branch March 24, 2023 10:50
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production feature: ws-manager-mk2 release-note-none size/S team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: In Validation
Development

Successfully merging this pull request may close these issues.

3 participants