Skip to content

Fix IntegrityError on multi-source copy with dependency solving#4468

Open
guylain-lavoie wants to merge 1 commit into
pulp:mainfrom
guylain-lavoie:fix-copy-content-multi-source-depsolving
Open

Fix IntegrityError on multi-source copy with dependency solving#4468
guylain-lavoie wants to merge 1 commit into
pulp:mainfrom
guylain-lavoie:fix-copy-content-multi-source-depsolving

Conversation

@guylain-lavoie
Copy link
Copy Markdown

When copy_content ran with dependency_solving=True and multiple source repository versions in the config mapped to the same destination repository, the task failed with an IntegrityError on the unique (repository, number) constraint, because new_version() was called once per source entry on the same destination inside a single @transaction.atomic block.

Group units by destination repository before creating new versions, so that each destination receives exactly one new version regardless of how many source entries target it.

closes #4286

Assisted By: Claude (Anthropic)

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@guylain-lavoie
Copy link
Copy Markdown
Author

test_upload_signed_package is failing. It was modified 12 days ago, I do not think my code is in cause. Anyone knows if I am wrong?

@pedro-psb
Copy link
Copy Markdown
Member

pedro-psb commented Jun 3, 2026

Hey @guylain-lavoie, I've seen some sign on upload flaky errors lately, so I also believe it might not be your changes (and well, it doesn't really is related at all).
Can you rebase and force push?

@pedro-psb
Copy link
Copy Markdown
Member

This is probably something related to shared fixtures, parallel runs, cleanups and test expectations about the uniqueness of artifacts...

When copy_content ran with dependency_solving=True and multiple source
repository versions in the config mapped to the same destination
repository, the task failed with an IntegrityError on the unique
(repository, number) constraint because new_version() was called once
per source entry on the same destination inside a single
@transaction.atomic block.

Group units by destination repository before creating new versions, so
that each destination receives exactly one new version regardless of how
many source entries target it.

closes pulp#4286

Assisted By: Claude (Anthropic)
@guylain-lavoie guylain-lavoie force-pushed the fix-copy-content-multi-source-depsolving branch from b871b76 to 1ee7b39 Compare June 3, 2026 19:22
@guylain-lavoie
Copy link
Copy Markdown
Author

Thank you @pedro-psb for your help. Rebased and pushed back. Unfortunately, same problem.

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.

Multi-Repository Copy Fails with IntegrityError

2 participants