Skip to content

Conversation

onewland
Copy link
Contributor

@onewland onewland commented Sep 18, 2025

Provide mechanism for lightweight deletes API to handle eap_items.

https://linear.app/getsentry/issue/EAP-283/enable-eap-items-storage-to-delete-by-trace-id

Depends on getsentry/sentry-kafka-schemas#438

Tested a delete locally by:

  • setting is_enabled on the storage deletion_settings to 1
  • running curl -H "Content-Type: application/json" -X DELETE http://localhost:1218/eap_items -d "@test-delete.json"

test-delete.json contents:

{
    "query": {
        "columns": {
            "project_id": [1],
            "trace_id": ["85cc9542-ef90-4282-917e-5659721fb940"]
        }
    }
}

Before and after delete:

66bbc2e1b854 :) select trace_id, count() from eap_items_1_local where trace_id='85cc9542-ef90-4282-917e-5659721fb940' group by trace_id

SELECT
    trace_id,
    count()
FROM eap_items_1_local
WHERE trace_id = '85cc9542-ef90-4282-917e-5659721fb940'
GROUP BY trace_id

Query id: f68fc09c-57df-4a53-99b8-e5653800c78a

   ┌─trace_id─────────────────────────────┬─count()─┐
1. │ 85cc9542-ef90-4282-917e-5659721fb940 │       1 │
   └──────────────────────────────────────┴─────────┘

1 row in set. Elapsed: 0.007 sec.

66bbc2e1b854 :) select trace_id, count() from eap_items_1_local where trace_id='85cc9542-ef90-4282-917e-5659721fb940' group by trace_id

SELECT
    trace_id,
    count()
FROM eap_items_1_local
WHERE trace_id = '85cc9542-ef90-4282-917e-5659721fb940'
GROUP BY trace_id

Query id: dec2a45e-1e72-4a3e-a7da-63552141fe37

Ok.

0 rows in set. Elapsed: 0.008 sec.

@onewland onewland requested review from a team as code owners September 18, 2025 20:13
timeout_before_checking_execution_speed: 0

deletion_settings:
is_enabled: 1
Copy link
Member

Choose a reason for hiding this comment

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

This will allow the product to make delete queries to the existing endpoint, before I had a runtime config that also enabled things to feature gate it - but anyway maybe you could use the delete_allocation_policies and set concurrent queries to 0 or something in non S4S regions?

Copy link
Member

@MeredithAnya MeredithAnya Sep 18, 2025

Choose a reason for hiding this comment

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

@onewland okie so technically what I said is still true but since we haven't set up the topic and the topic mapping it will fail, but I mean eventually when you start testing it out

STORAGE_TOPIC: Mapping[str, Topic] = {
StorageKey.SEARCH_ISSUES.value: Topic.LW_DELETIONS_GENERIC_EVENTS
}

Copy link
Contributor Author

@onewland onewland Sep 18, 2025

Choose a reason for hiding this comment

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

Given the total volume of deletes we expect, I think we should trend toward there being only one lightweight delete topic. Messages already contain the storages they delete for and consumer groups could ignore delete messages for other storages (the subscription scheduler does this for followed consumer groups).

Having said that, I'm willing to keep this as-is for now because we're probably going to delete search issues at some point and then eap-items really will be the only storage for the delete pipeline.

I'll also change this to be is_enabled=0 or find some way to disable it before deploying

Copy link

codecov bot commented Sep 18, 2025

✅ All tests passed in 1255.79s

@onewland onewland force-pushed the config/allow-items-delete-by-trace-id branch from f2b577b to 9f7e844 Compare September 22, 2025 22:14
@onewland onewland enabled auto-merge (squash) September 24, 2025 15:21
@onewland onewland merged commit 6d552a3 into master Sep 24, 2025
34 of 35 checks passed
@onewland onewland deleted the config/allow-items-delete-by-trace-id branch September 24, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants