Task #3184
closedStory #3209: As a user, I have Repository Versions
Add complete field to Publication.
100%
Description
Problem:¶
The creation of Publications happens in plugins, so some parts of this description apply to plugins only. The pulpcore changes should be limited to adding the field and preventing use of complete=False publications. The plugins should either update their code to prevent the transaction problem presented below, or use the Publication context manager to be written in https://pulp.plan.io/issues/3295
The current implementation of the publishing task starts an outer transaction. This is undesirable because:
- Long running transactions can accumulate DB locks which can result in contention.
- Could exceed DB limitations on rollback segement.
- Prevents progress reports from being committed.
The following line needs to be removed:
with transaction.atomic():
Without the outer transaction, the publication will be committed half-baked. There needs to be a way to prevent the publication from being used before it is completely constructed. Here is a recap of a list design discussion:
- Add an attribute called 'complete' to Publication which defaults to False.
- Update the viewset so that it excludes Publications that have complete=False
- Update the filterset for Publications to also exclude Publications that have complete=False
This part of the solution:¶
- Add Publication.complete
- Obscure rendered by the API when Publication.complete=False
Related issues
Updated by jortel@redhat.com about 7 years ago
- Subject changed from Publishing task uses single transaction. to Publishing task cannot start outer transaction.
Updated by bmbouter about 7 years ago
- Description updated (diff)
I'm leaving out the cleanup of these records on purpose. For both RepositoryVersion and Publications, we'll need a crash-safe cleanup mechanism. I plan to write that up in a separate ticket.
It also leaves out any validation of a Distribution in terms of only having ForeignKey relationships. If in the MVP a user associates a distribution with a Publication that has complete=False they can file a bug and we can fix it then.
Updated by amacdona@redhat.com almost 7 years ago
- Subject changed from Publishing task cannot start outer transaction. to Add complete field to Publication.
- Parent issue set to #3209
Updated by amacdona@redhat.com almost 7 years ago
- Blocks Story #3295: As a plugin writer, I have a tool that helps me write tasks that create Publications added
Updated by amacdona@redhat.com almost 7 years ago
- Description updated (diff)
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
Removed the items that have core code to set complete=True. Currently this is done by the plugin. When it is moved to pulpcore, it will be handled as part of https://pulp.plan.io/issues/3295
We also need to prevent Publications from being associated to Distributions, so I added a checklist item for the Distribution serializer.
Updated by amacdona@redhat.com almost 7 years ago
- Description updated (diff)
Updated by jortel@redhat.com almost 7 years ago
- Related to Task #3323: Refit to use the Publication (Facade) added
Updated by milan almost 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to milan
Updated by milan almost 7 years ago
Design decisions¶
The complete
attribute of a Publication
shall not be exposed thru any view; the API consumer won't, for instance, be able to filter Publications
based on this attribute.
The complete
attribute shall not be propagated thru the PublicationSerializer
either to avoid confusing the API consumer.
Updated by milan almost 7 years ago
- Status changed from ASSIGNED to POST
- Sprint/Milestone deleted (
54)
Just pushed a first revision of a patch: https://github.com/pulp/pulp/pull/3299
Added by milan almost 7 years ago
Added by milan almost 7 years ago
Revision 025991f0 | View on GitHub
Add complete field to Publication
Only complete Publications can be distributed.
Updated by milan almost 7 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|025991f003237f99ad6fa87aba1bdaf1fe1f1cd1.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Add complete field to Publication
Only complete Publications can be distributed.
closes: #3184 https://pulp.plan.io/issues/3184