Skip to content

chore(similarity): EA similarity record deletion task #76331

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
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/sentry/api/endpoints/project_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import math
import time
from datetime import timedelta
from random import randint
from uuid import uuid4

import orjson
Expand All @@ -14,7 +13,7 @@
from rest_framework.response import Response
from rest_framework.serializers import ListField

from sentry import audit_log, features, options
from sentry import audit_log, features
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import region_silo_endpoint
from sentry.api.bases.project import ProjectEndpoint, ProjectPermission
Expand Down Expand Up @@ -986,10 +985,9 @@ def delete(self, request: Request, project) -> Response:
project.rename_on_pending_deletion()

# Tell seer to delete all the project's grouping records
if features.has("projects:similarity-embeddings-grouping", project) or (
project.get_option("sentry:similarity_backfill_completed")
and randint(1, 100) <= options.get("similarity.delete_task_EA_rollout_percentage")
):
if features.has(
"projects:similarity-embeddings-grouping", project
) or project.get_option("sentry:similarity_backfill_completed"):
call_seer_delete_project_grouping_records.apply_async(args=[project.id])

return Response(status=204)
Expand Down
6 changes: 1 addition & 5 deletions src/sentry/tasks/delete_seer_grouping_records.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
from random import randint
from typing import Any

from sentry import features, options
Expand Down Expand Up @@ -59,10 +58,7 @@ def call_delete_seer_grouping_records_by_hash(
project
and (
features.has("projects:similarity-embeddings-grouping", project)
or (
project.get_option("sentry:similarity_backfill_completed")
and randint(1, 100) <= options.get("similarity.delete_task_EA_rollout_percentage")
)
or project.get_option("sentry:similarity_backfill_completed")
)
and not killswitch_enabled(project.id)
and not options.get("seer.similarity-embeddings-delete-by-hash-killswitch.enabled")
Expand Down
Loading