Project

Profile

Help

Issue #9393

closed

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

Added by iballou about 1 year ago. Updated 11 months ago.

Status:
CLOSED - DUPLICATE
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 112
Quarter:

Description

Ticket moved to GitHub: "pulp/pulpcore/2046":https://github.com/pulp/pulpcore/issues/2046


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)
Actions #1

Updated by jsherril@redhat.com about 1 year ago

  • Tags Katello added
Actions #2

Updated by dkliban@redhat.com about 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 105
Actions #3

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 105 to Sprint 106
Actions #4

Updated by dalley about 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #5

Updated by dalley about 1 year ago

  • Priority changed from Normal to High
Actions #6

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 106 to Sprint 107
Actions #7

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 107 to Sprint 108
Actions #8

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 108 to Sprint 109
Actions #9

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 109 to Sprint 110
Actions #10

Updated by rchan about 1 year ago

  • Sprint changed from Sprint 110 to Sprint 111
Actions #11

Updated by rchan 11 months ago

  • Sprint changed from Sprint 111 to Sprint 112
Actions #12

Updated by pulpbot 11 months ago

  • Description updated (diff)
  • Status changed from ASSIGNED to CLOSED - DUPLICATE

Also available in: Atom PDF