Skip to content

Improve delete of workspaces - #4047

Merged
kcp-ci-bot merged 4 commits into
kcp-dev:mainfrom
mjudeikis:improve.delete.of.ws
Apr 20, 2026
Merged

kcp-ci-bot merged 4 commits into
kcp-dev:mainfrom
mjudeikis:improve.delete.of.ws

Conversation

@mjudeikis

Copy link
Copy Markdown
Contributor

Summary

Currently, workspace deletion is based on pooling.
This will wire informer-based deletes and index for logicalClusters.

In addition, reduce pooling to 5 mins from the previous 10.

This should improve the speed at which workspaces are deleted when logicalcluster goes away.

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #4012

Release Notes

Improve workspace deletion after LogicalCluster is deleted

@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Apr 20, 2026
@kcp-ci-bot

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot kcp-ci-bot added kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 20, 2026
@mjudeikis

Copy link
Copy Markdown
Contributor Author

/test all

@mjudeikis
mjudeikis marked this pull request as ready for review April 20, 2026 08:51
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 20, 2026
if !conditions.IsTrue(workspace, tenancyv1alpha1.WorkspaceContentDeleted) {
after := time.Since(logicalCluster.CreationTimestamp.Time) / 5
if max := time.Minute * 10; after > max {
if max := time.Minute * 5; after > max {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we maxing out at five minutes? I feel like we should put in a comment why we chose this over the previous 10m.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm just not a huge fan of undocumented magic numbers :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know the original number, either. It's just some arbitrary time "for workspace delete" to succeed.
10 min per test was WAY too long.

TBH not sure what even todo here :D Not enough data at scale to make a very informed decision.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added explanation :)

@ntnn ntnn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Otherwise looks good on a quick look.

/approve

@kcp-ci-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ntnn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2026
@ntnn

ntnn commented Apr 20, 2026

Copy link
Copy Markdown
Member

/lgtm

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2026
@kcp-ci-bot

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 963c4f0022ef8b07f97d59ecec595151e2d82d8c

@kcp-ci-bot
kcp-ci-bot merged commit a46d564 into kcp-dev:main Apr 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: workspace object deletion seems to lack behind logicalcluster deletion by considerable margin

3 participants