Project

Profile

Help

Task #3184

Story #3209: As a user, I have Repository Versions

Add complete field to Publication.

Added by jortel@redhat.com almost 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 32

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:

  1. Add Publication.complete
  2. Obscure rendered by the API when Publication.complete=False

Checklist


Related issues

Related to File Support - Task #3323: Refit to use the Publication (Facade) MODIFIED Actions
Blocks Pulp - Story #3295: As a plugin writer, I have a tool that helps me write tasks that create Publications MODIFIED Actions

Associated revisions

Revision 025991f0 View on GitHub
Added by milan over 1 year ago

Add complete field to Publication

Only complete Publications can be distributed.

closes: #3184
https://pulp.plan.io/issues/3184

Revision 025991f0 View on GitHub
Added by milan over 1 year ago

Add complete field to Publication

Only complete Publications can be distributed.

closes: #3184
https://pulp.plan.io/issues/3184

Revision 025991f0 View on GitHub
Added by milan over 1 year ago

Add complete field to Publication

Only complete Publications can be distributed.

closes: #3184
https://pulp.plan.io/issues/3184

History

#1 Updated by jortel@redhat.com almost 2 years ago

  • Subject changed from Publishing task uses single transaction. to Publishing task cannot start outer transaction.

#2 Updated by jortel@redhat.com almost 2 years ago

  • Description updated (diff)

#3 Updated by jortel@redhat.com almost 2 years ago

  • Description updated (diff)

#4 Updated by bmbouter almost 2 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 over 1 year 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 over 1 year 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 over 1 year 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 over 1 year ago

  • Description updated (diff)

#10 Updated by jortel@redhat.com over 1 year ago

  • Description updated (diff)

#11 Updated by jortel@redhat.com over 1 year ago

  • Related to Task #3323: Refit to use the Publication (Facade) added

#12 Updated by milan over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to milan

#13 Updated by milan over 1 year 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 over 1 year ago

  • Sprint/Milestone set to 54

#15 Updated by milan over 1 year 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 over 1 year ago

  • Sprint/Milestone set to 54

#17 Updated by milan over 1 year ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#18 Updated by bmbouter over 1 year ago

  • Sprint set to Sprint 32

#19 Updated by bmbouter over 1 year ago

  • Sprint/Milestone deleted (54)

#20 Updated by dkliban@redhat.com over 1 year ago

  • Sprint/Milestone set to 3.0

#21 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)

Please register to edit this issue

Also available in: Atom PDF