PULP-2385: Route pulp-content reads to RDS replica - #1468
Open
decko wants to merge 1 commit into
Open
Conversation
Assisted-by: OpenAI
Contributor
Reviewer's GuideRoutes pulp-content database reads to an optionally configured stage RDS replica through a Django database router, while keeping writes, migrations, app-status reads, and pull-through-related updates on the primary via ContextVar protection and a pulpcore image patch. Sequence diagram for primary protection during pull-throughsequenceDiagram
participant Content as pulp-content
participant Router as ContentReplicaRouter
participant Primary as RDS primary
participant Replica as RDS read replica
Content->>Router: db_for_read(model)
Router->>Replica: return replica
Replica-->>Content: content read
Content->>Router: use_primary_database()
Content->>Router: db_for_read(model)
Router->>Primary: return default
Primary-->>Content: pull-through write-related read
Content->>Router: db_for_write(model)
Router->>Primary: return default
Primary-->>Content: write completed
Content->>Router: ContextVar reset
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the replica endpoint is unavailable, misconfigured, or too far behind, content reads could fail or return stale data across the service, and pull-through behavior could be disrupted. Reverting restores primary reads, but requests that failed or served stale content during the rollout cannot be undone.
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.
Summary
Route
pulp-contentreads to the stage RDS read replica while keeping writes and pull-through operations on the primary database.Changes
Testing
Jira
PULP-2385
Labels: ai-assisted
Assisted-by: OpenAI
Summary by Sourcery
Route pulp-content database reads through the stage RDS replica without allowing write operations to use the replica.
New Features:
Enhancements:
Build:
Deployment:
Tests: