Project

Profile

Help

Task #3184

closed

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

Add complete field to Publication.

Added by jortel@redhat.com over 6 years ago. Updated over 4 years ago.

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

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 32
Quarter:

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

Related issues

Related to File Support - Task #3323: Refit to use the Publication (Facade)CLOSED - CURRENTRELEASEjortel@redhat.com

Actions
Blocks Pulp - Story #3295: As a plugin writer, I have a tool that helps me write tasks that create PublicationsCLOSED - CURRENTRELEASEjortel@redhat.com

Actions
Actions #1

Updated by jortel@redhat.com over 6 years ago

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

Updated by jortel@redhat.com over 6 years ago

  • Description updated (diff)
Actions #3

Updated by jortel@redhat.com over 6 years ago

  • Description updated (diff)
Actions #4

Updated by bmbouter over 6 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.

Actions #5

Updated by amacdona@redhat.com over 6 years ago

  • Subject changed from Publishing task cannot start outer transaction. to Add complete field to Publication.
  • Parent issue set to #3209
Actions #6

Updated by amacdona@redhat.com over 6 years ago

  • Blocks Story #3295: As a plugin writer, I have a tool that helps me write tasks that create Publications added
Actions #7

Updated by amacdona@redhat.com about 6 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.

Actions #8

Updated by amacdona@redhat.com about 6 years ago

  • Description updated (diff)
Actions #10

Updated by jortel@redhat.com about 6 years ago

  • Description updated (diff)
Actions #11

Updated by jortel@redhat.com about 6 years ago

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

Updated by milan about 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to milan
Actions #13

Updated by milan about 6 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.

Actions #14

Updated by jortel@redhat.com about 6 years ago

  • Sprint/Milestone set to 54
Actions #15

Updated by milan about 6 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

Actions #16

Updated by milan about 6 years ago

  • Sprint/Milestone set to 54

Added by milan about 6 years ago

Revision 025991f0 | View on GitHub

Add complete field to Publication

Only complete Publications can be distributed.

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

Added by milan about 6 years ago

Revision 025991f0 | View on GitHub

Add complete field to Publication

Only complete Publications can be distributed.

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

Actions #17

Updated by milan about 6 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #18

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 32
Actions #19

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (54)
Actions #20

Updated by dkliban@redhat.com about 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #21

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)
Actions #22

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF