Skip to content

Add a `pending_delete` column to mark namespaces deleted by user

Abdul Wadood requested to merge 455871-create-column-filter-deleted-groups into master

What does this MR do and why?

The Groups::DestroyService takes a couple of seconds to delete the group but this duration can vary significantly when the group is large. Which sometimes results in transient errors when fetching a list of groups containing the deleted group.

Here we're adding a new column called pending_delete that will store the info that the group has been deleted by the user. We also have a pending_delete column in the projects table for the same reason.

As the namespaces table is very wide adding more columns to it is disabled. Therefore the pending_delete column is added to the namespace_details table.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Query plans

Query 1

Before: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/29629/commands/91970

After: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/29629/commands/91974

Query 2

Before: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/29647/commands/92014

After: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/29647/commands/92017

Screenshots or screen recordings

See the video of bug.

How to set up and validate locally

  1. Enable the following feature flags by running Feature.enable :<feature-flag>: ui_for_organizations, filter_deleted_groups.
  2. Go to the default organization page https://gdk.test:3000/-/organizations/default.
  3. Delete a group.
  4. The error as shown in the above video shouldn't be present and the deleted group is not shown on the page.

Related to #455871

Edited by Abdul Wadood

Merge request reports