Skip to content

Conversation

@rgraber
Copy link
Contributor

@rgraber rgraber commented Oct 31, 2025

πŸ—’οΈ Checklist

  1. run linter locally
  2. update developer docs (API, README, inline, etc.), if any
  3. for user-facing doc changes create a Zulip thread at #Support Docs Updates, if any
  4. draft PR with a title <type>(<scope>)<!>: <title> DEV-1234
  5. assign yourself, tag PR: at least Front end and/or Back end or workflow
  6. fill in the template below and delete template comments
  7. review thyself: read the diff and repro the preview as written
  8. open PR & confirm that CI passes & request reviewers, if needed
  9. delete this section before merging

πŸ’­ Notes

Converts the remove_all_versions celery task (which accidentally had a time limit of 30 seconds) to a long-running migration to be in keeping with the rest of the long-running works.

πŸ‘€ Preview steps

  1. Run migrations
  2. If empty, populate the Version table with
for i in range(100): 
     Revision.objects.create(date_created=timezone.now())
     Version.objects.create(revision_id=i, content_type_id=21)
  1. Update VERSION_DELETION_BATCH_SIZE to 5
  2. Restart the kpi_worker
  3. Wait for the long-running migrations job to run
  4. 🟒 The number of objects in the version table is decreased
  5. 🟒 There are logs in the kpi_worker showing how many versions are deleted with each run

@rgraber rgraber self-assigned this Oct 31, 2025
@rgraber rgraber marked this pull request as ready for review November 3, 2025 13:54
@rgraber rgraber removed request for jnm and noliveleger November 3, 2025 13:54
@rajpatel24 rajpatel24 self-requested a review November 3, 2025 15:20
Copy link
Contributor

@rajpatel24 rajpatel24 left a comment

Choose a reason for hiding this comment

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

LGTM

@rgraber rgraber merged commit 2b19dcf into main Nov 3, 2025
11 checks passed
@rgraber rgraber deleted the beccagraber/dev-1227-convert-to-migration branch November 3, 2025 17:02
rgraber added a commit that referenced this pull request Nov 3, 2025
…227 (#6434)

### πŸ’­ Notes
Converts the remove_all_versions celery task (which accidentally had a
time limit of 30 seconds) to a long-running migration to be in keeping
with the rest of the long-running works.


### πŸ‘€ Preview steps

1. Run migrations
2. If empty, populate the Version table with
```
for i in range(100): 
     Revision.objects.create(date_created=timezone.now())
     Version.objects.create(revision_id=i, content_type_id=21)
```
3. Update `VERSION_DELETION_BATCH_SIZE` to 5
4. Restart the kpi_worker
5. Wait for the long-running migrations job to run
6. 🟒 The number of objects in the version table is decreased
7. 🟒 There are logs in the kpi_worker showing how many versions are
deleted with each run
rgraber added a commit that referenced this pull request Nov 4, 2025
…227 (#6442)

### πŸ’­ Notes
Backport of #6434
Converts the remove_all_versions celery task (which accidentally had a
time limit of 30 seconds) to a long-running migration to be in keeping
with the rest of the long-running works.


### πŸ‘€ Preview steps

1. Run migrations
2. If empty, populate the Version table with
```
for i in range(100): 
     Revision.objects.create(date_created=timezone.now())
     Version.objects.create(revision_id=i, content_type_id=21)
```
3. Update `VERSION_DELETION_BATCH_SIZE` to 5
4. Restart the kpi_worker
5. Wait for the long-running migrations job to run
6. 🟒 The number of objects in the version table is decreased
7. 🟒 There are logs in the kpi_worker showing how many versions are
deleted with each run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants