Project

Profile

Help

Issue #9393

modify API with both add_content_units and remove_content_units isn't always correct

Added by iballou 3 months ago. Updated 10 days ago.

Status:
ASSIGNED
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 110
Quarter:

Description

In Katello, I was trying to filter out the CentOS 7 OS repository (http://mirror.centos.org/centos-7/7/os/x86_64/) to have all content except the RPMs with the name kernel. The repo has just over 10K RPMs. Here are the general steps in the Katello code:

  1. Create a new repository
  2. Copy all content units except kernel into the new repo using the modify API:
api.repositories_api.modify(repository_reference.repository_href, add_content_units: content_unit_array, remove_content_units: ['*'])

-> Note: we used two calls to modify for this repo because we only wanted to copy 10,000 content units at once. The first call uses remove_content_units, but the second does not.

  1. Save the version and index from it

The first copy looks fine, but the next set of calls to the modify API leave the last repo version with a very small subset of the content units we asked for (in this case, 146 instead of 10071). the third set of copy actions, however, is correct, and this repeats. Every second set of copies (content view publish in Katello) is wrong.

We've seen this also with the RHEL 7.9 Kickstart repository. The first copy is fine, but the next has no RPMs at all. This repo is small enough (~5,000 RPMs) to only require one modify call, so the chunking that we're doing does not seem related.

Our workaround for this is to break out the content unit removal task instead of doing it in one API call. It seems the issue only relates to calls with both add_content_units and remove_content_units.

Pulp versions:

pulp-ansible (0.9.0)
pulp-certguard (1.4.0)
pulp-container (2.7.1)
pulp-deb (2.14.1)
pulp-file (1.8.2)
pulp-python (3.4.0)
pulp-rpm (3.14.2)
pulpcore (3.14.5)

History

#1 Updated by jsherril@redhat.com 3 months ago

  • Tags Katello added

#2 Updated by dkliban@redhat.com 3 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 105

#3 Updated by rchan 2 months ago

  • Sprint changed from Sprint 105 to Sprint 106

#4 Updated by dalley 2 months ago

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

#5 Updated by dalley 2 months ago

  • Priority changed from Normal to High

#6 Updated by rchan about 2 months ago

  • Sprint changed from Sprint 106 to Sprint 107

#7 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 107 to Sprint 108

#8 Updated by rchan 25 days ago

  • Sprint changed from Sprint 108 to Sprint 109

#9 Updated by rchan 10 days ago

  • Sprint changed from Sprint 109 to Sprint 110

Please register to edit this issue

Also available in: Atom PDF