Project

General

Profile

Bug #32533

Duplicate YumMetadata index entries in content view repositories causing unneeded capsule sync

Added by Hao Yu over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Views
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Description of problem:
Running foreman-rake katello:reimport script will cause Katello to index duplicate YumMetadata files into the content view repositories. These duplicate entries will cause Katello to incorrectly think the content has changed when publishing new version of the content view (matching_content: false). After that, Katello will trigger a capsule sync even the repositories aren't really changed.

Steps to Reproduce:
1. Create a content view with 1 repository (any repo with productid file). Publish the first version.
2. Create a composite content view with only the content view above. Publish the first version.
3. Now run the following command

  1. This will take some time as it will import all types of content
    foreman-rake katello:reimport
  1. for quicker, you can just run the following:
    foreman-rake console
    Katello::YumMetadataFile.import_all
    exit

4. Now publish the 2nd version of the CCV.

Actual results:
24: Actions::Katello::Repository::CheckMatchingContent (success) [ 0.29s / 0.29s ]
---
checksum_match: true
matching_content: false <========= Even the content is not changed.

Capsule sync is also triggered.
7: Actions::Pulp::Consumer::SyncCapsule (success) [ 477.46s / 21.69s ]
---
smart_proxy_history_id: 82
pulp_tasks:
...
result:
result: success
importer_id: yum_importer
exception:
repo_id: 1-ccv-rhscl-Library-76a1992b-a77f-4f52-b6a1-6b355e53a8cb
traceback:
started: '2021-05-06T04:59:45Z'
_ns: repo_sync_results
completed: '2021-05-06T05:06:42Z'
importer_type_id: yum_importer
error_message:
...
added_count: 0 <======= No update
removed_count: 0 <=======
updated_count: 0 <=======
...
result:
result: skipped <======= repo publish skipped
exception:
repo_id: 1-ccv-rhscl-Library-76a1992b-a77f-4f52-b6a1-6b355e53a8cb
started: '2021-05-06T05:06:42Z'
_ns: repo_publish_results
completed: '2021-05-06T05:06:42Z'
traceback:
distributor_type_id: yum_distributor
summary: 'Skipped: Repository content has not changed since last publish.'
error_message:
distributor_id: 1-ccv-rhscl-Library-76a1992b-a77f-4f52-b6a1-6b355e53a8cb
id: 60937962c16690717006baae
details: 'Skipped: Repository content has not changed since last publish.

Expected results:
No capsule sync is triggered

Additional info:

  1. foreman-rake console

repo = Katello::Repository.find_by_pulp_id("1-cv-rhscl-v7_0-76a1992b-a77f-4f52-b6a1-6b355e53a8cb")
repo.yum_metadata_files.size

=> 1

Katello::YumMetadataFile.import_all

=> nil

repo.yum_metadata_files.size

=> 2

Associated revisions

Revision 8e5d21a2 (diff)
Added by Hao Yu over 1 year ago

Fixes #32533 - Duplicate YumMetadataFile entries in repos

Running reimport will create duplicate YumMetadataFile entries for
the content view repositories. This will cause Katello to think that
the content is changed when publishing content view and then trigger
unneeded Capsule sync.

History

#1 Updated by The Foreman Bot over 1 year ago

  • Assignee set to Hao Yu
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/9348 added

#2 Updated by Justin Sherrill over 1 year ago

  • Triaged changed from No to Yes
  • Target version set to Katello 4.1.0

#3 Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.2.0 added

#4 Updated by Hao Yu over 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF