Skip to content

[PR #8021/edef4358 backport][3.116] Make content_ids migration incremental and restartable - #8031

Merged
gerrod3 merged 1 commit into
3.116from
patchback/backports/3.116/edef435849726ca02cda937da16bdd7a0abc1ea4/pr-8021
Sep 1, 2026
Merged

[PR #8021/edef4358 backport][3.116] Make content_ids migration incremental and restartable#8031
gerrod3 merged 1 commit into
3.116from
patchback/backports/3.116/edef435849726ca02cda937da16bdd7a0abc1ea4/pr-8021

Conversation

@patchback

@patchback patchback Bot commented Aug 31, 2026

Copy link
Copy Markdown

This is a backport of PR #8021 as merged into main (edef435).

Summary

  • Rewrite the 0152 content_ids data fill to compute each repository version in Postgres from the previous version (plus added, minus removed) instead of an N+1 ORM loop that ships UUID arrays through Python.
  • Commit per repository (atomic = False) so a DBaaS statement/session timeout does not roll back already-filled repos. Re-running migrate continues from remaining NULLs, then AlterField makes the column required.
  • Alternative to fix(0152_alter_repositoryversion_content_ids): add a batch size to avoid timeout on large update #8017: shrinking bulk_update batches does not fix the per-version recompute or the single wrapping transaction.

Test plan

  • Unit test covering add/remove across versions, already-filled post-3.83 versions as the incremental base, and a second repo left untouched
  • CI unit tests on this PR
  • Confirm an upgrade that previously died on 0152 can re-run migrate without losing progress

Made with Cursor

Perform the cache populating entirely in SQL and add per repository commits.

Assisted By: Cursor Grok 4.6

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit edef435)
@gerrod3
gerrod3 merged commit 09e3048 into 3.116 Sep 1, 2026
35 of 40 checks passed
@gerrod3
gerrod3 deleted the patchback/backports/3.116/edef435849726ca02cda937da16bdd7a0abc1ea4/pr-8021 branch September 1, 2026 18:56
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.

1 participant