Task #3184
closed
Story #3209: As a user, I have Repository Versions
Add complete field to Publication.
Status:
CLOSED - CURRENTRELEASE
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
- Subject changed from Publishing task uses single transaction. to Publishing task cannot start outer transaction.
- Description updated (diff)
- Description updated (diff)
- 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.
- Subject changed from Publishing task cannot start outer transaction. to Add complete field to Publication.
- Parent issue set to #3209
- Blocks Story #3295: As a plugin writer, I have a tool that helps me write tasks that create Publications added
- 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.
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Related to Task #3323: Refit to use the Publication (Facade) added
- Status changed from NEW to ASSIGNED
- Assignee set to milan
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.
- Sprint/Milestone set to 54
- Status changed from ASSIGNED to POST
- Sprint/Milestone deleted (
54)
- Sprint/Milestone set to 54
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Sprint/Milestone deleted (
54)
- Sprint/Milestone set to 3.0.0
- Tags deleted (
Pulp 3, Pulp 3 MVP)
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Add complete field to Publication
Only complete Publications can be distributed.
closes: #3184 https://pulp.plan.io/issues/3184