Bug 1957588 - Duplicate YumMetadata index entries in content view repositories causing unneeded capsule sync
Summary: Duplicate YumMetadata index entries in content view repositories causing unne...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-06 05:31 UTC by Hao Chang Yu
Modified: 2022-08-09 03:24 UTC (History)
1 user (show)

Fixed In Version: tfm-rubygem-katello-4.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:10:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32533 0 Normal New Duplicate YumMetadata index entries in content view repositories causing unneeded capsule sync 2021-05-06 06:37:10 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:11:10 UTC

Description Hao Chang Yu 2021-05-06 05:31:07 UTC
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

# This will take some time as it will import all types of content
foreman-rake katello:reimport

# 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:

# 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

Comment 1 Bryan Kearney 2021-05-21 00:02:07 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32533 has been resolved.

Comment 3 Lai 2021-08-19 18:51:26 UTC
Steps to test.

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

# This will take some time as it will import all types of content
foreman-rake katello:reimport

# 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.

Expected results:
No capsule sync is triggered

Actual results:
Actions::Katello::Repository::CheckMatchingContent (success) [ 0.29s / 0.29s ]
---
checksum_match: true
matching_content: true

Did not see any capsule sync triggering on dynflow nor task page.

Verified on 6.10 snap 14 with tfm-rubygem-katello-4.1.1.11-1.el7sat.noarch

Comment 6 errata-xmlrpc 2021-11-16 14:10:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702


Note You need to log in before you can comment on or make changes to this bug.