-
Notifications
You must be signed in to change notification settings - Fork 143
Replicas should atomically update their distributions #7492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Pulp Replicas now present all of their distribution updates at the end of the replication process, rather than each individual repository-distribution pair being updated individually as syncs and publishes are completed. Unfortunately for users with existing replicated setups the very first replication post-upgrade will still have the old behavior - but afterwards it should work as expected. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,8 +106,10 @@ def remote_extra_fields(self, upstream_distribution): | |
| return {} | ||
|
|
||
| def create_or_update_remote(self, upstream_distribution): | ||
| if not upstream_distribution.get("repository") and not upstream_distribution.get( | ||
| "publication" | ||
| if ( | ||
| not upstream_distribution.get("repository") | ||
| and not upstream_distribution.get("repository_version") | ||
| and not upstream_distribution.get("publication") | ||
| ): | ||
| return None | ||
| url = self.url(upstream_distribution) | ||
|
|
@@ -171,10 +173,11 @@ def create_or_update_repository(self, remote): | |
| def distribution_extra_fields(self, repository, upstream_distribution): | ||
| """ | ||
| Return the fields that need to be updated/cleared on distributions for idempotence. | ||
|
|
||
| Note: repository, publication, and repository_version are NOT included here. | ||
| They are all updated atomically in finalize_replication after all syncs complete. | ||
| """ | ||
gerrod3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return { | ||
| "repository": get_url(repository), | ||
| "publication": None, | ||
|
Comment on lines
-176
to
-177
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yay for simplicity! |
||
| "base_path": upstream_distribution["base_path"], | ||
| } | ||
|
|
||
|
|
@@ -189,7 +192,6 @@ def create_or_update_distribution(self, repository, upstream_distribution): | |
| return None | ||
| needs_update = self.needs_update(distribution_data, distro) | ||
| if needs_update: | ||
| # Update the distribution | ||
| dispatch( | ||
| ageneral_update, | ||
| task_group=self.task_group, | ||
|
|
@@ -202,15 +204,15 @@ def create_or_update_distribution(self, repository, upstream_distribution): | |
| }, | ||
| ) | ||
| except self.distribution_model_cls.DoesNotExist: | ||
| # Dispatch a task to create the distribution | ||
| distribution_data["name"] = upstream_distribution["name"] | ||
| create_data = dict(distribution_data) | ||
| create_data["name"] = upstream_distribution["name"] | ||
| dispatch( | ||
| general_create, | ||
| task_group=self.task_group, | ||
| shared_resources=[repository, self.server], | ||
| exclusive_resources=self.distros_uris, | ||
| args=(self.app_label, self.distribution_serializer_name), | ||
| kwargs={"data": distribution_data}, | ||
| kwargs={"data": create_data}, | ||
| ) | ||
|
|
||
| def sync_params(self, repository, remote): | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky, it implies that other plugins may also have compatibility issues without modification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe pulp_python may also need a tweak