-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server] Always GC snapshots for workspaces #13121
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
@@ -69,8 +69,7 @@ export class WorkspaceDeletionService { | |||
const span = TraceContext.startSpan("garbageCollectWorkspace", ctx); | |||
|
|||
try { | |||
const deleteSnapshots = ws.softDeleted === "user"; |
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.
Look at git history, this has been there since the initial gitpod public repo commit.
Note that this is not true: As long as you have a snapshot link is still expected to work. 😕 A complete fix for this would be to promote the "snapshot" concept to be user-manageable: #11968 💡 The biggest problem is that snapshots "silently" stop working when their parent workspace gets GC'ed. We could try to work-around that by using the concept of "pinned" workspace. Those are excluded from GC. Whenever we WDYT? |
/hold for discussion This is a bit more out of my immediate context so not really sure what the best solution here is so happy to follow your lead. I mostly put up the PR as a drive-by but happy to leave it as is. |
I agree with @geropl that we need to surface snapshot handling more in the dashboard, but as it stands this change seem to make sense, as we can't start workspaces for snapshots where the workspace was deleted [code]. So whould we merge this change and continue the more general discussion in #11968? |
/unhold |
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.
After the insightful discussion, this code change looks good to me, thanks! (Had already started to review yesterday, but held off due to being uncertain about snapshot vs deleted workspace behavior.)
as we can't start workspaces for snapshots where the workspace was deleted [code]
Whoops, that's news to me. Thanks for digging it out!
This was also news to me too. Many thanks for linking to the code. 🙏
@@ -69,8 +69,7 @@ export class WorkspaceDeletionService { | |||
const span = TraceContext.startSpan("garbageCollectWorkspace", ctx); | |||
|
|||
try { | |||
const deleteSnapshots = ws.softDeleted === "user"; | |||
const successfulDeleted = await this.deleteWorkspaceStorage({ span }, ws, deleteSnapshots); | |||
const successfulDeleted = await this.deleteWorkspaceStorage({ span }, ws, true); |
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.
On a side note, this.deleteWorkspaceStorage
could be refactored to not take a 3rd argument that's always true
.
Description
Those snapshots would not be accessible anyway after we've garbage collected the Workspace.
Related Issue(s)
Fixes #
How to test
Release Notes
Documentation
Werft options:
Valid options are
all
,workspace
,webapp
,ide