initial commit for multidb#7862
Draft
YasenT wants to merge 8 commits into
Draft
Conversation
Contributor
Author
|
/retest |
getattr(value, 'pulp_domain_id', None) silently returns None for models that reach their domain transitively rather than through their own field (RepositoryVersion.repository, RepositoryContent.repository, ContentArtifact.content, PublishedArtifact.publication). RepositoryVersion is the single most common CreatedResource target in pulpcore (every sync/publish creates one), so this meant most real-world post-move CreatedResource rows for satellite-hosted domains silently resolved content_object on the wrong (control-plane) alias instead of raising or logging -- the exact KI-18 landmine, reached via an uncovered path. Found via live validation against a real two-Postgres environment: a genuine post-move CreatedResource pointing at a satellite RepositoryVersion resolved to a stale pre-cleanup copy on 'default' instead of the live row on the satellite alias. Fixes by walking the target's concrete FK/O2O fields (bounded depth, cycle-guarded) to find any related object exposing pulp_domain_id, rather than a hardcoded model list -- covers all four known cases generically and any future/plugin model with the same shape. Co-authored-by: Cursor <cursoragent@cursor.com>
…ntext test_content_object_domain_id_set_for_repository_version created the CreatedResource outside with_task_context(task), so CreatedResource.task (a required NOT NULL FK) never got auto-populated -- IntegrityError on insert. The aborted transaction from that failure can poison the connection state for whatever DB-touching test runs next in the same session, which is why this surfaced downstream (test_reconciliation.py) in a full-suite run rather than pointing at the actual buggy test. Verified clean: full pulpcore.tests.unit suite (363 passed, 2 skipped, 0 failed) against two real local Postgres instances mirroring the CI 'multi_db' matrix leg, plus a separate single-DB (no data_1) run confirming the skip path still works. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
@gerrod3 What do you think? Can I get a review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial PR for the multidb implementation. To test github actions. etc