Project

Profile

Help

Issue #4818

closed

Updating a yum_repo_metadata_file unit silently does nothing

Added by rmcgover over 5 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.20.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 53
Quarter:

Description

Attempting to upload and import a yum_repo_metadata_file unit, to a repo which already has a unit with matching data_type, claims to succeed but silently does nothing.

Steps to reproduce

(pulp-admin doesn't seem to support upload of yum_repo_metadata_file, but it can be done e.g. with curl)

1. Create & import a unit with data_type "sometype" and content "red" to zoo repo by a sequence like:

curl -X POST https://rhsm-pulp-dev:443/pulp/api/v2/content/uploads/ --data '{}'

curl -X PUT https://rhsm-pulp-dev:443/pulp/api/v2/content/uploads/9f24c7e9-99af-4182-b354-3fe1e286dc54/0/ --data 'red'

curl -X POST https://rhsm-pulp-dev:443/pulp/api/v2/repositories/zoo/actions/import_upload/ --data '{"unit_type_id": "yum_repo_metadata_file", "upload_id": "9f24c7e9-99af-4182-b354-3fe1e286dc54", "unit_key": {"repo_id": "zoo", "data_type": "sometype"}, "unit_metadata": {"checksum": "b1f51a511f1da0cd348b8f8598db32e61cb963e5fc69e2b41485bf99590ed75a", "checksum_type": "sha256"}}'

2. Wait for resulting task to complete

3. Search for yum_repo_metadata_file units in zoo repo

4. Create & import a unit with data_type "sometype" and content "green" to zoo repo by a sequence like:

curl -X POST https://rhsm-pulp-dev:443/pulp/api/v2/content/uploads/ --data '{}'

curl -X PUT https://rhsm-pulp-dev:443/pulp/api/v2/content/uploads/bd96946f-551c-4c75-8da3-58db82d3ea04/0/ --data 'green'

curl -X POST https://rhsm-pulp-dev:443/pulp/api/v2/repositories/zoo/actions/import_upload/ --data '{"unit_type_id": "yum_repo_metadata_file", "upload_id": "bd96946f-551c-4c75-8da3-58db82d3ea04", "unit_key": {"repo_id": "zoo", "data_type": "sometype"}, "unit_metadata": {"checksum": "ba4788b226aa8dc2e6dc74248bb9f618cfa8c959e0c26c147be48f6839a0b088", "checksum_type": "sha256"}}'

5. Wait for resulting task to complete

6. Search for yum_repo_metadata_file units in zoo repo

Actual results

At step (3), yum_repo_metadata_file unit with checksum b1f51a511f1d appears in the repo.

At step (6), yum_repo_metadata_file unit with checksum ba4788b22 does NOT appear in the repo, while b1f51a511f1d still appears.

i.e. no change has been made to units in the repo, while Pulp claims all tasks succeeded and didn't report any failure to the caller, nor log any warnings or errors.

Expected results

At step (3), yum_repo_metadata_file unit with checksum b1f51a511f1d appears in the repo.

At step (6), yum_repo_metadata_file unit with checksum ba4788b22 appears in the repo, while b1f51a511f1d no longer appears.

Additional info

It seems to be a regression in Pulp 2.8 introduced by f95eb3f40a79, https://pulp.plan.io/issues/1406.

Goal of that issue was meant to be:

The goal is to make 2.8.0 behavior the same as the pre 2.8.0 behavior

But it seems like that wasn't achieved, as updating an existing yum_repo_metadata_file unit worked in Pulp <2.8 and replaced old unit with new, while now the request to update is instead silently ignored.

Tested with pulp_rpm 135059e4b4e86421c (2-master).

Also available in: Atom PDF