Task #3184
Story #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
Associated revisions
Revision 025991f0
View on GitHub
Add complete field to Publication
Only complete Publications can be distributed.
History
#1
Updated by jortel@redhat.com about 3 years ago
- Subject changed from Publishing task uses single transaction. to Publishing task cannot start outer transaction.
#2
Updated by jortel@redhat.com about 3 years ago
- Description updated (diff)
#3
Updated by jortel@redhat.com about 3 years ago
- Description updated (diff)
#4
Updated by bmbouter about 3 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.
#5
Updated by amacdona@redhat.com about 3 years ago
- Subject changed from Publishing task cannot start outer transaction. to Add complete field to Publication.
- Parent task set to #3209
#6
Updated by amacdona@redhat.com almost 3 years ago
- Blocks Story #3295: As a plugin writer, I have a tool that helps me write tasks that create Publications added
#7
Updated by amacdona@redhat.com almost 3 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.
#8
Updated by amacdona@redhat.com almost 3 years ago
- Description updated (diff)
#9
Updated by amacdona@redhat.com almost 3 years ago
- Description updated (diff)
#10
Updated by jortel@redhat.com almost 3 years ago
- Description updated (diff)
#11
Updated by jortel@redhat.com almost 3 years ago
- Related to Task #3323: Refit to use the Publication (Facade) added
#12
Updated by milan almost 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to milan
#13
Updated by milan almost 3 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.
#14
Updated by jortel@redhat.com almost 3 years ago
- Sprint/Milestone set to 54
#15
Updated by milan almost 3 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
#16
Updated by milan almost 3 years ago
- Sprint/Milestone set to 54
#17
Updated by milan almost 3 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp|025991f003237f99ad6fa87aba1bdaf1fe1f1cd1.
#18
Updated by bmbouter almost 3 years ago
- Sprint set to Sprint 32
#19
Updated by bmbouter almost 3 years ago
- Sprint/Milestone deleted (
54)
#20
Updated by dkliban@redhat.com almost 3 years ago
- Sprint/Milestone set to 3.0.0
#21
Updated by bmbouter over 1 year ago
- Tags deleted (
Pulp 3, Pulp 3 MVP)
#22
Updated by bmbouter about 1 year ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Please register to edit this issue
Add complete field to Publication
Only complete Publications can be distributed.
closes: #3184 https://pulp.plan.io/issues/3184