Project

General

Profile

Actions

Bug #18116

closed

Katello::<Unit type>.import_all function breaks repository association after upgrading satellite or running reindex rake task

Added by Justin Sherrill almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Repositories
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1412486

Description of problem:
After upgrading to satellite 6.2.6, the repositories package count went unreasonably less in the Web UI

For example: Software collection repo only shows 30 packages

After investigating further I notice a bug in "import_all" function.

Katello::Rpm.import_all is fetching rpms from Pulp by chunk (default 100 units per chunk) and call the "sync_repository_associations" function on every chunk which breaks the repository associations in Katello. That is because "sync_repository_associations" will delete the existing associations that are not in the chunk.

For example:
Existing associations = [1, 2, 3, 4]

Pulp chunk 1 = [1, 2, 3, 5]

  1. Will be added
    new associations = Pulp chunk 1 - Existing associations
    [5] = [1, 2, 3, 5] - [1, 2, 3, 4]
  1. Will be deleted
    old association = Existing associations - Pulp chunk 1
    [4] = [1, 2, 3, 4] - [1, 2, 3, 5]

As a result the existing associations will become [1, 2, 3, 5].

Now Pulp chunk 2 = [6, 7, 8]

  1. Will be deleted
    old association = Existing associations - Pulp chunk 2
    [1, 2, 3, 5] = [1, 2, 3, 5] - [6, 7, 8]

As a result the existing associations will now become [6, 7, 8].

Version-Release number of selected component (if applicable):
6.2.6. Could also happen in the earlier versions because customer complain that it happened multiple times in different versions.

How reproducible:
Run satellite-installer --upgrade

Or

foreman-rake katello::reindex

Actions #1

Updated by Justin Sherrill almost 8 years ago

  • Category changed from 111 to Repositories
  • Assignee set to Justin Sherrill
  • Target version set to 157
  • Difficulty set to easy
Actions #2

Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6553 added
Actions #3

Updated by Justin Sherrill almost 8 years ago

  • Translation missing: en.field_release set to 188
Actions #4

Updated by Justin Sherrill almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF