Skip to content

Conversation

@rgraber
Copy link
Contributor

@rgraber rgraber commented Nov 3, 2025

💭 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)
  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

…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 rgraber self-assigned this Nov 3, 2025
@rgraber rgraber changed the base branch from main to release/2.025.43 November 3, 2025 19:37
Copy link
Contributor

@noliveleger noliveleger 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 771ca84 into release/2.025.43 Nov 4, 2025
24 checks passed
@rgraber rgraber deleted the beccagraber/backport-1227 branch November 4, 2025 12:49
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