Skip to content

Improve group deletion #93509

Open
Open
@armenzg

Description

@armenzg

Move these lines:

# Tell seer to delete grouping records for these groups
call_delete_seer_grouping_records_by_hash(error_ids)
# Removing GroupHash rows prevents new events from associating to the groups
# we just deleted.
GroupHash.objects.filter(project_id=project.id, group__id__in=group_ids).delete()
# We remove `GroupInbox` rows here so that they don't end up influencing queries for
# `Group` instances that are pending deletion
GroupInbox.objects.filter(project_id=project.id, group__id__in=group_ids).delete()

into src/sentry/deletions/tasks/groups.py

If the aforementioned lines failed to execute, it will prevent the deletion of the groups.

This can be seen in this event (internal link).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions