Skip to content

Commit 96d24c6

Browse files
authored
fix(reprocessing): Attempt to fix clear_expired_raw_events (#68040)
In #67947 I thought that this was failing because we had no date index. It turns out there's a date index in postgres that isn't listed on the model, so that wasn't the problem. Instead, it seems like the problem is that when we load a `RawEvent` we fetch the `data` field on load, and we do all the calls serially. Figuring out how to reword this model seems risky, so I'm lowing the number of rows we fetch per query in the hopes that we actually managed to perform some deletes. <!-- Describe your PR here. -->
1 parent 03d50bd commit 96d24c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sentry/tasks/reprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def clear_expired_raw_events():
6262
from sentry.models.reprocessingreport import ReprocessingReport
6363

6464
# Max number of times to attempt to query each model
65-
MAX_BATCHES_PER_MODEL = 1000
65+
MAX_BATCHES_PER_MODEL = 10000
6666
# Number of rows to fetch/delete for each query
67-
LIMIT_PER_QUERY = 1000
67+
LIMIT_PER_QUERY = 100
6868

6969
def batched_delete(model_cls, **filter):
7070
# Django 1.6's `Queryset.delete` runs in this order:

0 commit comments

Comments
 (0)